2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
authorize();
|
|
|
|
|
2013-05-05 08:00:31 +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'];
|
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
if ($LoggedUser['DisablePosting']) {
|
|
|
|
error('Your posting privileges have been removed'); // Should this be logged?
|
2011-03-28 14:21:28 +00:00
|
|
|
}
|
2013-02-22 08:00:24 +00:00
|
|
|
|
2013-05-13 08:00:33 +00:00
|
|
|
$DB->query("
|
|
|
|
SELECT
|
|
|
|
CEIL((
|
|
|
|
SELECT COUNT(ID)+1
|
|
|
|
FROM collages_comments
|
|
|
|
WHERE CollageID='".db_string($CollageID)."')/".TORRENT_COMMENTS_PER_PAGE."
|
|
|
|
) AS Pages");
|
|
|
|
list($Pages) = $DB->next_record();
|
|
|
|
|
2011-03-28 14:21:28 +00:00
|
|
|
$DB->query("INSERT INTO collages_comments
|
2013-02-22 08:00:24 +00:00
|
|
|
(CollageID, Body, UserID, Time)
|
2011-03-28 14:21:28 +00:00
|
|
|
VALUES
|
|
|
|
('$CollageID', '".db_string($_POST['body'])."', '$LoggedUser[ID]', '".sqltime()."')");
|
|
|
|
|
2013-05-13 08:00:33 +00:00
|
|
|
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Pages - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
|
|
|
|
|
2011-03-28 14:21:28 +00:00
|
|
|
$Cache->delete_value('collage_'.$CollageID);
|
2013-05-13 08:00:33 +00:00
|
|
|
$Cache->delete_value('collage_comments_'.$CollageID.'_catalogue_'.$CatalogueID);
|
|
|
|
$Cache->increment('collage_comments_'.$CollageID);
|
2011-03-28 14:21:28 +00:00
|
|
|
header('Location: collages.php?id='.$CollageID);
|
|
|
|
|
|
|
|
?>
|