Jump to content
MakeWebGames

Crons


SMOKEY_TEK

Recommended Posts

For some odd reason my cron jobs aren't working, I thought I had set it up right but I guess I didn't. Could someone please help me to get this working...

Here is the file that I am trying to have updated..

File called update.php

<?php
include (DIRNAME(__FILE__) . '/dbcon.php');
include (DIRNAME(__FILE__) . '/classes.php');

if ($_GET['update'] != "569864") {
	echo "
	<html>
	<head>
		<link rel='stylesheet' type='text/css' href='http://www.hitmanmassacre.com/style.css' media='all' />
	</head>
	<body>
		<div class='wrapper'>
		<div class='header'>
		<img src='http://www.hitmanmassacre.com/images/2a4zfqo.jpg' alt='Hitman Massacre' title='Hitman Massacre' />
		</div><!-- end .header  -->

	<div class='left'>
	<h3>Menu:</h3>
	<ul>
		<li><a href='index.php'>Home</a></li>
		<li><a href='login.php'>Login</a></li>
		<li><a href='register.php'>Register</a></li>
		<li><a href='forgotpassword.php'>Forgot Password</a></li>
		<li><a href='screenshots.php'>Screenshots</a></li>
		<li><a href='contactus.php'>Contact Us</a></li>
	</ul>
	</div><!-- end .left  -->

	<div class='content'>
	<h3>Hitman Massacre - Error</h3>
	<p align='center'>Your not authorized to be in here.</p>
	</div></div>
	</body></html>";
	die();
} else {

$result2 = mysql_query("DELETE FROM `spylog` WHERE `spyAge` < ".time() - 172800);// clear out old spy log stuff

$result = mysql_query("SELECT * FROM `users`");
	while($line = mysql_fetch_assoc($result)) {
	$updates_user = new User($line['id']);
	$newmoney = $updates_user->money;
	$username = $updates_user->username;
	$new_contracted = $updates_user->contracted - 1;
	$new_contracted = ($new_contracted < 0) ? 0 : $new_contracted;
		if($newcontracted > 1) {
			$interest = .04;
		} else {
			$interest = .02;
		}

	$mailban = $updates_user->mailban - 1;
	$new_mailban = ($new_mailban < 0) ? 0 : $new_mailban;

	$frozen = $updates_user->frozen - 1;
	$new_frozen = ($new_frozen < 0) ? 0 : $new_frozen;

	$banned = $updates_user->banned - 1;
	$new_banned = ($new_banned < 0) ? 0 : $new_banned;

	$forumban = $updates_user->forumban - 1;
	$new_forumban = ($new_forumban < 0) ? 0 : $new_forumban;

$newbank = ceil($updates_user->bank + ($updates_user->bank * $interest));
if($updates_user->job != 0){
	$result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'");
	$worked_job = mysql_fetch_array($result_job);
	$new_money = $new_money + $worked_job['money'];
}
$result_2 = mysql_query("
	UPDATE `users` 
	SET `money` = '".$new_money."', 
	    `mailban` = '".$new_mailban."', 
		`forumban` = '".$new_forumban."', 
		`banned` = '".$new_banned."', 
		`frozen` = '".$new_frozen."', 
		`contracted` = '".$new_contracted."', 
		`bank` = '".$newbank."', 
		`searchdowntown` = '100',
		`dailyReward` = '1',
		`luckyDip` = '1'
		`daysold` = `daysold`+1
	WHERE `username` = '".$username."'");
}
 }
?>
Link to comment
Share on other sites

Okay let's say my job was ID: 5 .

 

$result_job = mysql_query("SELECT * FROM `jobs` WHERE `id` = '".$updates_user->job."'");

 

And let's say ".$updates_user->job." is 5 .

So the `id` is the job id's not the users ...

So it is looking in the jobs table for ID 5 to get that information...

Edited by SMOKEY_TEK
Forgot something
Link to comment
Share on other sites

$newbank = ceil($updates_user->bank + ($updates_user->bank * $interest));

if($updates_user->job != 0){

	$result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'");

	$worked_job = mysql_fetch_array($result_job);

	$newmoney = $newmoney + $worked_job['money'];

	Send_Event($updates_user->id, "<font color = 'yellow'>You earned</font><font color = '#ffffff'> $".$worked_job['money']."</font> <font color = 'yellow'>from your Rollover. You now have </font> $".$newmoney);

}

 

right i see try that^^ have you got the cron set up in the tabs ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...