2011-03-28 14:21:28 +00:00
< ?
$GroupID = $_GET [ 'groupid' ];
$TorrentID = $_GET [ 'torrentid' ];
2013-04-19 08:00:55 +00:00
if ( ! is_number ( $GroupID ) || ! is_number ( $TorrentID )) {
error ( 0 );
}
2011-03-28 14:21:28 +00:00
2012-04-23 08:00:43 +00:00
$DB -> query ( " SELECT last_action, LastReseedRequest, UserID, Time FROM torrents WHERE ID=' $TorrentID ' " );
list ( $LastActive , $LastReseedRequest , $UploaderID , $UploadedTime ) = $DB -> next_record ();
2011-03-28 14:21:28 +00:00
2013-04-19 08:00:55 +00:00
if ( time () - strtotime ( $LastReseedRequest ) < 864000 ) {
error ( 'There was already a re-seed request for this torrent within the past 10 days.' );
}
if ( $LastActive == '0000-00-00 00:00:00' || time () - strtotime ( $LastActive ) < 345678 ) {
error ( 403 );
}
2011-03-28 14:21:28 +00:00
$DB -> query ( " UPDATE torrents SET LastReseedRequest=NOW() WHERE ID=' $TorrentID ' " );
2012-10-11 08:00:15 +00:00
$Group = Torrents :: get_groups ( array ( $GroupID ));
2011-03-28 14:21:28 +00:00
$Group = array_pop ( $Group [ 'matches' ]);
2013-02-25 21:16:55 +00:00
extract ( Torrents :: array_group ( $Group ));
2011-03-28 14:21:28 +00:00
$Name = '' ;
2013-02-25 21:16:55 +00:00
$Name .= Artists :: display_artists ( array ( '1' => $Artists ), false , true );
2011-03-28 14:21:28 +00:00
$Name .= $GroupName ;
$DB -> query ( " SELECT uid, tstamp FROM xbt_snatched WHERE fid=' $TorrentID ' ORDER BY tstamp DESC LIMIT 10 " );
2013-05-01 08:00:16 +00:00
if ( $DB -> record_count () > 0 ) {
2011-03-28 14:21:28 +00:00
$Users = $DB -> to_array ();
2013-05-01 08:00:16 +00:00
foreach ( $Users as $User ) {
2011-03-28 14:21:28 +00:00
$UserID = $User [ 'uid' ];
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT UserID FROM top_snatchers WHERE UserID=' $UserID ' " );
2013-04-19 08:00:55 +00:00
if ( $DB -> record_count () > 0 ) {
continue ;
}
2013-02-22 08:00:24 +00:00
2012-10-11 08:00:15 +00:00
$UserInfo = Users :: user_info ( $UserID );
2011-03-28 14:21:28 +00:00
$Username = $UserInfo [ 'Username' ];
$TimeStamp = $User [ 'tstamp' ];
$Request = " Hi $Username ,
2013-04-19 08:00:55 +00:00
The user [ url = https :// " .SSL_SITE_URL. " / user . php ? id = $LoggedUser [ ID ]] $LoggedUser [ Username ][ / url ] has requested a re - seed for the torrent [ url = https :// " .SSL_SITE_URL. " / torrents . php ? id = $GroupID & torrentid = $TorrentID ] " . $Name . " [ / url ], which you snatched on " .date('M d Y', $TimeStamp ). " . The torrent is now un - seeded , and we need your help to resurrect it !
2011-03-28 14:21:28 +00:00
The exact process for re - seeding a torrent is slightly different for each client , but the concept is the same . The idea is to download the . torrent file and open it in your client , and point your client to the location where the data files are , then initiate a hash check .
Thanks ! " ;
2013-02-22 08:00:24 +00:00
2013-03-10 08:00:41 +00:00
Misc :: send_pm ( $UserID , 0 , 'Re-seed request for torrent ' . $Name , $Request );
2011-03-28 14:21:28 +00:00
}
$NumUsers = count ( $Users );
} else {
2012-10-11 08:00:15 +00:00
$UserInfo = Users :: user_info ( $UploaderID );
2011-03-28 14:21:28 +00:00
$Username = $UserInfo [ 'Username' ];
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
$Request = " Hi $Username ,
2013-04-19 08:00:55 +00:00
The user [ url = https :// " .SSL_SITE_URL. " / user . php ? id = $LoggedUser [ ID ]] $LoggedUser [ Username ][ / url ] has requested a re - seed for the torrent [ url = https :// " .SSL_SITE_URL. " / torrents . php ? id = $GroupID & torrentid = $TorrentID ] " . $Name . " [ / url ], which you uploaded on " .date('M d Y', strtotime( $UploadedTime )). " . The torrent is now un - seeded , and we need your help to resurrect it !
2011-03-28 14:21:28 +00:00
The exact process for re - seeding a torrent is slightly different for each client , but the concept is the same . The idea is to download the . torrent file and open it in your client , and point your client to the location where the data files are , then initiate a hash check .
Thanks ! " ;
2013-03-10 08:00:41 +00:00
Misc :: send_pm ( $UploaderID , 0 , 'Re-seed request for torrent ' . $Name , $Request );
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
$NumUsers = 1 ;
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
}
2012-10-11 08:00:15 +00:00
View :: show_header ();
2011-03-28 14:21:28 +00:00
?>
< div class = " thin " >
2012-08-19 08:00:19 +00:00
< div class = " header " >
< h2 > Successfully sent re - seed request </ h2 >
</ div >
2011-03-28 14:21:28 +00:00
< p > Successfully sent re - seed request for torrent < a href = " torrents.php?id=<?= $GroupID ?>&torrentid=<?= $TorrentID ?> " >< ? = display_str ( $Name ) ?> </a> to <?=$NumUsers?> user(s).</p>
</ div >
2012-10-11 08:00:15 +00:00
< ? View :: show_footer (); ?>
2011-03-28 14:21:28 +00:00