mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-06 07:13:05 -04:00
27 lines
694 B
PHP
27 lines
694 B
PHP
<?php
|
|
|
|
if ($Viewer->disablePosting()) {
|
|
error('Your posting privileges have been removed.');
|
|
}
|
|
authorize();
|
|
|
|
$page = $_REQUEST['page'] ?? null;
|
|
if (!in_array($page, ['artist', 'collages', 'requests', 'torrents'])) {
|
|
error(403);
|
|
}
|
|
|
|
$pageId = (int)($_REQUEST['pageid'] ?? 0);
|
|
if (!$pageId) {
|
|
error(404);
|
|
}
|
|
|
|
$commentMan = new Gazelle\Manager\Comment;
|
|
$comment = $commentMan->create($Viewer->id(), $page, $pageId, $_POST['quickpost']);
|
|
|
|
$subscription = new \Gazelle\User\Subscription($Viewer);
|
|
if (isset($_POST['subscribe']) && !$subscription->isSubscribedComments($page, $pageId)) {
|
|
$subscription->subscribeComments($page, $pageId);
|
|
}
|
|
|
|
header('Location: ' . $comment->location());
|