From e6d7e71175e388b7d5e356eebb9ff350c941026e Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sat, 28 May 2011 01:47:59 +1000 Subject: renamed "homepage" directory to "themes" --- templates/homepage/basic/info.php | 27 ------- templates/homepage/basic/theme.php | 70 ---------------- templates/homepage/basic/thumb.png | Bin 9298 -> 0 bytes templates/homepage/frameset/info.php | 30 ------- templates/homepage/frameset/theme.php | 134 ------------------------------- templates/homepage/frameset/thumb.png | Bin 7571 -> 0 bytes templates/homepage/recent/info.php | 28 ------- templates/homepage/recent/recent.css | 50 ------------ templates/homepage/recent/theme.php | 147 ---------------------------------- templates/homepage/recent/thumb.png | Bin 24532 -> 0 bytes templates/themes/basic/info.php | 27 +++++++ templates/themes/basic/theme.php | 70 ++++++++++++++++ templates/themes/basic/thumb.png | Bin 0 -> 9298 bytes templates/themes/frameset/info.php | 30 +++++++ templates/themes/frameset/theme.php | 134 +++++++++++++++++++++++++++++++ templates/themes/frameset/thumb.png | Bin 0 -> 7571 bytes templates/themes/recent/info.php | 28 +++++++ templates/themes/recent/recent.css | 50 ++++++++++++ templates/themes/recent/theme.php | 147 ++++++++++++++++++++++++++++++++++ templates/themes/recent/thumb.png | Bin 0 -> 24532 bytes 20 files changed, 486 insertions(+), 486 deletions(-) delete mode 100644 templates/homepage/basic/info.php delete mode 100644 templates/homepage/basic/theme.php delete mode 100644 templates/homepage/basic/thumb.png delete mode 100644 templates/homepage/frameset/info.php delete mode 100644 templates/homepage/frameset/theme.php delete mode 100644 templates/homepage/frameset/thumb.png delete mode 100644 templates/homepage/recent/info.php delete mode 100644 templates/homepage/recent/recent.css delete mode 100644 templates/homepage/recent/theme.php delete mode 100644 templates/homepage/recent/thumb.png create mode 100644 templates/themes/basic/info.php create mode 100644 templates/themes/basic/theme.php create mode 100644 templates/themes/basic/thumb.png create mode 100644 templates/themes/frameset/info.php create mode 100644 templates/themes/frameset/theme.php create mode 100644 templates/themes/frameset/thumb.png create mode 100644 templates/themes/recent/info.php create mode 100644 templates/themes/recent/recent.css create mode 100644 templates/themes/recent/theme.php create mode 100644 templates/themes/recent/thumb.png (limited to 'templates') diff --git a/templates/homepage/basic/info.php b/templates/homepage/basic/info.php deleted file mode 100644 index bd856655..00000000 --- a/templates/homepage/basic/info.php +++ /dev/null @@ -1,27 +0,0 @@ - 'Title', - 'name' => 'title', - 'type' => 'text' - ); - - $theme['config'][] = Array( - 'title' => 'Slogan', - 'name' => 'subtitle', - 'type' => 'text' - ); - - // Unique function name for building everything - $theme['build_function'] = 'basic_build'; -?> \ No newline at end of file diff --git a/templates/homepage/basic/theme.php b/templates/homepage/basic/theme.php deleted file mode 100644 index 5b086852..00000000 --- a/templates/homepage/basic/theme.php +++ /dev/null @@ -1,70 +0,0 @@ -' - . '' - . '' - . '' . $settings['title'] . '' - . ''; - - $boardlist = createBoardlist(); - $body .= '
' . $boardlist['top'] . '
'; - - $body .= '

' . $settings['title'] . '

' - . '
' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '
'; - - $body .= '
'; - - $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); - if($query->rowCount() == 0) { - $body .= '

(No news to show.)

'; - } else { - // List news - while($news = $query->fetch()) { - $body .= '

' . - ($news['subject'] ? - $news['subject'] - : - 'no subject' - ) . - ' — by ' . - $news['name'] . - ' at ' . - date($config['post_date'], $news['time']) . - '

' . $news['body'] . '

'; - } - } - - $body .= '
'; - - // Finish page - $body .= '

