mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
24 lines
596 B
PHP
24 lines
596 B
PHP
<?
|
|
enforce_login();
|
|
authorize();
|
|
if(!check_perms('site_moderate_forums')) {
|
|
error(403);
|
|
}
|
|
|
|
$ThreadID = $_GET['threadid'];
|
|
$PostID = $_GET['postid'];
|
|
$Delete = !empty($_GET['remove']);
|
|
|
|
if(!$ThreadID || !$PostID || !is_number($ThreadID) || !is_number($PostID)) {
|
|
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);
|
|
}
|
|
$Cache->delete_value('thread_'.$ThreadID.'_info');
|
|
|
|
header('Location: forums.php?action=viewthread&threadid='.$ThreadID);
|