Thread: Help
View Single Post
  #2  
Old 6th May 2009, 09:49
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
 
Join Date: May 2008
United Kingdom
Posts: 244
Lightbulb Bonus
Not easy depends on your code for seedbonus -You need to pull seedtime and that will require left joins on the select query so you combine users and snatched in one query otherwise it could get heavy , left join has the drawback of that it can create slow querys should be fine here though :) Then you need a variable like

Code:
$sdtime = 2*86400;
$dt = sqlesc(get_date_time(gmtime() - $sdtime));
Then you would use something like

Code:
$res = sql_query("SELECT seedtime FROM snatched WHERE $torrentid=torrentid AND $userid=userid");
while ($arr = mysql_fetch_assoc($res))
{
sql_query("UPDATE users SET seedbonus = seedbonus WHERE sn.seedtime > $dt ") or sqlerr(__FILE__, __LINE__);

Thats some food for thought and will require some thinking to pull it off - Remember i just posted example code that will never work, its to help you think - Good luck :)

Last edited by Bigjoos; 6th May 2009 at 09:53. Reason: typo
Reply With Quote