Powered by Tinyboard'; - - return $body; - } - }; - -?> \ No newline at end of file diff --git a/templates/homepage/basic/thumb.png b/templates/homepage/basic/thumb.png deleted file mode 100644 index 05dcd96c..00000000 Binary files a/templates/homepage/basic/thumb.png and /dev/null differ diff --git a/templates/homepage/frameset/info.php b/templates/homepage/frameset/info.php deleted file mode 100644 index ad42fc91..00000000 --- a/templates/homepage/frameset/info.php +++ /dev/null @@ -1,30 +0,0 @@ - 'Title', - 'name' => 'title', - 'type' => 'text' - ); - - $theme['config'][] = Array( - 'title' => 'Slogan', - 'name' => 'subtitle', - 'type' => 'text' - ); - - // Unique function name for building everything - $theme['build_function'] = 'frameset_build'; -?> \ No newline at end of file diff --git a/templates/homepage/frameset/theme.php b/templates/homepage/frameset/theme.php deleted file mode 100644 index 6aa126c8..00000000 --- a/templates/homepage/frameset/theme.php +++ /dev/null @@ -1,134 +0,0 @@ -' - . '' - . '' - . '' - . '' . $settings['title'] . '' - . '' - // Sidebar - . '' - // Main - . '' - // Finish page - . ''; - } - - // Build news page - public static function news($settings) { - global $config; - - // HTML5 - $body = '' - . '' - . '' - . 'News' - . ''; - - $body .= '

' . $settings['title'] . '

' - . '
' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '
'; - - $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); - if($query->rowCount() == 0) { - $body .= '

(No news to show.)

'; - } else { - // List news - while($news = $query->fetch()) { - $body .= '
' . - '

' . - ($news['subject'] ? - $news['subject'] - : - 'no subject' - ) . - ' — by ' . - $news['name'] . - ' at ' . - date($config['post_date'], $news['time']) . - '

' . $news['body'] . '

