Empty commit

This commit is contained in:
Git 2012-06-08 08:00:23 +00:00
parent a8a01cfb07
commit f28034f335
3 changed files with 28 additions and 9 deletions

View File

@ -14,12 +14,13 @@
TopicID,
ForumID,
CEIL(COUNT(p.ID)/".POSTS_PER_PAGE.") AS Pages,
CEIL(SUM(IF(p.ID<='$PostID',1,0))/".POSTS_PER_PAGE.") AS Page
CEIL(SUM(IF(p.ID<='$PostID',1,0))/".POSTS_PER_PAGE.") AS Page,
StickyPostID
FROM forums_posts AS p
JOIN forums_topics AS t ON t.ID=p.TopicID
WHERE p.TopicID=(SELECT TopicID FROM forums_posts WHERE ID='$PostID')
GROUP BY t.ID");
list($TopicID, $ForumID, $Pages, $Page) = $DB->next_record();
list($TopicID, $ForumID, $Pages, $Page, $StickyPostID) = $DB->next_record();
// $Pages = number of pages in the thread
// $Page = which page the post is on
@ -66,6 +67,10 @@
$UpdateArrayThread = array('Posts' => '-1');
}
if($StickyPostID == $PostID) {
$DB->query("UPDATE forums_topics SET StickyPostID = 0 WHERE ID = $TopicID");
}
//We need to clear all subsequential catalogues as they've all been bumped with the absence of this post
$ThisCatalogue = floor((POSTS_PER_PAGE*$Page-POSTS_PER_PAGE)/THREAD_CATALOGUE);
$LastCatalogue = floor((POSTS_PER_PAGE*$Pages-POSTS_PER_PAGE)/THREAD_CATALOGUE);

View File

@ -13,11 +13,26 @@
error(404);
}
if($Delete) {
$DB->query("UPDATE forums_topics SET StickyPostID = 0 WHERE ID = ".$ThreadID);
} else {
$DB->query("UPDATE forums_topics SET StickyPostID = ".$PostID." WHERE ID = ".$ThreadID);
$DB->query("SELECT
CEIL(COUNT(ID)/".POSTS_PER_PAGE.") AS Pages,
CEIL(SUM(IF(ID<=$PostID,1,0))/".POSTS_PER_PAGE.") AS Page
FROM forums_posts
WHERE TopicID=$ThreadID
GROUP BY TopicID");
if($DB->record_count()) {
list($Pages,$Page) = $DB->next_record();
if($Delete) {
$DB->query("UPDATE forums_topics SET StickyPostID = 0 WHERE ID = ".$ThreadID);
} else {
$DB->query("UPDATE forums_topics SET StickyPostID = ".$PostID." WHERE ID = ".$ThreadID);
}
$Cache->delete_value('thread_'.$ThreadID.'_info');
$ThisCatalogue = floor((POSTS_PER_PAGE*$Page-POSTS_PER_PAGE)/THREAD_CATALOGUE);
$LastCatalogue = floor((POSTS_PER_PAGE*$Pages-POSTS_PER_PAGE)/THREAD_CATALOGUE);
for($i=$ThisCatalogue;$i<=$LastCatalogue;$i++) {
$Cache->delete('thread_'.$ThreadID.'_catalogue_'.$i);
}
}
$Cache->delete_value('thread_'.$ThreadID.'_info');
header('Location: forums.php?action=viewthread&threadid='.$ThreadID);

View File

@ -571,9 +571,8 @@ function filelist($Str) {
<? if(check_perms('site_view_torrent_snatchlist')) { ?>
<a href="#" onclick="show_downloads('<?=$TorrentID?>', 0);return false;">(View Downloadlist)</a>
<a href="#" onclick="show_snatches('<?=$TorrentID?>', 0);return false;">(View Snatchlist)</a>
<a href="#" id="checkprivate-<?=$TorrentID?>" onclick="check_private('<?=$TorrentID?>'); return false;">(Check Private Flag)</a>
<? } ?>
<a href="#" onclick="show_files('<?=$TorrentID?>');return false;">(View Filelist)</a>
<a href="#" onclick="show_files('<?=$TorrentID?>');return false;">(View Filelist)</a>
<? if($Reported) { ?>
<a href="#" onclick="show_reported('<?=$TorrentID?>');return false;">(View Report Information)</a>
<? } ?>