if($date>$pms[$thread][0]) $pms[$thread][0]=$date; if($thread==0) { $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))?>" />
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';
function show_trash($uid, $silence = false) { $output = '<table><thead><tr> <th class="minimal">Headline</th> <th>Body</th> <th class="minimal">Time since deletion ▼</th> </tr></thead> <tbody>'; $trash = DB::GetAll('SELECT headline, body, time FROM {P}Trash WHERE uid = ' . DB::Q($uid) . ' ORDER BY time DESC'); $table = new TablePrinter('tblTrash'); $columns = array('Headline', 'Body', 'Time since deletion ▼'); $table->DefineColumns($columns, 'Body'); foreach ($trash as $row) { if (empty($row['headline'])) { $row['headline'] = '<span class="unimportant">(Reply.)</span>'; } else { $row['headline'] = htmlspecialchars($row['headline']); } $values = array($row['headline'], nl2br(htmlspecialchars($row['body'])), '<span class="help" title="' . format_date($row['time']) . '">' . calculate_age($row['time']) . '</span>'); $table->Row($values); } if ($table->num_rows_fetched === 0) { return false; } return $table; }
'Age ▼' ); $replies->DefineColumns($columns, 'Topic'); $replies->SetTDClass('Topic', 'topic_headline'); $replies->SetTDClass('Reply snippet', 'reply_body_snippet'); while($row=$res->FetchRow()) { list($reply_id, $parent_id, $reply_time, $reply_body, $reply_ip_address, $topic_headline, $topic_time)=$row; $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>', '<a href="/IP_address/' . $reply_ip_address . '">' . $reply_ip_address . '</a>', '<span class="help" title="' . format_date($reply_time) . '">' . calculate_age($reply_time) . '</span>' ); $replies->Row($values); } echo $replies; } if($trash = show_trash($_GET['uid'])) { echo '<h4 class="section">Trash</h4>' . $trash; } require('includes/footer.php'); ?>
$opts=''; foreach($this->Options as $optname=>$optvalue) { $opts='<option value="'.$optvalue.'">'.$optname.'</option>'; } if(!empty($_SESSION['2BFiltered'])) { foreach($_SESSION['2BFiltered'] as $filterstring) { $t->Row(array( '<input type="checkbox" name="c['.$i.']" value="1" checked="checked" />', '<label for="filter['.$i.']">Text to filter:</label><textarea name="filter['.$i.']" class="filter">'.htmlspecialchars($filterstring).'</textarea><select name="type['.$i.']">'.$opts.'</select><label for="replace['.$i.']">Replace with:</label><textarea name="replace['.$i.']"></textarea>', ($_POST['act']=='Preview') ? OutputWithLineNumbers(defuck_comment($_POST['filter'][$i])):'' )); $i++; } unset($_SESSION['2BFiltered']); } if(!empty($_POST['filter'])) { foreach($_POST['filter'] as $filterstring) { $t->Row(array( '<input type="checkbox" name="c['.$i.']" value="1" checked="checked" />', '<label for="filter['.$i.']">Text to filter:</label><textarea name="filter['.$i.']" class="filter">'.htmlspecialchars($filterstring).'</textarea><select name="type['.$i.']">'.$opts.'</select><label for="replace['.$i.']">Replace with:</label><textarea name="replace['.$i.']"></textarea>', ($_POST['act']=='Preview') ? OutputWithLineNumbers(defuck_comment($_POST['filter'][$i])):'' ));
foreach ($_POST['rejects'] as $reject_id) { if ($i > 0) { $sql .= ' OR '; } $sql .= '(uid = \'' . $User->UID . '\' AND topic_id = ' . intval($reject_id) . ')'; } DB::Execute($sql); $_SESSION['notice'] = 'Selected topics unwatched.'; } echo '<form name="fuck_off" action="" method="post">'; $topics = new TablePrinter('watchlist'); $topic_column = '<script type="text/javascript"> document.write(\'<input type="checkbox" name="master_checkbox" class="inline" onclick="checkOrUncheckAllCheckboxes()" title="Check/uncheck all" /> \');</script>Topic'; $columns = array($topic_column, 'Replies', 'Visits', 'Age', 'Last Post'); $db_columns = array('t.headline', 't.replies', 't.visits', 't.time', 'last_post'); $topics->DefaultSorting('last_post', SORT_DESC, $db_columns); $topics->DefineColumns($columns, $topic_column); $topics->SetTDClass($topic_column, 'topic_headline'); DB::ToggleDebug(); $res = DB::Execute('SELECT w.topic_id, t.headline, t.replies, t.visits, t.time, last_post FROM {P}Watchlists as w INNER JOIN {P}Topics as t ON w.topic_id = t.id WHERE w.uid = \'' . $User->ID . '\' ' . $topics->GetOrderSQL()); DB::ToggleDebug(); while (list($topic_id, $topic_headline, $topic_replies, $topic_visits, $topic_time, $last_post) = $res->FetchRow()) { $values = array('<input type="checkbox" name="rejects[]" value="' . $topic_id . '" class="inline" /> <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>', '<span class="help" title="' . format_date($last_post) . '">' . calculate_age($last_post) . '</span>'); $topics->Row($values); } $num_topics_fetched = $topics->num_rows_fetched; echo $topics; if ($num_topics_fetched !== 0) { echo '<div class="row"><input type="submit" value="Unwatch selected" onclick="return confirm(\'Really remove selected topic(s) from your watchlist?\');" class="inline" /></div>'; } echo '</form>'; require 'includes/footer.php';
<?php require 'includes/header.php'; $page_title = "Hot topics"; $res = DB::Execute('SELECT headline, id, time, replies FROM {P}Topics ORDER BY replies DESC LIMIT 0, 100'); $t = new TablePrinter('hot_topics'); $t->DefineColumns(array('#', 'Topic', 'Replies'), 'Topic'); $t->SetTDClass('Topic', 'topic_headline'); $i = 0; while (list($hot_headline, $hot_id, $hot_time, $hot_replies) = $res->FetchRow()) { $t->Row(array(++$i, '<a href="/topic/' . $hot_id . '">' . $hot_headline . '</a>', $hot_replies)); } echo $t; require 'includes/footer.php';
case 'read_appeals': $page_title="Appeals"; echo '<form action="/controlpanel/process_appeals/" method="post">'; $slt=new TablePrinter('UIDAppeals'); $slt->DefineColumns(array('Unban/Deny Appeal','UID','IP Address','Banned For','Appeal'),'UID/IP'); $slt->SetTDClass('Appeal','appeal'); $i=0; $res=DB::Execute("SELECT uid, ip, reason, appeal FROM {P}Bans WHERE appeal!=''"); while(list($uid,$reason,$appeal)=$res->FetchRow()) { $slt->Row(array( '<input type="checkbox" name="unban_uid[]" value="'.$uid.'" /><input type="checkbox" name="deny_appeal[]" value="'.$uid.'" />', $uid,$ip, $reason, htmlspecialchars($appeal))); } echo $slt.'<input type="submit" value="Unban"></forms>'; break; case 'process_appeals': $page_title="Processing appeals"; if(count($_POST['unban_uid'])>0) { $sql="DELETE FROM {P}Bans WHERE "; $i=0; foreach($_POST['unban_uid'] as $uid) { if($i>0) $sql.=" OR ";
redirect('Page deleted.'); } 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'];
</div> <? // Store information for the next round. $c++; $prevtime=$reply->Time; endforeach; if(isPowerUser()):?> <h2>UID Dump</h2> <? $uidt=new TablePrinter('tblUIDs'); $uidt->DefineColumns(array('UID','Names'),'Names'); foreach($this->topic->UIDs as $uid=>$names) { if($uid!='admin') $uid=sprintf('<a href="%1$sprofile/%2$s">%2$s</a>',THISURL,$uid); $uidt->Row(array($uid,implode(', ',$names))); } echo $uidt; ?> <?endif;?> <ul class="menu"> <li> <a href="<?php echo rel2Abs('/new_reply/' . $_GET['id']); ?> "> New reply </a> </li> </ul>
?> 's post count.</p> <?if(FALSE):?> <h2>Debugging Shit ($_SESSION)</h2> <? $table=new TablePrinter('tblSession'); $table->DefineColumns(array('Variable','Value'),'Value'); foreach($_SESSION as $k=>$v) $table->Row(array($k,$v)); echo $table; ?> <h2>Debugging Shit ($User)</h2> <? $table=new TablePrinter('tblUser'); $table->DefineColumns(array('Variable','Value'),'Value'); foreach($User as $k=>$v) { if(is_array($v)) $v='<pre>'.htmlentities(var_export($v,true)).'</pre>'; $table->Row(array($k,$v)); } echo $table; endif; Output::$tpl->display('dashfooter.tpl.php'); require('includes/footer.php'); ?>