thebobby Posted January 22, 2011 Posted January 22, 2011 <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "config.php"; include "global_func.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "../class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //Money Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto")); $payout=($ticketssold*50000)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM moneylotto where ticketid=$rand"); $winner = mysql_fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly lottery, and claimed your ".money_formatter($payout)." reward!",$c); $db->query("INSERT INTO announcements VALUES('User ID {$winner['userid']} won the weekly lottery. Well done!', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query("UPDATE users SET bankmoney=bankmoney+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE moneylotto"); $db->query("INSERT INTO moneylottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Money Lotto End //Points Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto")); $payout=($ticketssold*50)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM pointslotto where ticketid=$rand"); $winner=$db->fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly points lottery, and claimed your $payout points reward!",$c); $db->query("UPDATE users SET crystals=crystals+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE pointslotto"); $db->query("INSERT INTO pointslottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Points Lotto End ?> Quote
Blade Maker Posted January 22, 2011 Posted January 22, 2011 Is the cron calling the page.php or whatever? Post the cron please. Quote
Blade Maker Posted January 22, 2011 Posted January 22, 2011 Is that the action you told it to do? Please post exactly what is in the action. It might also be the code but I just wanna check this part first. Quote
thebobby Posted January 22, 2011 Author Posted January 22, 2011 here all others work it dont work manually either curl http://mafia.com/cron.php Quote
Blade Maker Posted January 22, 2011 Posted January 22, 2011 As long as that is the exact url then that part is good, what is not working. Quote
Diesl Posted January 22, 2011 Posted January 22, 2011 when you use the curl, you have to make sure you include the ?code= at the end. The code will be in your config.php file So in the end you will have curl http://mafiasfinest.com/lotterycron.php?code=addcodehere otherwise nothing will run, due to the code on line 4: if($_GET['code'] != $_CONFIG['code']) { die(""); } You can comment that line out for testing purposes, but make sure you add in the previous bit to the curl. Quote
thebobby Posted January 22, 2011 Author Posted January 22, 2011 Warning: require(../class/class_db_mysql.php) [function.require]: failed to open stream: No such file or directory in /home/mafiasfi/public_html/lotterycron.php on line 9 Fatal error: require() [function.require]: Failed opening required '../class/class_db_mysql.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mafiasfi/public_html/lotterycron.php on line 9 <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "config.php"; include "global_func.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "../class/class_db_{$_CONFIG['driver']}.php"; line 9 $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) Quote
Dominion Posted January 22, 2011 Posted January 22, 2011 Then the issue is clearly stated the file does not exist were you are pointing. ;) On a side note please use code tags – [ php] [/php] (without the space on the 1st tag). Learn to post in the right place. Quote
thebobby Posted January 22, 2011 Author Posted January 22, 2011 wats that code tags – [ php] [/php] (without the space on the 1st tag). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.