Exemple #1
0
/**
 * Show boards by activity.
 *
 * @param int $num_top
 * @param string $output_method = 'echo'
 */
function ssi_topBoards($num_top = 10, $output_method = 'echo')
{
    global $txt;
    require_once SUBSDIR . '/Stats.subs.php';
    // Find boards with lots of posts.
    $boards = topBoards($num_top, true);
    foreach ($boards as $id => $board) {
        $boards[$id]['new'] = empty($board['is_read']);
    }
    // If we shouldn't output or have nothing to output, just jump out.
    if ($output_method != 'echo' || empty($boards)) {
        return $boards;
    }
    echo '
		<table class="ssi_table">
			<tr>
				<th class="lefttext">', $txt['board'], '</th>
				<th class="righttext">', $txt['board_topics'], '</th>
				<th class="righttext">', $txt['posts'], '</th>
			</tr>';
    foreach ($boards as $board) {
        echo '
			<tr>
				<td>', $board['new'] ? ' <a href="' . $board['href'] . '"><span class="new_posts">' . $txt['new'] . '</span></a> ' : '', $board['link'], '</td>
				<td class="righttext">', $board['num_topics'], '</td>
				<td class="righttext">', $board['num_posts'], '</td>
			</tr>';
    }
    echo '
		</table>';
}
Exemple #2
0
 /**
  * Top posters, boards, replies, etc.
  */
 public function loadTopStatistics()
 {
     global $context;
     // Poster top 10.
     $context['top']['posters'] = topPosters();
     // Board top 10.
     $context['top']['boards'] = topBoards();
     // Topic replies top 10.
     $context['top']['topics_replies'] = topTopicReplies();
     // Topic views top 10.
     $context['top']['topics_views'] = topTopicViews();
     // Topic poster top 10.
     $context['top']['starters'] = topTopicStarter();
     // Time online top 10.
     $context['top']['time_online'] = topTimeOnline();
 }