$Results = $Cache->get_value('request_comments_'.$RequestID);
if($Results === false) {
$DB->query("SELECT
COUNT(c.ID)
FROM requests_comments as c
WHERE c.RequestID = '$RequestID'");
list($Results) = $DB->next_record();
$Cache->cache_value('request_comments_'.$RequestID, $Results, 0);
}
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('request_comments_'.$RequestID.'_catalogue_'.$CatalogueID);
if($Catalogue === false) {
$DB->query("SELECT
c.ID,
c.AuthorID,
c.AddedTime,
c.Body,
c.EditedUserID,
c.EditedTime,
u.Username
FROM requests_comments as c
LEFT JOIN users_main AS u ON u.ID=c.EditedUserID
WHERE c.RequestID = '$RequestID'
ORDER BY c.ID
LIMIT $CatalogueLimit");
$Catalogue = $DB->to_array(false,MYSQLI_ASSOC);
$Cache->cache_value('request_comments_'.$RequestID.'_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?>
by =format_username($AuthorID, $Username, $Donor, $Warned, $Enabled, $PermissionID)?> =time_diff($AddedTime)?> [Report Comment]
- [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 comment
#XXXXXX
by =format_username($LoggedUser['ID'], $LoggedUser['Username'], $LoggedUser['Donor'], $LoggedUser['Warned'], $LoggedUser['Enabled'] == 2 ? false : true, $LoggedUser['PermissionID'])?> if (!empty($LoggedUser['Title'])) { echo '('.$LoggedUser['Title'].')'; }?>
Just now
[Report Comment]
↑
|
if (!empty($LoggedUser['Avatar'])) { ?>
} else { ?>
} ?>
|
|
} ?>