Thread: TTL
View Single Post
  #3  
Old 21st February 2009, 15:29
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
TimeToLive <-- i add this word so next time the search will find this topic

cleanup.php

delete



PHP Code:
// delete old torrents
    
$days 28;
    
$dt sqlesc(get_date_time(gmtime() - ($days 86400)));
    
$res mysql_query("SELECT id, name FROM torrents WHERE added < $dt");
    while (
$arr mysql_fetch_assoc($res))
    {
        @
unlink("$torrent_dir/$arr[id].torrent");
        
mysql_query("DELETE FROM torrents WHERE id=$arr[id]");
        
mysql_query("DELETE FROM peers WHERE torrent=$arr[id]");
        
mysql_query("DELETE FROM comments WHERE torrent=$arr[id]");
        
mysql_query("DELETE FROM files WHERE torrent=$arr[id]");
        
write_log("Torrent $arr[id] ($arr[name]) was deleted by system (older than $days days)");
    } 

bittorrent.php

delete



PHP Code:
<td class="colhead" align="center">TTL</td

and delete

PHP Code:
        $ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($row["added"])) / 3600);
        if (
$ttl == 1$ttl .= "<br>hour"; else $ttl .= "<br>hours";
        print(
"<td align=center>$ttl</td>\n"); 

userdetails.php

delete



PHP Code:
<td class=colhead align=center>TTL</td

and delete



PHP Code:
$ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
    if (
$ttl == 1$ttl .= "<br>hour"; else $ttl .= "<br>hours"

and delete



PHP Code:
<td align=center>$ttl</td
Reply With Quote
The Following User Says Thank You to wMan For This Useful Post:
inebunit (8th January 2010)