firecamp Posted April 25, 2009 Posted April 25, 2009 <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } 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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET gameturns=50"); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change $db->query("update shopitems set sitemQTY = ".$stockreset." "); $db->query("UPDATE users SET fishing_aloud=20"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0 ); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0 and donatordays>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?> then i get this when i type my game and cron_day.php at the end Parse error: syntax error, unexpected T_STRING in /home/thedestr/public_html/cron_day.php on line 43 anyone know why? Quote
Tonka Posted April 25, 2009 Posted April 25, 2009 Re: cron_day.php used code tags next time and only post 5-10 lines above the line with the error Quote
firecamp Posted April 25, 2009 Author Posted April 25, 2009 Re: cron_day.php ok so how do i fix? can you show me the code pls? Quote
Faz` Posted April 25, 2009 Posted April 25, 2009 Re: cron_day.php Post the code again using tags. Quote
firecamp Posted April 25, 2009 Author Posted April 25, 2009 Re: cron_day.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } 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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET gameturns=50"); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change $db->query("update shopitems set sitemQTY = ".$stockreset." "); $db->query("UPDATE users SET fishing_aloud=20"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0 ); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0 and donatordays>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?> Quote
XCU53S Posted April 25, 2009 Posted April 25, 2009 Re: cron_day.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } 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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET gameturns=50"); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change $db->query("update shopitems set sitemQTY = ".$stockreset." "); $db->query("UPDATE users SET fishing_aloud=20"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0 ); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0 and donatordays>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?> he means put it in them lol i seriously think you should start at html before making a game. Quote
firecamp Posted April 25, 2009 Author Posted April 25, 2009 Re: cron_day.php :x we aint all experienced like u i have only just started :x Quote
shrek1609 Posted April 25, 2009 Posted April 25, 2009 Re: cron_day.php mate what people are trying to say is you are asking for help but making it really difficult for anyone to help you... if you get an error such as you have stating a certain line number in this case line number 43... just post that line and 5 to 10 lines above it... no one is going to sit and count the lines of code till they reach the problem line... posting just these lines (the last line you post being the error line people are more likely to help... when you post if you look at the buttons above where you are typing in your post you will see a button with a # on it... click this THEN post the code between the [code*] and [/code*] (*'s will not show i have put these into to stop the code box showing... Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php but that doesnt get me any nearer to solving my error Quote
wolfe Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php You really should listen to the advice if you want help. Using the tags make it legible and sending us the snippet of code around the error would really help. Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php ok here you go <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } 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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } mysql_query("DELETE FROM fedjail WHERE fed_days=0"); mysql_query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET gameturns=50"); mysql_query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); mysql_query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); mysql_query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0 ); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); while($r=$db->fetch_row($q)) $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?> Parse error: syntax error, unexpected T_STRING in /home/thedestr/public_html/cron_day.php on line 40 this is line 40 $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); Quote
Haunted Dawg Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } 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; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } mysql_query("DELETE FROM fedjail WHERE fed_days=0"); mysql_query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET gameturns=50"); mysql_query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); mysql_query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); mysql_query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0'); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); while($r=$db->fetch_row($q)) $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?> Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php nope that didnt work Parse error: syntax error, unexpected '}' in /home/thedestr/public_html/cron_day.php on line 76 Quote
shrek1609 Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php i think there is a missing { here: while($r=$db->fetch_row($q)) $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); try while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php tried that now it says Cron Not Ran :? Quote
shrek1609 Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php try running the cron manually... ie take the full link out of your cron panel not the curl bit just the http://yourgame.com etc if it runs with out erroring manually then your problem is in the cron panel in cpanel... perhaps ask your hosts for help if it is that Quote
shrek1609 Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php i assume you have set up the cron jobs in cpanel ? Quote
shrek1609 Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php ok so go into your cron panel find the cron_day url then copy and paste it into the url bar on your browser... this will run it manually... ignore the curl part just copy the link from http://yourgame.com etc including all the long number code at the end of the url... if it runs correctly you will only see a blank white page, if it errors you will get text... if it runs currectly then your error is server side NOT script side Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php yeh that is blank but i know they dont work cos u cant vote daily any more :? Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php its working now thanks! also does anyone know where to get all your config.php and mysql.php information back from? cos i deleted all my file to start again Quote
shrek1609 Posted April 26, 2009 Posted April 26, 2009 Re: cron_day.php i'm really not understanding this at all... have you actually bought mccodes ? if you have deleted all your files then you should only have deleted them from the server, surely you have the original zip file with the script in when you purchased it... hence you just upload the files again ? Quote
firecamp Posted April 26, 2009 Author Posted April 26, 2009 Re: cron_day.php no cos someone else got the codes for me Quote
WE11ER Posted April 30, 2009 Posted April 30, 2009 Re: cron_day.php ,,, sorry to pop in here,,, when you put a cron into cpanel do you actually put curl in with it? ty 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.