HITMAN 17 Posted February 13, 2008 Posted February 13, 2008 this auction cron is not working y? ?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; $db->query("update auctions set time=time-1",$c); $qqq=$db->query("select * from auctions where time=0",$c); while($win=mysql_fetch_array($qqq)) { $time=$win['time']; $item=$win['itemname']; $winner=$win['bidder']; $owner=$win['owner']; $iname=mysql_result($db->query("SELECT itmname FROM items WHERE itmid={$item}", $c), 0, 0); if($win['bids']>0) { $db->query("insert into inventory VALUES('',$item,$winner,1)",$c) or die(mysql_error()); event_add($winner,"You won the auction of the {$iname} for \${$win['current']}",$c); event_add($owner, "Your {$iname} sold succesfully on the auction market with {$win['bids']} bids. You have been paid \${$win['current']}", $c); $db->query("update users set money=money+{$win['current']},auctionquota=auctionquota-1 where userid=$owner", $c); } if($win['bids']==0) { event_add($win['owner'],"Your auction has ended with no bidders. Your {$iname} has been returned to your inventory.",$c); $winner=$win['owner']; $db->query("insert into inventory VALUES('',$item,$winner,1)",$c) or die(mysql_error()); } } $db->query("delete from auctions where time=0", $c); ?> Quote
~Spooky~ Posted February 14, 2008 Posted February 14, 2008 Re: can anyone fix this <?php include "../config.php"; if($_GET['code'] != $_CONFIG['code']) { die(""); } require "../mysql.php"; mysql_query("UPDATE auctions SET time=time-1 WHERE time>0",$c); $qqq=mysql_query("SELECT * FROM auctions WHERE time=0",$c); while($win=mysql_fetch_array($qqq)) { $time=$win['time']; $item=$win['itemname']; $winner=$win['bidder']; $owner=$win['owner']; $iname=mysql_result(mysql_query("SELECT itmname FROM items WHERE itmid={$item}", $c), 0, 0); if($win['bids']>0) { mysql_query("insert into inventory VALUES('',$item,$winner,1)",$c) or die(mysql_error()); mysql_query("INSERT INTO events VALUES('',$winner,UNIX_TIMESTAMP(),0,'You won the auction of the {$iname} for \${$win['current']}')",$c) or die(mysql_error()); mysql_query("INSERT INTO events VALUES('',$owner,UNIX_TIMESTAMP(),0,'Your {$iname} sold succesfully on the auction market with {$win['bids']} bids. You have been paid \${$win['current']}')",$c) or die(mysql_error()); mysql_query("UPDATE users SET new_events=new_events+1 WHERE owner={$userid}", $c); mysql_query("UPDATE users SET new_events=new_events+1 WHERE winner={$userid}", $c); mysql_query("update users set money=money+{$win['current']},auctionquota=auctionquota-1 where userid=$owner", $c); } if($win['bids']==0) { $owner=$win['owner']; mysql_query("INSERT INTO events VALUES('',$owner,UNIX_TIMESTAMP(),0,'Your auction has ended with no bidders. Your {$iname} has been returned to your inventory.')",$c) or die(mysql_error()); $winner=$win['owner']; mysql_query("insert into inventory VALUES('',$item,$winner,1)",$c) or die(mysql_error()); } } mysql_query("DELETE FROM auctions WHERE time=0", $c); print "Done!"; ?> Try that one.................. Quote
~Spooky~ Posted February 14, 2008 Posted February 14, 2008 Re: can anyone fix this if it errors take out the ../ part........... Quote
HITMAN 17 Posted February 14, 2008 Author Posted February 14, 2008 Re: can anyone fix this still dont work is the cron right ***** curl http://tbrpg.890m.com/auctoncron.php?co ... 65fe77b1b4 Quote
Godhand Posted February 15, 2008 Posted February 15, 2008 Re: can anyone fix this so if someone wants to launch his crons just go to http://tbrpg.890m.com/auctoncron.php?code=2c72366341cc8e9c36fc7565fe77b1b4 as for how I got that.... he posted his cron code... haha you should take some precautions to make sure no one is running your cron files 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.