Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Help (http://www.bvlist.com/showthread.php?t=2568)

luke 5th May 2009 23:45

Help
 
anyone got any idea how to make seedbonus trigger after 2 days of seeding a torrent?

Bigjoos 6th May 2009 09:49

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 :)

luke 6th May 2009 12:07

Thanks, atleast it gives me a idea becuase i aint sure how triggers work!


All times are GMT +2. The time now is 15:16.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.