Gazelle/sections/collages/all_comments.php

68 lines
2.0 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/**********|| Page to show individual threads || ********************************\
Things to expect in $_GET:
ThreadID: ID of the forum curently being browsed
2013-02-22 08:00:24 +00:00
page: The page the user's on.
2011-03-28 14:21:28 +00:00
page = 1 is the same as no page
********************************************************************************/
//---------- Things to sort out before it can start printing/generating content
// Check for lame SQL injection attempts
2013-08-28 23:08:41 +00:00
if (!is_number($_GET['collageid'])) {
2011-03-28 14:21:28 +00:00
error(0);
}
2013-08-28 23:08:41 +00:00
$CollageID = (int)$_GET['collageid'];
2011-03-28 14:21:28 +00:00
2013-08-28 23:08:41 +00:00
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('collages', $CollageID);
2011-03-28 14:21:28 +00:00
2013-07-13 08:00:46 +00:00
$DB->query("
SELECT Name
FROM collages
WHERE ID = '$CollageID'");
2011-03-28 14:21:28 +00:00
list($Name) = $DB->next_record();
// Start printing
2013-08-28 23:08:41 +00:00
View::show_header("Comments for collage $Name", 'comments,bbcode,subscriptions');
2011-03-28 14:21:28 +00:00
?>
<div class="thin">
2012-08-19 08:00:19 +00:00
<div class="header">
<h2>
<a href="collages.php">Collages</a> &gt;
<a href="collages.php?id=<?=$CollageID?>"><?=$Name?></a>
</h2>
<div class="linkbox">
2013-10-19 08:01:09 +00:00
<a href="#" id="subscribelink_collages<?=$CollageID?>" class="brackets" onclick="SubscribeComments('collages', <?=$CollageID?>); return false;"><?=Subscriptions::has_subscribed_comments('collages', $CollageID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
2011-03-28 14:21:28 +00:00
<?
2013-05-13 08:00:33 +00:00
$Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9);
2013-08-28 23:08:41 +00:00
if ($Pages) {
echo '<br /><br />' . $Pages;
}
2011-03-28 14:21:28 +00:00
?>
2012-08-19 08:00:19 +00:00
</div>
2011-03-28 14:21:28 +00:00
</div>
<?
//---------- Begin printing
2013-10-19 08:01:09 +00:00
CommentsView::render_comments($Thread, $LastRead, "collages.php?action=comments&amp;collageid=$CollageID");
2013-05-04 08:00:48 +00:00
if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
if ($ThreadInfo['MinClassWrite'] <= $LoggedUser['Class'] && !$LoggedUser['DisablePosting']) {
2013-08-28 23:08:41 +00:00
View::parse('generic/reply/quickreply.php', array(
'InputName' => 'pageid',
2013-01-23 08:00:38 +00:00
'InputID' => $CollageID,
2013-08-28 23:08:41 +00:00
'Action' => 'comments.php?page=collages',
'InputAction' => 'take_post',
'TextareaCols' => 90,
'SubscribeBox' => true
));
2011-03-28 14:21:28 +00:00
}
}
?>
<div class="linkbox">
<?=$Pages?>
</div>
</div>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>