'; - } - } - - // Finish page - $body .= ''; - - return $body; - } - - // Build sidebar - public static function sidebar($settings) { - global $config, $board; - - $body = '' - . '' - . '' - . '' - . '' - . '' . $settings['title'] . '' - . ''; - - $body .= '
' . $settings['title'] . '
'; - - - $body .= '
Boards
'; - - // Finish page - $body .= ''; - - return $body; - } - }; - -?> \ No newline at end of file diff --git a/templates/homepage/frameset/thumb.png b/templates/homepage/frameset/thumb.png deleted file mode 100644 index df18a8e9..00000000 Binary files a/templates/homepage/frameset/thumb.png and /dev/null differ diff --git a/templates/homepage/recent/info.php b/templates/homepage/recent/info.php deleted file mode 100644 index 734908c4..00000000 --- a/templates/homepage/recent/info.php +++ /dev/null @@ -1,28 +0,0 @@ - 'Title', - 'name' => 'title', - 'type' => 'text' - ); - - $theme['config'][] = Array( - 'title' => 'Excluded boards', - 'name' => 'exclude', - 'type' => 'text', - 'comment' => '(space seperated)' - ); - - // Unique function name for building everything - $theme['build_function'] = 'recentposts_build'; -?> \ No newline at end of file diff --git a/templates/homepage/recent/recent.css b/templates/homepage/recent/recent.css deleted file mode 100644 index 7b9f2333..00000000 --- a/templates/homepage/recent/recent.css +++ /dev/null @@ -1,50 +0,0 @@ -.box-wrap { - max-width: 670px; - min-width: 332px; - margin: 30px auto; - overflow: auto; - padding: 0; -} -.box { - background: white; - border: 1px solid #98E; - width: 330px; - margin: 8px 0; - padding: 0; -} -.box ul { - padding: 2px 15px; -} -.box ul li { - list-style: none; - margin: 0; -} -.box.left { - background: #efe; - color: #060; - border: 1px solid #060; - float: left; -} -.box.right { - background: #eef; - color: #006; - border: 1px solid #006; - float: right; -} - -.box h2 { - padding: 3px 7px; - font-size: 12pt; -} -.box.left h2 { - background: #9C6; - color: #060; -} -.box.right h2 { - background: #59A; - color: white; -} -.box img { - float: none; - margin: 10px auto; -} \ No newline at end of file diff --git a/templates/homepage/recent/theme.php b/templates/homepage/recent/theme.php deleted file mode 100644 index 764c4170..00000000 --- a/templates/homepage/recent/theme.php +++ /dev/null @@ -1,147 +0,0 @@ -build($action, $settings); - } - - // Wrap functions in a class so they don't interfere with normal Tinyboard operations - class RecentPosts { - public function build($action, $settings) { - global $config, $_theme; - - if($action == 'all') { - //copy($config['dir']['homepage'] . '/' . $_theme . '/recent.css', $config['dir']['home'] . 'recent.css'); - } - - $this->excluded = explode(' ', $settings['exclude']); - - if($action == 'all' || $action == 'post') - // file_put_contents($config['dir']['home'] . $config['file_index'], $this->homepage($settings)); - file_write($config['dir']['home'] . 'recent.html', $this->homepage($settings)); - } - - // Build news page - public function homepage($settings) { - global $config, $board; - - // HTML5 - $body = '' - . '' - . '' - . '' - . '' . $settings['title'] . '' - . ''; - - $boardlist = createBoardlist(); - $body .= '
' . $boardlist['top'] . '
'; - - $body .= '

' . $settings['title'] . '

'; - - - $boards = listBoards(); - - // Wrap - $body .= '
'; - - // Recent images - $body .= '

Recent Images

    '; - $query = ''; - foreach($boards as &$_board) { - if(in_array($_board['uri'], $this->excluded)) - continue; - $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `file` IS NOT NULL UNION ALL ", $_board['uri'], $_board['uri']); - } - $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT 3', $query); - $query = query($query) or error(db_error()); - - while($post = $query->fetch()) { - openBoard($post['board']); - - $body .= '
  • '; - } - $body .= '
'; - - // Latest posts - $body .= '

Latest Posts

    '; - $query = ''; - foreach($boards as &$_board) { - if(in_array($_board['uri'], $this->excluded)) - continue; - $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 30', $query); - $query = query($query) or error(db_error()); - - while($post = $query->fetch()) { - openBoard($post['board']); - - $body .= '
  • ' . $board['name'] . ': ' . pm_snippet($post['body'], 30) . '
  • '; - } - - $body .= '
'; - - - // Stats - $body .= '

Stats

    '; - - // Total posts - $query = 'SELECT SUM(`top`) AS `count` FROM ('; - foreach($boards as &$_board) { - if(in_array($_board['uri'], $this->excluded)) - continue; - $query .= sprintf("SELECT MAX(`id`) AS `top` FROM `posts_%s` UNION ALL ", $_board['uri']); - } - $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); - $query = query($query) or error(db_error()); - $res = $query->fetch(); - $body .= '
  • Total posts: ' . number_format($res['count']) . '
  • '; - - // Unique IPs - $query = 'SELECT COUNT(DISTINCT(`ip`)) AS `count` FROM ('; - foreach($boards as &$_board) { - if(in_array($_board['uri'], $this->excluded)) - continue; - $query .= sprintf("SELECT `ip` FROM `posts_%s` UNION ALL ", $_board['uri']); - } - $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); - $query = query($query) or error(db_error()); - $res = $query->fetch(); - $body .= '
  • Unique posters: ' . number_format($res['count']) . '
  • '; - - // Active content - $query = 'SELECT SUM(`filesize`) AS `count` FROM ('; - foreach($boards as &$_board) { - if(in_array($_board['uri'], $this->excluded)) - continue; - $query .= sprintf("SELECT `filesize` FROM `posts_%s` UNION ALL ", $_board['uri']); - } - $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); - $query = query($query) or error(db_error()); - $res = $query->fetch(); - $body .= '
  • Active content: ' . format_bytes($res['count']) . '
  • '; - - $body .= '
'; - - // End wrap - $body .= '
'; - - // Finish page - $body .= '

Powered by Tinyboard'; - - return $body; - } - }; - -?> \ No newline at end of file diff --git a/templates/homepage/recent/thumb.png b/templates/homepage/recent/thumb.png deleted file mode 100644 index fff5b824..00000000 Binary files a/templates/homepage/recent/thumb.png and /dev/null differ diff --git a/templates/themes/basic/info.php b/templates/themes/basic/info.php new file mode 100644 index 00000000..bd856655 --- /dev/null +++ b/templates/themes/basic/info.php @@ -0,0 +1,27 @@ + 'Title', + 'name' => 'title', + 'type' => 'text' + ); + + $theme['config'][] = Array( + 'title' => 'Slogan', + 'name' => 'subtitle', + 'type' => 'text' + ); + + // Unique function name for building everything + $theme['build_function'] = 'basic_build'; +?> \ No newline at end of file diff --git a/templates/themes/basic/theme.php b/templates/themes/basic/theme.php new file mode 100644 index 00000000..5b086852 --- /dev/null +++ b/templates/themes/basic/theme.php @@ -0,0 +1,70 @@ +' + . '' + . '' + . '' . $settings['title'] . '' + . ''; + + $boardlist = createBoardlist(); + $body .= '

' . $boardlist['top'] . '
'; + + $body .= '

' . $settings['title'] . '

' + . '
' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '
'; + + $body .= '
'; + + $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); + if($query->rowCount() == 0) { + $body .= '

(No news to show.)

'; + } else { + // List news + while($news = $query->fetch()) { + $body .= '

' . + ($news['subject'] ? + $news['subject'] + : + 'no subject' + ) . + ' — by ' . + $news['name'] . + ' at ' . + date($config['post_date'], $news['time']) . + '

' . $news['body'] . '

'; + } + } + + $body .= '
'; + + // Finish page + $body .= '

Powered by Tinyboard'; + + return $body; + } + }; + +?> \ No newline at end of file diff --git a/templates/themes/basic/thumb.png b/templates/themes/basic/thumb.png new file mode 100644 index 00000000..05dcd96c Binary files /dev/null and b/templates/themes/basic/thumb.png differ diff --git a/templates/themes/frameset/info.php b/templates/themes/frameset/info.php new file mode 100644 index 00000000..ad42fc91 --- /dev/null +++ b/templates/themes/frameset/info.php @@ -0,0 +1,30 @@ + 'Title', + 'name' => 'title', + 'type' => 'text' + ); + + $theme['config'][] = Array( + 'title' => 'Slogan', + 'name' => 'subtitle', + 'type' => 'text' + ); + + // Unique function name for building everything + $theme['build_function'] = 'frameset_build'; +?> \ No newline at end of file diff --git a/templates/themes/frameset/theme.php b/templates/themes/frameset/theme.php new file mode 100644 index 00000000..6aa126c8 --- /dev/null +++ b/templates/themes/frameset/theme.php @@ -0,0 +1,134 @@ +' + . '' + . '' + . '' + . '' . $settings['title'] . '' + . '' + // Sidebar + . '' + // Main + . '' + // Finish page + . ''; + } + + // Build news page + public static function news($settings) { + global $config; + + // HTML5 + $body = '' + . '' + . '' + . 'News' + . ''; + + $body .= '

' . $settings['title'] . '

' + . '
' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '
'; + + $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); + if($query->rowCount() == 0) { + $body .= '

(No news to show.)

'; + } else { + // List news + while($news = $query->fetch()) { + $body .= '
' . + '

' . + ($news['subject'] ? + $news['subject'] + : + 'no subject' + ) . + ' — by ' . + $news['name'] . + ' at ' . + date($config['post_date'], $news['time']) . + '

' . $news['body'] . '

'; + } + } + + // Finish page + $body .= ''; + + return $body; + } + + // Build sidebar + public static function sidebar($settings) { + global $config, $board; + + $body = '' + . '' + . '' + . '' + . '' + . '' . $settings['title'] . '' + . ''; + + $body .= '
' . $settings['title'] . '
'; + + + $body .= '
Boards
'; + + // Finish page + $body .= ''; + + return $body; + } + }; + +?> \ No newline at end of file diff --git a/templates/themes/frameset/thumb.png b/templates/themes/frameset/thumb.png new file mode 100644 index 00000000..df18a8e9 Binary files /dev/null and b/templates/themes/frameset/thumb.png differ diff --git a/templates/themes/recent/info.php b/templates/themes/recent/info.php new file mode 100644 index 00000000..734908c4 --- /dev/null +++ b/templates/themes/recent/info.php @@ -0,0 +1,28 @@ + 'Title', + 'name' => 'title', + 'type' => 'text' + ); + + $theme['config'][] = Array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + + // Unique function name for building everything + $theme['build_function'] = 'recentposts_build'; +?> \ No newline at end of file diff --git a/templates/themes/recent/recent.css b/templates/themes/recent/recent.css new file mode 100644 index 00000000..7b9f2333 --- /dev/null +++ b/templates/themes/recent/recent.css @@ -0,0 +1,50 @@ +.box-wrap { + max-width: 670px; + min-width: 332px; + margin: 30px auto; + overflow: auto; + padding: 0; +} +.box { + background: white; + border: 1px solid #98E; + width: 330px; + margin: 8px 0; + padding: 0; +} +.box ul { + padding: 2px 15px; +} +.box ul li { + list-style: none; + margin: 0; +} +.box.left { + background: #efe; + color: #060; + border: 1px solid #060; + float: left; +} +.box.right { + background: #eef; + color: #006; + border: 1px solid #006; + float: right; +} + +.box h2 { + padding: 3px 7px; + font-size: 12pt; +} +.box.left h2 { + background: #9C6; + color: #060; +} +.box.right h2 { + background: #59A; + color: white; +} +.box img { + float: none; + margin: 10px auto; +} \ No newline at end of file diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php new file mode 100644 index 00000000..764c4170 --- /dev/null +++ b/templates/themes/recent/theme.php @@ -0,0 +1,147 @@ +build($action, $settings); + } + + // Wrap functions in a class so they don't interfere with normal Tinyboard operations + class RecentPosts { + public function build($action, $settings) { + global $config, $_theme; + + if($action == 'all') { + //copy($config['dir']['homepage'] . '/' . $_theme . '/recent.css', $config['dir']['home'] . 'recent.css'); + } + + $this->excluded = explode(' ', $settings['exclude']); + + if($action == 'all' || $action == 'post') + // file_put_contents($config['dir']['home'] . $config['file_index'], $this->homepage($settings)); + file_write($config['dir']['home'] . 'recent.html', $this->homepage($settings)); + } + + // Build news page + public function homepage($settings) { + global $config, $board; + + // HTML5 + $body = '' + . '' + . '' + . '' + . '' . $settings['title'] . '' + . ''; + + $boardlist = createBoardlist(); + $body .= '
' . $boardlist['top'] . '
'; + + $body .= '

' . $settings['title'] . '

'; + + + $boards = listBoards(); + + // Wrap + $body .= '
'; + + // Recent images + $body .= '

Recent Images

    '; + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], $this->excluded)) + continue; + $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `file` IS NOT NULL UNION ALL ", $_board['uri'], $_board['uri']); + } + $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT 3', $query); + $query = query($query) or error(db_error()); + + while($post = $query->fetch()) { + openBoard($post['board']); + + $body .= '
  • '; + } + $body .= '
'; + + // Latest posts + $body .= '

Latest Posts

    '; + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], $this->excluded)) + continue; + $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 30', $query); + $query = query($query) or error(db_error()); + + while($post = $query->fetch()) { + openBoard($post['board']); + + $body .= '
  • ' . $board['name'] . ': ' . pm_snippet($post['body'], 30) . '
  • '; + } + + $body .= '
'; + + + // Stats + $body .= '

Stats

    '; + + // Total posts + $query = 'SELECT SUM(`top`) AS `count` FROM ('; + foreach($boards as &$_board) { + if(in_array($_board['uri'], $this->excluded)) + continue; + $query .= sprintf("SELECT MAX(`id`) AS `top` FROM `posts_%s` UNION ALL ", $_board['uri']); + } + $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); + $query = query($query) or error(db_error()); + $res = $query->fetch(); + $body .= '
  • Total posts: ' . number_format($res['count']) . '
  • '; + + // Unique IPs + $query = 'SELECT COUNT(DISTINCT(`ip`)) AS `count` FROM ('; + foreach($boards as &$_board) { + if(in_array($_board['uri'], $this->excluded)) + continue; + $query .= sprintf("SELECT `ip` FROM `posts_%s` UNION ALL ", $_board['uri']); + } + $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); + $query = query($query) or error(db_error()); + $res = $query->fetch(); + $body .= '
  • Unique posters: ' . number_format($res['count']) . '
  • '; + + // Active content + $query = 'SELECT SUM(`filesize`) AS `count` FROM ('; + foreach($boards as &$_board) { + if(in_array($_board['uri'], $this->excluded)) + continue; + $query .= sprintf("SELECT `filesize` FROM `posts_%s` UNION ALL ", $_board['uri']); + } + $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); + $query = query($query) or error(db_error()); + $res = $query->fetch(); + $body .= '
  • Active content: ' . format_bytes($res['count']) . '
  • '; + + $body .= '
'; + + // End wrap + $body .= '
'; + + // Finish page + $body .= '

Powered by Tinyboard'; + + return $body; + } + }; + +?> \ No newline at end of file diff --git a/templates/themes/recent/thumb.png b/templates/themes/recent/thumb.png new file mode 100644 index 00000000..fff5b824 Binary files /dev/null and b/templates/themes/recent/thumb.png differ -- cgit v1.3