SQL
ALTER TABLE `users` ADD `hourlyReward` INT( 3 ) NOT NULL DEFAULT '0';
hourly.php
<?php
require_once('./Global/globals.php');
global $h,$ir;
//original mod by mark mascola August 13, 2011
if ( !defined($_CONFIG['define_code']) ) {
echo 'This file cannot be accessed directly.';
exit;
}
echo "<h2>Welcome to Hourly Rewards</h3>";
echo "<p>Once an hour you may come here to collect a reward</p>";
if($_POST['valid']=='yes' && isset($_POST['bet'] )){
if($ir['hourlyReward'] > 0){
echo "You cannot refresh this page.";
$h->endpage();
exit;
}
else{
$hourlyMoney = $ir['level']*rand(200,300);
$hourlyPoints = rand(10,25);
echo "You have earned $".$hourlyMoney." ,".$hourlyPoints." Points for playing this hour";
$db->query("UPDATE users SET main = main +{$hourlyMoney},second = second+{$hourlyPoints},hourlyReward = 60 WHERE userid={$ir['userid']}");
$_POST['valid']='no';
$h->endpage();
exit;
}
}
else{
if($ir['hourlyReward']==0){
echo "<p><form method='post'><input type='hidden' name='valid' value='yes' /><input type='submit' name='bet' value='Claim Your Reward' /></form></p>";
}
else{
$wait= $ir['hourlyReward'];
echo"You must wait <font color=red>".$wait."</font> minutes before you can claim your next reward.";
}
}
?>
add this to the bottom of cron_minute.php
$db->query("UPDATE users SET hourlyReward = hourlyReward - 1 WHERE hourlyReward > 0");
don't forget to link it up somewhere on your explore page and index it in the index.php that is located on the root of your site