/**********|| Page to show individual threads || ********************************\ Things to expect in $_GET: ThreadID: ID of the forum curently being browsed page: The page the user's on. page = 1 is the same as no page ********************************************************************************/ //---------- Things to sort out before it can start printing/generating content include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class $Text = new TEXT; // Check for lame SQL injection attempts $CollageID = $_GET['collageid']; if(!is_number($CollageID)) { error(0); } list($Page,$Limit) = page_limit(POSTS_PER_PAGE); //Get the cache catalogue $CatalogueID = floor((POSTS_PER_PAGE*$Page-POSTS_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 if(!list($Catalogue,$Posts) = $Cache->get_value('collage_'.$CollageID.'_catalogue_'.$CatalogueID)) { $DB->query("SELECT SQL_CALC_FOUND_ROWS ID, UserID, Time, Body FROM collages_comments WHERE CollageID = '$CollageID' LIMIT $CatalogueLimit"); $Catalogue = $DB->to_array(); $DB->query("SELECT FOUND_ROWS()"); list($Posts) = $DB->next_record(); $Cache->cache_value('collage_'.$CollageID.'_catalogue_'.$CatalogueID, array($Catalogue,$Posts), 0); } //This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue $Thread = array_slice($Catalogue,((POSTS_PER_PAGE*$Page-POSTS_PER_PAGE)%THREAD_CATALOGUE),POSTS_PER_PAGE,true); $DB->query("SELECT Name FROM collages WHERE ID='$CollageID'"); list($Name) = $DB->next_record(); // Start printing show_header('Comments for collage '.$Name, 'comments,bbcode'); ?>
#=$PostID?> by =format_username($AuthorID, $Username, $Donor, $Warned, $Enabled, $PermissionID)?> if ($UserTitle) { echo '('.$UserTitle.')'; }?> =time_diff($AddedTime)?> [Report Comment] if (!$ThreadInfo['IsLocked']){ ?> - [Quote] } if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')){ ?> - [Edit] } if (check_perms('site_moderate_forums')){ ?> - [Delete] } ?> ↑ | |
if ($Avatar) { ?> } else { ?> } ?> | } ?>
=$Text->full_format($Body)?>
|