4 print '<h3>Reacties</h3>'."\n";
5 $pagelink = $Page.$Args;
10 $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.html';
11 $html = nl2br(htmlspecialchars($_POST['reply']));
12 $written = file_put_contents($target, $html);
13 if ($written === FALSE) {
14 throw new Exception('Fout bij opslaan');
16 $_POST['reply'] = NULL;
18 catch (Exception $e) {
19 print '<p class=warn>Antwoord niet opgeslagen.</p>'."\n\n";
23 print '<ul class="replies">';
25 foreach (glob("$pagelink/*.html") as $reply) {
26 preg_match('</(\d{2,14}) : ([^:]*) [^/]* \.html$>x', $reply, $replymeta);
27 if (!$replymeta) continue;
28 $replydate = str_split($replymeta[1], 2);
29 $replydate[1] = $replydate[0] . $replydate[1];
31 printf('<strong>%s</strong> <small class=date>%s</small>',
32 $replymeta[2], showdate($replydate)
34 printf("<p>%s</p>\n", file_get_contents($reply));
39 print '<form method="post" action="">';
40 printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
42 "Bericht van {$User['name']}",
45 print '<input type="submit" value="Plaatsen" />'."\n";
46 print "</form></li>\n";