Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
Thread Tools
  #1  
Old 5th May 2009, 23:45
luke luke is offline
Member
 
Join Date: Aug 2008
Posts: 8
Default Help
anyone got any idea how to make seedbonus trigger after 2 days of seeding a torrent?
Reply With Quote
  #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
  #3  
Old 6th May 2009, 12:07
luke luke is offline
Member
 
Join Date: Aug 2008
Posts: 8
Default
Thanks, atleast it gives me a idea becuase i aint sure how triggers work!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 02:04. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.