if (stripos($topic_headline, $ignored_phrase) !== false || stripos($topic_body, $ignored_phrase) !== false) { // We've encountered an ignored phrase, so skip the rest of this while() iteration. $table->num_rows_fetched++; continue 2; } } } // Decide what to use for the last seen marker and the age/last bump column. if ($topics_mode) { $order_time = $topic_time; } else { $order_time = $topic_last_post; } // Process the values for this row of our table. $values = array('<a href="/topic/' . $topic_id . '">' . htmlspecialchars($topic_headline) . '</a>', snippet($topic_body), replies($topic_id, $topic_replies), format_number($topic_visits), '<span class="help" title="' . format_date($order_time) . '">' . calculate_age($order_time) . '</span>'); if ($_COOKIE['spoiler_mode'] != 1) { array_splice($values, 1, 1); } $table->LastSeenMarker($last_seen, $order_time); $table->Row($values); } } $num_rows_fetched = $table->num_rows_fetched; echo $table->Output('topics'); // Navigate backward or forward ... $navigation_path = 'topics'; if ($_GET['bumps']) { $navigation_path = 'bumps'; } page_navigation($navigation_path, $current_page, $num_rows_fetched); require 'includes/footer.php';
$pms[$thread][1]=$title; $pms[$thread][2]=$from; } } $pt=new TablePrinter('tblPMs'); $pt->DefineColumns(array('Subject','From','Sent'),'Subject'); foreach($pms as $id=>$details) { //var_dump($pms); $pt->Row(array( '<a href="'.THISURL.'/private_messages.php/thread/'.$id.'/">'.htmlspecialchars($details[1]).'</a>', '<a href="'.THISURL.'/private_messages.php/compose/'.$details[2].'/">'.$details[2].'</a>', calculate_age($details[0]).' ago' )); } echo $pt->Output(); ?> <ul class="menu"><li><a href="<?=THISURL?>/private_messages.php/compose/">Compose New Message</a></li></ul> <? break; case 'compose': $page_title="Compose a PM."; ?> <form action="" method="post"> <h3>Send a Private Message</h3> <div class="body"> <label for="to" class="common">To:<label><input type="text" name="to" value="<?=htmlentities(Path::FetchIndex(1))?>" /> <label for="title" class="common">Title:<label><input type="text" name="title" value="" /> <?=csrf_token()?> <label for="body">Body:<label> <textarea name="body"></textarea>
while (list($fail_time, $fail_uid, $fail_reason, $fail_headline, $fail_body) = $res->FetchRow()) { if (strlen($fail_body) > 600) { $fail_body = substr($fail_body, 0, 600) . ' …'; } $tooltip = ''; if (empty($fail_headline)) { $tooltip = $fail_body; } else { if (!empty($fail_body)) { $tooltip = 'Headline: ' . $fail_headline . ' Body: ' . $fail_body; } } $fail_reasons = unserialize($fail_reason); $error_message = '<ul class="error_message'; if (!empty($tooltip)) { $error_message .= ' help'; } $error_message .= '" title="' . htmlspecialchars($tooltip) . '">'; foreach ($fail_reasons as $reason) { $error_message .= '<li>' . $reason . '</li>'; } $error_message .= '</ul>'; $values = array($error_message, '<a href="/profile/' . $fail_uid . '">' . $fail_uid . '</a>', '<span class="help" title="' . format_date($fail_time) . '">' . calculate_age($fail_time) . '</span>'); if (!$moderator && !$administrator) { array_splice($values, 1, 1); } $table->Row($values); } echo $table->Output('failed postings'); Output::$tpl->display('dashfooter.tpl.php'); require 'includes/footer.php';
{ $users->Row(array($row[0],$row[1],$row[2])); } ?> <form action="" method="post"> <?=csrf_token()?> <input type="hidden" name="form_sent" value="1" /> <h2>Administrators</h2> <?=$admins->Output(ADMIN_NAME.'s')?> <input type="submit" value="REVOKE" /> <h2>Moderators</h2> <?=$mods->Output(MOD_NAME.'s')?> <input type="submit" value="REVOKE" /> </form> <h2>Potential Powerusers</h2> <?=$users->Output('worthy candidates')?> <? break; // POST from TOPIC. case 'topic': $page_title="Bulk Moderation Action"; // Delete, Ban, and Filter checkbox contents. // Ban first. $cbt=count($_POST['bt']); $cb=count($_POST['b']); // Array: topic => replies $tpc=array(); $out="<ul>";
$page_title = 'Your post history, page #' . number_format($current_page); } $items_per_page = ITEMS_PER_PAGE; $start_listing_at = $items_per_page * ($current_page - 1); /* TOPICS */ $res = DB::Execute('SELECT id, time, replies, visits, headline FROM {P}Topics WHERE author = ? ORDER BY id DESC LIMIT ?, ?', array($_SESSION['UID'], $start_listing_at, $items_per_page)); $topics = new TablePrinter('tblTopics'); $columns = array('Headline', 'Replies', 'Visits', 'Age ▼'); $topics->DefineColumns($columns, 'Headline'); $topics->SetTDClass('Headline', 'topic_headline'); while (list($topic_id, $topic_time, $topic_replies, $topic_visits, $topic_headline) = $res->FetchRow()) { $values = array('<a href="/topic/' . $topic_id . '">' . htmlspecialchars($topic_headline) . '</a>', replies($topic_id, $topic_replies), format_number($topic_visits), '<span class="help" title="' . format_date($topic_time) . '">' . calculate_age($topic_time) . '</span>'); $topics->Row($values); } $num_topics_fetched = $topics->num_rows_fetched; echo $topics->Output('topics'); /* REPLIES */ $res = DB::Execute('SELECT replies.id, replies.parent_id, replies.time, replies.body, topics.headline, topics.time FROM {P}Replies as replies INNER JOIN {P}Topics as topics ON replies.parent_id = topics.id WHERE replies.author = ? ORDER BY id DESC LIMIT ?, ?', array($_SESSION['UID'], $start_listing_at, $items_per_page)); $replies = new TablePrinter('tblReplies'); $columns = array('Reply snippet', 'Topic', 'Age ▼'); $replies->DefineColumns($columns, 'Topic'); $replies->SetTDClass('Topic', 'topic_headline'); $replies->SetTDClass('Reply snippet', 'reply_body_snippet'); while (list($reply_id, $parent_id, $reply_time, $reply_body, $topic_headline, $topic_time) = $res->FetchRow()) { $values = array('<a href="/topic/' . $parent_id . '#reply_' . $reply_id . '">' . snippet($reply_body) . '</a>', '<a href="/topic/' . $parent_id . '">' . htmlspecialchars($topic_headline) . '</a> <span class="help unimportant" title="' . format_date($topic_time) . '">(' . calculate_age($topic_time) . ' old)</span>', '<span class="help" title="' . format_date($reply_time) . '">' . calculate_age($reply_time) . '</span>'); $replies->Row($values); } $num_replies_fetched = $replies->num_rows_fetched; echo $replies->Output('replies'); page_navigation('history', $current_page, $num_replies_fetched); require 'includes/footer.php';
break; case 'ban_uid': if (!$moderator && !$administrator) { add_error('You are not wise enough.', true); } if (!id_exists($_GET['id'])) { add_error('There is no such user.', true); } $uid = $_GET['id']; $page_title = 'Ban poster ' . $id; $slt = new TablePrinter('Bans'); $slt->DefineColumns(array('Confirm', 'UID', 'IP'), 'IP'); $i = 0; $slt->Row(array('<input type="hidden" name="uid[' . $i . ']" value="' . $uid . '"><input type="hidden" name="ip[' . $i . ']" value="-"><input type="checkbox" name="confirm[' . $i . ']" value="1" checked="checked" />', $uid, $ip)); Output::$tpl->display('controlpanel/banform.start.php'); echo $slt->Output('ban-ees'); Output::$tpl->display('controlpanel/banform.end.php'); include 'includes/footer.php'; exit; break; break; case 'unban_uid': if (!$moderator && !$administrator) { add_error('You are not wise enough.', true); } if (!id_exists($_GET['id'])) { add_error('There is no such user.', true); } $id = $_GET['id']; $page_title = 'Unban poster ' . $id; if (isset($_POST['id'])) {