Gazelle/sections/collages/delete_comment.php

26 lines
678 B
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
authorize();
// Quick SQL injection check
if(!$_GET['postid'] || !is_number($_GET['postid'])) {
error(0);
}
$PostID = $_GET['postid'];
// Make sure they are moderators
if(!check_perms('site_moderate_forums')) {
error(403);
}
$DB->query("SELECT CollageID FROM collages_comments WHERE ID='$PostID'");
list($CollageID) = $DB->next_record();
$DB->query("DELETE FROM collages_comments WHERE ID='$PostID'");
$Cache->delete_value('collage_'.$CollageID);
$Cache->delete('collage_'.$CollageID.'_catalogue_0'); //Because these never exceed 500 posts, and I'm really tired right now.
?>