$config, 'settings' => $settings)); } // Build news page public static function news($settings) { global $config; $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); $news = $query->fetchAll(PDO::FETCH_ASSOC); return Element('themes/categories/news.html', Array( 'settings' => $settings, 'config' => $config, 'news' => $news )); } // Build sidebar public static function sidebar($settings) { global $config, $board; $categories = $config['categories']; foreach ($categories as &$boards) { foreach ($boards as &$board) { $title = boardTitle($board); if (!$title) $title = $board; // board doesn't exist, but for some reason you want to display it anyway $board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board)); } } return Element('themes/categories/sidebar.html', Array( 'settings' => $settings, 'config' => $config, 'categories' => $categories )); } }; ?>