if(check_perms('site_edit_wiki')) { ?>
[Edit description]
} ?>
[View history]
if($RevisionID && check_perms('site_edit_wiki')) { ?>
[Revert to this revision]
}
if(($Bookmarks = $Cache->get_value('bookmarks_'.$LoggedUser['ID'])) === FALSE) {
if(($Bookmarks = $Cache->get_value('bookmarks_'.$LoggedUser['ID'].'_groups')) === FALSE) {
$DB->query("SELECT GroupID FROM bookmarks_torrents WHERE UserID = ".$LoggedUser['ID']);
$Bookmarks = $DB->collect('GroupID');
$Cache->cache_value('bookmarks_'.$LoggedUser['ID'].'_groups', $Bookmarks, 0);
}
$Bookmarked = in_array($GroupID,$Bookmarks);
} else {
$Bookmarks = unserialize($Bookmarks);
$Bookmarked = array_key_exists($GroupID, $Bookmarks[0][1]);
}
if($Bookmarked) {
?>
[Remove bookmark]
} else { ?>
[Bookmark]
}
if($Categories[$GroupCategoryID-1] == 'Music') { ?>
[Add format]
}
if(check_perms('site_submit_requests')) { ?>
[Request format]
}?>
Torrents |
Size |
|
|
|
function filelist($Str) {
return "".get_size($Str[1])." | ";
}
$LastRemasterYear = '-';
$LastRemasterTitle = '';
$LastRemasterRecordLabel = '';
$LastRemasterCatalogueNumber = '';
foreach ($TorrentList as $Torrent) {
//t.ID, t.Media, t.Format, t.Encoding, t.Remastered, t.RemasterYear, t.RemasterTitle, t.RemasterRecordLabel,t.RemasterCatalogueNumber,
//t.Scene, t.HasLog, t.HasCue, t.LogScore, t.FileCount, t.Size, t.Seeders, t.Leechers, t.Snatched, t.FreeTorrent, t.Time, t.Description,
//t.FileList, t.FilePath, t.UserID, um.Username, t.last_action
list($TorrentID, $Media, $Format, $Encoding, $Remastered, $RemasterYear, $RemasterTitle, $RemasterRecordLabel, $RemasterCatalogueNumber,
$Scene, $HasLog, $HasCue, $LogScore, $FileCount, $Size, $Seeders, $Leechers, $Snatched, $FreeTorrent, $TorrentTime, $Description,
$FileList, $FilePath, $UserID, $Username, $LastActive, $BadTags, $BadFolders, $BadFiles, $LastReseedRequest, $LogInDB, $HasFile, $ExtendedGrace) = $Torrent;
if($Remastered && !$RemasterYear) {
if(!isset($FirstUnknown)) {
$FirstUnknown = true;
} else {
$FirstUnknown = false;
}
}
$Reported = false;
unset($ReportedTimes);
$Reports = $Cache->get_value('reports_torrent_'.$TorrentID);
if($Reports === false) {
$DB->query("SELECT r.ID,
r.ReporterID,
r.Type,
r.UserComment,
r.ReportedTime
FROM reportsv2 AS r
WHERE TorrentID = $TorrentID
AND Type != 'edited'
AND Status != 'Resolved'");
$Reports = $DB->to_array();
$Cache->cache_value('reports_torrent_'.$TorrentID, $Reports, 0);
}
if(count($Reports) > 0) {
$Reported = true;
include(SERVER_ROOT.'/sections/reportsv2/array.php');
$ReportInfo = "This torrent has ".count($Reports)." active ".(count($Reports) > 1 ?'reports' : 'report').": |
";
foreach($Reports as $Report) {
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;
$Reporter = user_info($ReporterID);
$ReporterName = $Reporter['Username'];
if (array_key_exists($ReportType, $Types[$GroupCategoryID])) {
$ReportType = $Types[$GroupCategoryID][$ReportType];
} else if(array_key_exists($ReportType,$Types['master'])) {
$ReportType = $Types['master'][$ReportType];
} else {
//There was a type but it wasn't an option!
$ReportType = $Types['master']['other'];
}
$ReportInfo .= "".(check_perms('admin_reports') ? "$ReporterName reported it " : "Someone reported it ").strtolower(time_diff($ReportedTime))." for the reason '".$ReportType['title']."':";
$ReportInfo .= "".$Text->full_format($ReportReason)." |
";
}
$ReportInfo .= "
";
}
$CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear)));
$FileList = str_replace(array('_','-'), ' ', $FileList);
$FileList = str_replace('|||','',display_str($FileList));
$FileList = preg_replace_callback('/\{\{\{([^\{]*)\}\}\}/i','filelist',$FileList);
$FileList = 'File Name'.(check_perms('users_mod') ? ' [ Regenerate]' : '').' '.(empty($FilePath) ? '' : '/'.$FilePath.'/' ).' | Size | '.$FileList." | ";
$ExtraInfo=''; // String that contains information on the torrent, eg. format and encoding
$AddExtra=''; // Separator between torrent properties
$TorrentUploader = $Username; // Save this for "Uploaded by:" below
if($Format) { $ExtraInfo.=display_str($Format); $AddExtra=' / '; }
if($Encoding) { $ExtraInfo.=$AddExtra.display_str($Encoding); $AddExtra=' / '; }
if($HasLog) { $ExtraInfo.=$AddExtra.'Log'; $AddExtra=' / '; }
if($HasLog && $LogInDB) { $ExtraInfo.=' ('.(int) $LogScore.'%)'; }
if($HasCue) { $ExtraInfo.=$AddExtra.'Cue'; $AddExtra=' / '; }
if($Media) { $ExtraInfo.=$AddExtra.display_str($Media); $AddExtra=' / '; }
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
if(!$ExtraInfo) {
$ExtraInfo = $GroupName ; $AddExtra=' / ';
}
if($FreeTorrent == '1') { $ExtraInfo.=$AddExtra.'Freeleech!'; $AddExtra=' / '; }
if($FreeTorrent == '2') { $ExtraInfo.=$AddExtra.'Neutral Leech!'; $AddExtra=' / '; }
if($Reported) { $ExtraInfo.=$AddExtra.'Reported'; $AddExtra=' / '; }
if(!empty($BadTags)) { $ExtraInfo.=$AddExtra.'Bad Tags'; $AddExtra=' / '; }
if(!empty($BadFolders)) { $ExtraInfo.=$AddExtra.'Bad Folders'; $AddExtra=' / '; }
if(!empty($BadFiles)) { $ExtraInfo.=$AddExtra.'Bad File Names'; $AddExtra=' / '; }
if (!empty($ExtendedGrace)) { $ExtraInfo.=$AddExtra.'Extended Grace Period'; $AddExtra=' / '; }
if($GroupCategoryID == 1
&& ($RemasterTitle != $LastRemasterTitle
|| $RemasterYear != $LastRemasterYear
|| $RemasterRecordLabel != $LastRemasterRecordLabel
|| $RemasterCatalogueNumber != $LastRemasterCatalogueNumber
|| $FirstUnknown)) {
if($Remastered && $RemasterYear != 0){
$RemasterName = $RemasterYear;
$AddExtra = " - ";
if($RemasterRecordLabel) { $RemasterName .= $AddExtra.display_str($RemasterRecordLabel); $AddExtra=' / '; }
if($RemasterCatalogueNumber) { $RemasterName .= $AddExtra.display_str($RemasterCatalogueNumber); $AddExtra=' / '; }
if($RemasterTitle) { $RemasterName .= $AddExtra.display_str($RemasterTitle); $AddExtra=' / '; }
?>
|
=$RemasterName?> |
} else {
if(!$Remastered) {
$MasterName = "Original Release";
$AddExtra = " / ";
if($GroupRecordLabel) { $MasterName .= $AddExtra.$GroupRecordLabel; $AddExtra=' / '; }
if($GroupCatalogueNumber) { $MasterName .= $AddExtra.$GroupCatalogueNumber; $AddExtra=' / '; }
?>
=$MasterName?> |
} else {
?>
Unknown Release(s) |
}
}
}
$LastRemasterTitle = $RemasterTitle;
$LastRemasterYear = $RemasterYear;
$LastRemasterRecordLabel = $RemasterRecordLabel;
$LastRemasterCatalogueNumber = $RemasterCatalogueNumber;
?>
[
=$HasFile ? 'DL' : 'Missing'?>
| RP
if($CanEdit) { ?>
| ED
} ?>
if(check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
| RM
} ?>
?>
| PL
]
» =$ExtraInfo; ?>
|
=get_size($Size)?> |
=number_format($Snatched)?> |
=number_format($Seeders)?> |
=number_format($Leechers)?> |
Uploaded by =format_username($UserID, $TorrentUploader)?> =time_diff($TorrentTime);?>
if($Seeders == 0){ ?>
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?>
Last active: =time_diff($LastActive);?>
} else { ?>
Last active: =time_diff($LastActive);?>
} ?>
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time()-strtotime($LastReseedRequest)>=864000) { ?>
[Request re-seed]
} ?>
} ?>
?>
if(check_perms('site_moderate_requests')) { ?>
} ?>
=$FileList?>
if($Reported) { ?>
=$ReportInfo?>
} ?>
if(!empty($Description)) {
echo ''.$Text->full_format($Description).' ';}
?>
|
} ?>
$Collages = $Cache->get_value('torrent_collages_'.$GroupID);
if(!is_array($Collages)) {
$DB->query("SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c JOIN collages_torrents AS ct ON ct.CollageID=c.ID WHERE ct.GroupID='$GroupID' AND Deleted='0' AND CategoryID!='0'");
$Collages = $DB->to_array();
$Cache->cache_value('torrent_collages_'.$GroupID, $Collages, 3600*6);
}
if(count($Collages)>0) {
?>
Collage name |
# torrents |
foreach ($Collages as $Collage) {
list($CollageName, $CollageTorrents, $CollageID) = $Collage;
?>
=$CollageName?> |
=$CollageTorrents?> |
} ?>
}
?>
=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info' )?>
if ($WikiBody!="") { echo $WikiBody; } else { echo "There is no information on this torrent."; } ?>
$Results = $Cache->get_value('torrent_comments_'.$GroupID);
if($Results === false) {
$DB->query("SELECT
COUNT(c.ID)
FROM torrents_comments as c
WHERE c.GroupID = '$GroupID'");
list($Results) = $DB->next_record();
$Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0);
}
if(isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $_GET[postid]");
list($PostNum) = $DB->next_record();
list($Page,$Limit) = page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
} else {
list($Page,$Limit) = page_limit(TORRENT_COMMENTS_PER_PAGE,$Results);
}
//Get the cache catalogue
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
$CatalogueLimit=$CatalogueID*THREAD_CATALOGUE . ', ' . THREAD_CATALOGUE;
//---------- Get some data to start processing
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
$Catalogue = $Cache->get_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID);
if($Catalogue === false) {
$DB->query("SELECT
c.ID,
c.AuthorID,
c.AddedTime,
c.Body,
c.EditedUserID,
c.EditedTime,
u.Username
FROM torrents_comments as c
LEFT JOIN users_main AS u ON u.ID=c.EditedUserID
WHERE c.GroupID = '$GroupID'
ORDER BY c.ID
LIMIT $CatalogueLimit");
$Catalogue = $DB->to_array(false,MYSQLI_ASSOC);
$Cache->cache_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID, $Catalogue, 0);
}
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
$Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true);
?>
$Pages=get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
echo $Pages;
?>
//---------- Begin printing
foreach($Thread as $Key => $Post){
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(user_info($AuthorID));
?>
#=$PostID?>
=format_username($AuthorID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $PermissionID)?> =time_diff($AddedTime)?> [Report]
- [Quote]
- [Edit] }
if (check_perms('site_moderate_forums')){ ?> - [Delete] } ?>
↑
|
if(empty($HeavyInfo['DisableAvatars'])) { ?>
if ($Avatar) { ?>
} else { ?>
}
?>
|
}
?>
=$Text->full_format($Body)?>
if($EditedUserID){ ?>
if(check_perms('site_moderate_forums')) { ?>
«
} ?>
Last edited by
=format_username($EditedUserID, $EditedUsername) ?> =strtolower(time_diff($EditedTime))?>
} ?>
|
} ?>
=$Pages?>
if(!$LoggedUser['DisablePosting']) { ?>
Post reply
#XXXXXX
by =format_username($LoggedUser['ID'], $LoggedUser['Username'], $LoggedUser['Donor'], $LoggedUser['Warned'], $LoggedUser['Enabled'] == 2 ? false : true, $LoggedUser['PermissionID'])?>
Just now
[Report Comment]
↑
|
if (!empty($LoggedUser['Avatar'])) { ?>
} else { ?>
} ?>
|
|
} ?>