X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/7983570288ed2798470a552ec04f64aa646b664a..95fdba3568a0978b9401376cdca9cdd711abdb1a:/issue/index.php diff --git a/issue/index.php b/issue/index.php index 181d5b7..704a405 100644 --- a/issue/index.php +++ b/issue/index.php @@ -1,11 +1,11 @@ path, '/')); if ($id and ctype_digit($id)) { $Page->title = "Issue #$id"; - $Page->path = "/$id"; # minimal reference + $Page->link = $Page->handler . ($Page->path = "/$id"); # minimal reference $Issue = $Db->query( 'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page->handler, $id] )->fetch(); @@ -15,6 +15,7 @@ if ($id and ctype_digit($id)) { $Page->title .= ': '.htmlspecialchars($Issue->subject); $Page->teaser = $Issue->body; + if ($Page->api) return; $Page->body = $replies; # find image print "

{$Page->title}

\n"; @@ -41,8 +42,12 @@ if ($id and ctype_digit($id)) { return; } -if ($_POST) { +if ($Page->api) return; +if ($_POST and isset($_POST['subject'])) { require_once 'upload.inc.php'; + if (strlen($_POST['subject']) < 2) { + throw new Exception('Een minimaal onderwerp is verplicht om een issue aan te maken.'); + } $query = $Db->set('issues', [ 'page' => $Page->handler, 'subject' => $_POST['subject'], @@ -97,4 +102,4 @@ while ($row = $query->fetch()) { print "\n"; } print "\n"; -$Place['issuelist'] = ob_get_clean(); +$Page->place['issuelist'] = ob_get_clean();