Gazelle/sections/collages/add_comment.php

21 lines
628 B
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
authorize();
2012-04-11 08:00:22 +00:00
if(empty($_POST['collageid']) || !is_number($_POST['collageid']) || $_POST['body']==='' || !isset($_POST['body'])) { error(0); }
2011-03-28 14:21:28 +00:00
$CollageID = $_POST['collageid'];
if($LoggedUser['DisablePosting']) {
error('Your posting rights have been removed'); // Should this be logged?
}
$DB->query("INSERT INTO collages_comments
(CollageID, Body, UserID, Time)
VALUES
('$CollageID', '".db_string($_POST['body'])."', '$LoggedUser[ID]', '".sqltime()."')");
$Cache->delete_value('collage_'.$CollageID.'_catalogue_0');
$Cache->delete_value('collage_'.$CollageID);
header('Location: collages.php?id='.$CollageID);
?>