function writemsg($timestr, $msgstr, $cssclass = '') { echo '<div class="msg ' . $cssclass . '">' . '<p class="time">' . $timestr . '</p>' . '<p class="msg">' . $msgstr . '</p>' . '<div class="breaker"></div>' . '</div>' . '<script type="text/javascript" charset="utf-8">setTimeout(\'window.scrollBy(0,999999);\',50)</script>'; gb_flush(); }
$referrer = gb::referrer_url(); # comment not found if (!$removed_comment) { if ($referrer) { $referrer['gb-error'] = 'Comment ' . $input['comment'] . ' not found'; header('HTTP/1.1 303 See Other'); header('Location: ' . $referrer); } else { header('HTTP/1.1 404 Not Found'); } exit('no such comment ' . $input['comment']); } gb::log(LOG_NOTICE, 'removed comment %s by %s from post %s', $input['comment'], $removed_comment->name, $post->cachename()); gb::event('did-remove-comment', $removed_comment); # done OK if ($referrer) { $referrer->fragment = 'comments'; header('HTTP/1.1 303 See Other'); header('Location: ' . $referrer); } else { exit2("removed comment: {$removed_comment->id}\n", '200 OK'); } } catch (Exception $e) { gb::log(LOG_ERR, 'failed to remove comment %s from %s', $input['comment'], $post->cachename()); header('HTTP/1.1 500 Internal Server Error'); echo '$input => '; var_export($input); echo "\n"; gb_flush(); throw $e; }
function gb_log_html($priority, $msg) { echo '<p class="logmsg ' . ($priority === LOG_WARNING ? 'warning' : ($priority < LOG_WARNING ? 'error' : '')) . '">' . h($msg) . '</p>'; gb_flush(); }