summaryrefslogtreecommitdiff
path: root/templates/themes/favelaframes/theme.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-03-25 12:09:59 +0100
committerczaks <marcin@6irc.net>2014-03-25 12:09:59 +0100
commitb1490bed316f64e1e4a4215aebe90e990801e446 (patch)
tree57ddc4399126ee89dba3dd8ec6da87aae8d25836 /templates/themes/favelaframes/theme.php
parent1e92e678a61ea588197604a3acb51be35e393f66 (diff)
favelaframes is nothing more than frameset AFAIC
Diffstat (limited to 'templates/themes/favelaframes/theme.php')
-rw-r--r--templates/themes/favelaframes/theme.php74
1 files changed, 0 insertions, 74 deletions
diff --git a/templates/themes/favelaframes/theme.php b/templates/themes/favelaframes/theme.php
deleted file mode 100644
index d31a324e..00000000
--- a/templates/themes/favelaframes/theme.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
- require 'info.php';
-
- function favelaframes_build($action, $settings, $board) {
- // Possible values for $action:
- // - all (rebuild everything, initialization)
- // - news (news has been updated)
- // - boards (board list changed)
-
- Favelaframes::build($action, $settings);
- }
-
- // Wrap functions in a class so they don't interfere with normal Tinyboard operations
- class Favelaframes {
- public static function build($action, $settings) {
- global $config;
-
- if ($action == 'all') {
- copy('templates/themes/favelaframes/favelaframes.css', $config['dir']['home'] . 'stylesheets/' . $settings['css']);
- file_write($config['dir']['home'] . $settings['file_main'], Favelaframes::homepage($settings));
- }
-
- if ($action == 'all' || $action == 'boards')
- file_write($config['dir']['home'] . $settings['file_sidebar'], Favelaframes::sidebar($settings));
-
- if ($action == 'all' || $action == 'news')
- file_write($config['dir']['home'] . $settings['file_news'], Favelaframes::news($settings));
- }
-
- // Build homepage
- public static function homepage($settings) {
- global $config;
-
- return Element('themes/favelaframes/frames.html', Array('config' => $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/favelaframes/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/favelaframes/sidebar.html', Array(
- 'settings' => $settings,
- 'config' => $config,
- 'categories' => $categories
- ));
- }
- };
-
-?>