| Author |
Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
|
i really need help with crons, i need to make it so my members get back life once 5 mins have been up and its not happening, can someone please tell me what i could do to fix this? here is of the code <?php
include "config.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'];
}
//brave update
$query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave ";
$query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave";
$query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp<maxhp";
$query4="UPDATE users SET hp=maxhp WHERE hp>maxhp";
$db->query($query);
$db->query($query2);
$db->query($query3);
$db->query($query4);
//enerwill update
$query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy AND donatordays=0";
$query5="UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy<maxenergy AND donatordays>0";
$query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy";
$query3="UPDATE users SET will=will+10 WHERE will<maxwill";
$query4="UPDATE users SET will=maxwill WHERE will>maxwill";
$db->query($query);
$db->query($query5);
$db->query($query2);
$db->query($query3);
$db->query($query4);
if($set['validate_period'] == 5 && $set['validate_on'])
{
$db->query("UPDATE users SET verified=0");
}
if($set['validate_period'] == 15 && $set['validate_on'] && in_array(date('i'),array("00", "15", "30", "45")))
{
$db->query("UPDATE users SET verified=0");
}
?>
|
|
| Author |
RE: Cron Jobs |
Mr_Cheese
HBH Owner

Posts: 2468
Location: Brighton, UK
Joined: 30.11.04 Rank: God |
|
|
what does crontab -l look like? maybe you got the cronjob line wrong? |
|
| Author |
RE: Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
i have no idea where that is so i take it thats my problem.....now to figure out where and what that is
Edited by alldatizholy on 27-08-08 01:10 |
|
| Author |
RE: Cron Jobs |
Zephyr_Pure
Member

Posts: 2402
Location:
Joined: 15.09.06 Rank: God |
|
Your CPanel should give you access to your crons... unless you're running your own web server, in which case the crontab command in a local terminal would work (if you're running it on Linux). Also, slightly OT... why are you using PEAR? Unless you're using a RDBMS other than MySQL, just use regular PHP.
You should explain your environment more to get meaningful help.
I still check PMs from time to time.


Our responses were moronic, why shouldn't he follow suit? - Futility |
|
| Author |
RE: Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
this is what the cron job looks like now, oh and btw i just looked at it....i just changed the ***** to 00*** for the cron day so thats fixed

Edited by alldatizholy on 27-08-08 01:33 |
|
| Author |
RE: Cron Jobs |
Zephyr_Pure
Member

Posts: 2402
Location:
Joined: 15.09.06 Rank: God |
|
Why are you passing a query string into your cron jobs? Not that that would be the problem... just curious.
Looks like your every 5 min cron is set up right... not sure what the problem is, unless your scblockedript is off. Do you get any sign that the cron job is actually running as scheduled? Like, the usual email?
Edit: Yep, it's your code. Quit putting semi-colons after the strings you're passing into functions. Like this...
$settq=$db->query("SELECT * FROM settings";);
... and the die at the top, and probably a few others.
I still check PMs from time to time.


Our responses were moronic, why shouldn't he follow suit? - Futility
Edited by Zephyr_Pure on 27-08-08 01:34 |
|
| Author |
RE: Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
ok so what should i do? cause im so damn lost right now its not even funny
Edited by alldatizholy on 27-08-08 01:40 |
|
| Author |
RE: Cron Jobs |
Zephyr_Pure
Member

Posts: 2402
Location:
Joined: 15.09.06 Rank: God |
|
|
alldatizholy wrote:
ok so what should i do? cause im so damn lost right now its not even funny
Well, first, you should read my fucking post so you can see what the problem is. Next... you should fix the problem.
If you don't have the PHP knowledge to fix a simple, repeated syntax mistake, then you need to close out of your CPanel and your pirated copy of Dreamweaver and re-learn the basics.
I still check PMs from time to time.


Our responses were moronic, why shouldn't he follow suit? - Futility |
|
| Author |
RE: Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
|
ur an asshole....fuck off man i asked for help and people like u act all bad cause u have knowledge..... |
|
| Author |
RE: Cron Jobs |
Futility
Member

Posts: 715
Location: USA
Joined: 17.12.07 Rank: God |
|
And yet you decide to insult him and act like an idiot rather than appealing to his better side and getting some of that knowledge out of him... Good choice.
|
|
| Author |
RE: Cron Jobs |
alldatizholy
Member
Posts: 41
Location: Colorado Springs, CO
Joined: 11.06.07 Rank: HBH Guru Warn Level: 5
|
|
|
like i said, im confused and i need help and what does he do....he acts like an ass, ive been looking it up for a while now and im confused, all i wanted was some better explained help |
|
| Author |
RE: Cron Jobs |
Zephyr_Pure
Member

Posts: 2402
Location:
Joined: 15.09.06 Rank: God |
|
|
alldatizholy wrote:
ur an asshole....fuck off man i asked for help and people like u act all bad cause u have knowledge.....
Oh, okay... like I haven't heard that before when I've helped someone that prefers a good spoon-feed. Seriously, you want it explained simpler than this...
Zephyr_Pure wrote:
Quit putting semi-colons after the strings you're passing into functions.
If it gets any simpler than that, your brain will shut down. So, go fix your fucking code and die in a hole, you ungrateful little shithead.
I still check PMs from time to time.


Our responses were moronic, why shouldn't he follow suit? - Futility |
|
| Author |
RE: Cron Jobs |
slpctrl
Member
Posts: 945
Location: 2147483647
Joined: 19.04.07 Rank: God |
|
Yeah; he told you pretty plainly. If you can't fix that, you shouldn't even be looking at the code at all.
|
|