' . '' . '' . '' . '' . '' . $settings['title'] . '' . '' . '' . '' . '' // Sidebar . '' // Main . '' // Finish page . ''; } // Build news page public static function news($settings) { global $config, $board; // HTML5 $body = '' . '' . '' . '' . '' . '' . '' . $settings['title'] . ' - News' . ''; $boardlist = createBoardlist(); $body .= $boardlist['top'] . '
'; $boards = listBoards(); $body .= '
Don\'t touch the lights!
'; // Recent Posts $body .= '
Recent Posts
'; $query = ''; foreach($boards as &$_board) { // Block Board if ($_board['uri'] != "aurora") { $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` UNION ALL ", $_board['uri'], $_board['uri']); } } $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT 15', $query); $query = query($query) or error(db_error()); while($post = $query->fetch()) { openBoard($post['board']); $body .= '' . $board['name'] . ': '; $snip = pm_snippet($post['body'], 95); if($snip === "") { $body .= '<empty>'; } else { $body .= $snip; } $body .= '
'; } // News $body .= '
'; $query = query("SELECT * FROM `news` ORDER BY `time` DESC LIMIT 5") or error(db_error()); if($query->rowCount() == 0) { $body .= '

(No news to show.)

'; } else { // List news while($news = $query->fetch()) { $body .= '
' . // Newer than 5 days? (time() - $news['time'] <= 432000 ? '*NEW* ' : '' ) . ($news['subject'] ? $news['subject'] : 'no subject' ) . ' — by ' . $news['name'] . ' at ' . strftime($config['post_date'], $news['time']) . '
' . $news['body'] . '
'; } } // Finish page $body .= '
'; $body .= '
'; return $body; } // Build sidebar public static function sidebar($settings) { global $config, $board; $body = '' . '' . '' . '' . '' . '' . '' . '' . '' . $settings['title'] . '' . ''; $body .= '
' . $settings['title'] . '
'; for($cat = 0; $cat < count($config['categories']); $cat++) { $body .= '
' . $config['categories'][$cat] . '
'; } foreach($config['custom_categories'] as $name => &$group) { $body .= '
' . $name . '
'; } // Finish page $body .= ''; return $body; } }; ?>