11 changed files with 0 additions and 616 deletions
@ -1,109 +0,0 @@ |
|||
div.ban { |
|||
max-width: 1200px; |
|||
min-width: 348px; |
|||
width: 85%; |
|||
} |
|||
div.ban .wrap { |
|||
margin: 10px; |
|||
overflow: auto; |
|||
} |
|||
div.board { |
|||
width: 100%; |
|||
overflow: auto; |
|||
margin: 10px 0; |
|||
} |
|||
div.board p { |
|||
text-align: justify; |
|||
} |
|||
div.board a.button { |
|||
text-align: center; |
|||
font-weight: bold; |
|||
font-size: 15pt; |
|||
height: 60px; |
|||
width: 75px; |
|||
display: inline-block; |
|||
background: #98E; |
|||
line-height: 60px; |
|||
|
|||
margin: 5px 25px; |
|||
|
|||
box-shadow:0 2px 5px 0px #D0D0D0; |
|||
-webkit-box-shadow:0 2px 5px 0px #D0D0D0; |
|||
|
|||
border-radius:15px; |
|||
-webkit-border-radius:15px; |
|||
float: left; |
|||
} |
|||
div.board a.button:hover { |
|||
box-shadow:0 2px 5px 0px #222; |
|||
-webkit-box-shadow:0 2px 5px 0px #222; |
|||
} |
|||
img:hover { |
|||
box-shadow:0 2px 5px 0px #555; |
|||
-webkit-box-shadow:0 2px 5px 0px #555; |
|||
} |
|||
div.container { |
|||
margin: auto; |
|||
max-width: 1000px; |
|||
} |
|||
div.split { |
|||
margin-top: 40px; |
|||
overflow: auto; |
|||
border: 1px solid #ccc; |
|||
border-style: solid none none none; |
|||
} |
|||
div.panel { |
|||
margin: 0; |
|||
|
|||
float: left; |
|||
width: 40%; |
|||
} |
|||
div.panel h3 { |
|||
margin: 10px 0; |
|||
} |
|||
div.panel.left { |
|||
min-width: 150px; |
|||
max-width: 400px; |
|||
padding: 10px 0; |
|||
} |
|||
div.panel.left ul { |
|||
padding: 5px; |
|||
margin: 0; |
|||
word-wrap: break-word; |
|||
} |
|||
div.panel.right { |
|||
border: 1px solid #ccc; |
|||
border-style: none none none solid; |
|||
min-width: 175px; |
|||
max-width: 50%; |
|||
width: 100%; |
|||
padding: 10px 0; |
|||
} |
|||
div.panel.right ul, div.panel.right p, div.panel.right h3 { |
|||
padding: 5px 10px; |
|||
} |
|||
div.panel.right ul { |
|||
padding: 0 25px; |
|||
} |
|||
div.panel.right ul li { |
|||
margin: 10px 0; |
|||
} |
|||
div.panel.left ul li { |
|||
list-style: none; |
|||
} |
|||
div.panel.left .images { |
|||
float: left; |
|||
max-width: 80px; |
|||
margin: 10px 20px 0px 0px; |
|||
} |
|||
div.panel.left .images a, div.panel.left .images img { |
|||
padding: 0; |
|||
margin: 2px 3px; |
|||
display: inline; |
|||
} |
|||
div.panel.left .images img { |
|||
float: none; |
|||
} |
|||
div.panel.right ul ul li { |
|||
margin: 2px 0; |
|||
} |
@ -1,15 +0,0 @@ |
|||
<?php |
|||
$theme = Array(); |
|||
|
|||
// Theme name |
|||
$theme['name'] = '4chon'; |
|||
// Description (you can use Tinyboard markup here) |
|||
$theme['description'] = 'Official 4chon.net theme.'; |
|||
$theme['version'] = 'v0.9'; |
|||
|
|||
// Theme configuration |
|||
$theme['config'] = Array(); |
|||
|
|||
// Unique function name for building everything |
|||
$theme['build_function'] = 'chon_build'; |
|||
?> |
@ -1,215 +0,0 @@ |
|||
<?php |
|||
require 'info.php'; |
|||
|
|||
$chon_settings = Array( |
|||
'thumbwidth' => 80, |
|||
'thumbheight' => 80 |
|||
); |
|||
|
|||
function chon_build($action, $settings) { |
|||
$settings = Array( |
|||
'title' => '4chon', |
|||
'subtitle' => '', |
|||
'boards' => Array( |
|||
'new' => 'A place for the debate of political intrigue and current events. This board has a wide and varied user base with many unique, and sometimes controversial, views expressed.', |
|||
'r9k' => 'A unique board for open discussion based on an original content script. If a post has been made before, the reposter is muted. The length of the mute increases at the rate of 2^n seconds with each additional mute a user receives. Loosely based upon robot9000 of #xkcd-signal.', |
|||
'v' => 'A board in which to discuss many of our favourite hobbies: video games. New and old, PC and console, the discussion is always fresh and on-topic.', |
|||
'meta' => 'A board for the discussion and improvement of the community, 4chon or otherwise. Questions, comments, and modposts are frequently found here.' |
|||
), |
|||
'thumbwidth' => 80, |
|||
'thumbheight' => 80 |
|||
); |
|||
|
|||
// Possible values for $action: |
|||
// - all (rebuild everything, initialization) |
|||
// - news (news has been updated) |
|||
// - boards (board list changed) |
|||
|
|||
Chon::build($action, $settings); |
|||
} |
|||
|
|||
// Wrap functions in a class so they don't interfere with normal Tinyboard operations |
|||
class Chon { |
|||
public static function build($action, $settings) { |
|||
global $config; |
|||
|
|||
//if($action == 'all' || $action == 'news') |
|||
file_write($config['dir']['home'] . $config['file_index'], Chon::homepage($settings)); |
|||
} |
|||
|
|||
// Build news page |
|||
public static function homepage($settings) { |
|||
global $config, $board; |
|||
|
|||
// HTML5 |
|||
$body = '<!DOCTYPE html><html>' |
|||
. '<head>' |
|||
. '<link rel="stylesheet" media="screen" href="' . $config['url_stylesheet'] . '"/>' |
|||
. '<link rel="stylesheet" media="screen" href="http://static.4chon.net/home.css"/>' |
|||
. '<link rel="shortcut icon" href="http://static.4chon.net/favicon.gif" />' |
|||
. '<script type="text/javascript" src="http://static.4chon.net/ga.js"></script>' |
|||
. '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />' |
|||
. '<meta name="keywords" content="4chon,chon,r9k,robot9000,r9k1,4chon r9k,4chon new,free speech imageboard,racist imageboard,4chan new,moot is a faggot,r9k deleted,new deleted,the vidya,robot 9000,tinyboard,imageboard" />' |
|||
. '<title>' . $settings['title'] . '</title>' |
|||
. '</head><body>'; |
|||
|
|||
$body .= '<h1><a title="4chon" href="/">' . $settings['title'] . '</a></h1>' |
|||
. '<div class="title">' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '</div>'; |
|||
|
|||
$body .= '<div class="ban">'; |
|||
|
|||
$body .= '<h2>4chon</h2><div class="wrap">'; |
|||
|
|||
$body .= '<g:plusone size="medium" count="false" href="http://4chon.net/"></g:plusone>'; |
|||
|
|||
$body .= '<h3>Welcome to 4chon.net!</h3>'; |
|||
$body .= '<p>The largest and most popular community based on <a href="http://tinyboard.org/">Tinyboard</a>; we\'re picking up where 4chan is dying! In mid-January, /r9k/ and /new/ were simultaneously deleted from 4chan. Less than an hour later, 4chon was created to give these boards a new life, and we have been growing ever since. With over one million posts in just a few months, we\'re the largest chon in existence.</p>'; |
|||
|
|||
$body .= '<h3>Our Boards</h3>'; |
|||
$__boards = listBoards(); |
|||
foreach($settings['boards'] as $board => $description) { |
|||
foreach($__boards as $_board) { |
|||
if($_board['uri'] == $board) { |
|||
$board = $_board; |
|||
break; |
|||
} |
|||
} |
|||
$body .= '<div class="board">'; |
|||
$body .= '<a title="' . $board['title'] . '" href="' . $config['root'] . $board['uri'] . '/' . $config['file_index'] . '" class="button">/' . $board['uri'] . '/</a>'; |
|||
$body .= '<p>' . $description . '</p>'; |
|||
$body .= '</div>'; |
|||
} |
|||
|
|||
$body .= '<div class="container"><div class="split">'; |
|||
|
|||
$body .= '<div class="panel left">'; |
|||
|
|||
|
|||
$query = ''; |
|||
foreach($settings['boards'] as $board => $description) { |
|||
$query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `file` IS NOT NULL AND `file` != 'deleted' UNION ALL ", $board, $board); |
|||
} |
|||
$query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT 10', $query); |
|||
$query = query($query) or error(db_error()); |
|||
|
|||
$body .= '<div class="images">'; |
|||
while($post = $query->fetch()) { |
|||
openBoard($post['board']); |
|||
$x_ratio = $settings['thumbwidth'] / $post['thumbwidth']; |
|||
$y_ratio = $settings['thumbheight'] / $post['thumbheight']; |
|||
|
|||
if(($post['thumbwidth'] <= $settings['thumbwidth']) && ($post['thumbheight'] <= $settings['thumbheight'])) { |
|||
$tn_width = $post['thumbwidth']; |
|||
$tn_height = $post['thumbheight']; |
|||
} elseif (($x_ratio * $post['thumbheight']) < $settings['thumbheight']) { |
|||
$tn_height = ceil($x_ratio * $post['thumbheight']); |
|||
$tn_width = $settings['thumbwidth']; |
|||
} else { |
|||
$tn_width = ceil($y_ratio * $post['thumbwidth']); |
|||
$tn_height = $settings['thumbheight']; |
|||
} |
|||
|
|||
$post['thumbwidth'] = $tn_width; |
|||
$post['thumbheight'] = $tn_height; |
|||
|
|||
$body .= '<a href="' . |
|||
$config['root'] . $board['dir'] . $config['dir']['res'] . ($post['thread']?$post['thread']:$post['id']) . '.html#' . $post['id'] . |
|||
'"><img src="' . $config['uri_thumb'] . str_replace('.', '_small.', $post['thumb']) . '" style="width:' . $post['thumbwidth'] . 'px;height:' . $post['thumbheight'] . 'px;" /></a>'; |
|||
} |
|||
$body .= '</div>'; |
|||
|
|||
|
|||
|
|||
// Latest posts |
|||
$body .= '<ul>'; |
|||
$query = ''; |
|||
foreach($settings['boards'] as $board => $description) { |
|||
$query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` UNION ALL ", $board, $board); |
|||
} |
|||
$query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT 35', $query); |
|||
$query = query($query) or error(db_error()); |
|||
|
|||
while($post = $query->fetch()) { |
|||
openBoard($post['board']); |
|||
|
|||
$body .= '<li><strong>' . $board['name'] . '</strong>: <a href="' . |
|||
$config['root'] . $board['dir'] . $config['dir']['res'] . ($post['thread']?$post['thread']:$post['id']) . '.html#' . $post['id'] . |
|||
'">' . (empty($post['body']) ? '…' : pm_snippet($post['body'], 25)) . '</a></li>'; |
|||
} |
|||
$body .= '</ul>'; |
|||
|
|||
$body .= '</div>'; |
|||
|
|||
$body .= '<div class="panel right">'; |
|||
$body .= '<h3>4chon Community</h3>'; |
|||
$body .= '<p>Aside from our boards, we also have an active community in the following places:</p>'; |
|||
|
|||
$body .= '<ul>'; |
|||
$body .= '<li><a href="http://tv.4chon.net/">/tv/</a> - We automatically maintain a list of livestreams that were posted on the boards, where users of 4chon can watch television shows, movies, and circlejerks.</li>'; |
|||
$body .= '<li>Minecraft - Our unofficial Minecraft server. Come build with bros and visit our giant penis sculpture! eironeia.datnode.net:24598</li>'; |
|||
$body .= '</ul>'; |
|||
|
|||
$body .= '<h3>4chon</h3>'; |
|||
$body .= '<p>Please read the <a href="rules.html">general and board-specifc rules</a> as well as the <a href="faq.html">4chon FAQ</a> before posting.</p>'; |
|||
|
|||
$body .= '<p>4chon keeps a <a href="stats.html">statistics page</a> which gives detailed information about all of our boards, such as posts per minute, user locations, referring sites and more!. There\'s also a <a href="http://status.4chon.net/map.html">map of our posters around the globe</a>!</p>'; |
|||
$body .= '<p>If, for any reason, you need to contact the 4chon staff, they can be reached in IRC - <a href="irc://irc.datnode.net/4chon">irc.datnode.net #4chon</a> / [<a href="irc.html">WebIRC</a>].</p>'; |
|||
|
|||
$body .= '<p>The admin may be contacted at <a href="mailto:[email protected]">[email protected]</a> or <a href="/meta/">>>>/meta/</a>.</p>'; |
|||
|
|||
$body .= '<p>For status updates and explanations of downtime, please see our <a href="http://status.4chon.net/">status page</a> or follow us on <a href="http://twitter.com/#!/4chonable">our rarely-used @4chonable</a> Twitter account</p>'; |
|||
|
|||
$body .= '</div>'; |
|||
|
|||
$body .= '</div>'; |
|||
|
|||
$body .= '</div></div></div>'; |
|||
|
|||
$body .= '<p style="text-align:center">In memory of Scott “Wingo” Canner (1989-2011).</p>'; |
|||
|
|||
$body .= '<ul style="text-align:center;list-style:none;padding:0">'; |
|||
|
|||
// Total posts |
|||
$query = 'SELECT SUM(`top`) AS `count` FROM ('; |
|||
foreach($settings['boards'] as $board => $description) { |
|||
$query .= sprintf("SELECT MAX(`id`) AS `top` FROM `posts_%s` UNION ALL ", $board); |
|||
} |
|||
$query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); |
|||
$query = query($query) or error(db_error()); |
|||
$res = $query->fetch(); |
|||
$body .= '<li>Total posts: ' . number_format($res['count']) . '</li>'; |
|||
|
|||
// Unique IPs |
|||
$query = 'SELECT COUNT(DISTINCT(`ip`)) AS `count` FROM ('; |
|||
foreach($settings['boards'] as $board => $description) { |
|||
$query .= sprintf("SELECT `ip` FROM `posts_%s` UNION ALL ", $board); |
|||
} |
|||
$query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); |
|||
$query = query($query) or error(db_error()); |
|||
$res = $query->fetch(); |
|||
$body .= '<li>Current posters: ' . number_format($res['count']) . '</li>'; |
|||
|
|||
// Active content |
|||
$query = 'SELECT SUM(`filesize`) AS `count` FROM ('; |
|||
foreach($settings['boards'] as $board => $description) { |
|||
$query .= sprintf("SELECT `filesize` FROM `posts_%s` UNION ALL ", $board); |
|||
} |
|||
$query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); |
|||
$query = query($query) or error(db_error()); |
|||
$res = $query->fetch(); |
|||
$body .= '<li>Active content: ' . format_bytes($res['count']) . '</li>'; |
|||
|
|||
$body .= '</ul>'; |
|||
|
|||
// Finish page |
|||
$body .= '<hr/><p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> | You must be at least 18 years of age to continue browsing.' . |
|||
|
|||
'<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>' . |
|||
|
|||
'</body></html>'; |
|||
|
|||
return $body; |
|||
} |
|||
}; |
|||
|
|||
?> |
Before Width: | Height: | Size: 21 KiB |
@ -1,28 +0,0 @@ |
|||
<?php |
|||
$theme = Array(); |
|||
|
|||
// Theme name |
|||
$theme['name'] = 'Drudge Report'; |
|||
// Description (you can use Tinyboard markup here) |
|||
$theme['description'] = 'Recent posts theme, styled like Druge Report.'; |
|||
$theme['version'] = 'v0.1'; |
|||
|
|||
// Theme configuration |
|||
$theme['config'] = Array(); |
|||
|
|||
$theme['config'][] = Array( |
|||
'title' => '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'] = 'drudge_build'; |
|||
?> |
@ -1,145 +0,0 @@ |
|||
<?php |
|||
require 'info.php'; |
|||
|
|||
function drudge_build($action, $settings) { |
|||
// Possible values for $action: |
|||
// - all (rebuild everything, initialization) |
|||
// - news (news has been updated) |
|||
// - boards (board list changed) |
|||
// - post (a post has been made) |
|||
|
|||
$b = new Drudge(); |
|||
$b->build($action, $settings); |
|||
} |
|||
|
|||
// Wrap functions in a class so they don't interfere with normal Tinyboard operations |
|||
class Drudge { |
|||
public function build($action, $settings) { |
|||
global $config, $_theme, $threads; |
|||
|
|||
// Don't worry about this for now: |
|||
//if($action == 'all') { |
|||
// copy($config['dir']['themes'] . '/' . $_theme . '/master.css', $config['dir']['home'] . 'drudge_master.css'); |
|||
// copy($config['dir']['themes'] . '/' . $_theme . '/reset.css', $config['dir']['home'] . 'drudge_reset.css'); |
|||
//} |
|||
|
|||
$this->excluded = explode(' ', $settings['exclude']); |
|||
|
|||
if($action == 'all' || $action == 'post') |
|||
file_write($config['dir']['home'] . 'landing/index.html', $this->homepage($settings)); |
|||
} |
|||
|
|||
private function spot($num) { |
|||
global $config; |
|||
|
|||
$prime = $num < 7; |
|||
|
|||
if(!isset($this->threads[$num])) |
|||
return ''; |
|||
|
|||
$post = &$this->threads[$num]; |
|||
|
|||
return ($prime ? |
|||
'<img src="' . $config['uri_thumb'] . $post['thumb'] . '"/>' |
|||
: '') |
|||
. '<h2><a href="' . $post['email'] . '">' . $post['subject'] . '</a><a href="' . $post['email'] . '">...</a></h2><hr />'; |
|||
} |
|||
|
|||
// Build news page |
|||
public function homepage($settings) { |
|||
global $config, $board; |
|||
|
|||
openBoard('a'); |
|||
|
|||
// HTML5 |
|||
$body = '<!DOCTYPE html><html>' |
|||
. '<head>' |
|||
//. '<link rel="stylesheet" media="screen" href="' . $config['url_stylesheet'] . '"/>' |
|||
. '<link rel="stylesheet" media="screen" href="' . $config['root'] . 'landing/reset.css"/>' |
|||
. '<link rel="stylesheet" media="screen" href="' . $config['root'] . 'landing/master.css"/>' |
|||
. '<title>' . $settings['title'] . '</title>' |
|||
. '</head><body>' |
|||
|
|||
// heading |
|||
. '<div id="hed-container">' |
|||
|
|||
/* |
|||
Sub-headlines related to the main headline appear here. |
|||
They are pulled from the subject lines of the replies to the top thread. |
|||
|
|||
Drudge follows all stories with "...", other than the main headline |
|||
We will use the ellipse to link to the forum thread, while the headline links directly to the story |
|||
*/ |
|||
|
|||
. '<div id="hed-sub">' |
|||
. '<h2 class="sub"><a href="">Subject Line of latest reply in top thread</a><a href="">...</a></h2>' |
|||
. '</div>' |
|||
|
|||
. '<div id="hed">' |
|||
. '<img src="breitbart.jpg" title="" />' |
|||
. '<br />'; |
|||
|
|||
$this->threads = Array(); // 0 = main heading, 1-6 = prime spots, 7-18 = normal |
|||
|
|||
$query = query("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM `posts_a` WHERE `thread` = `thread_id`) AS `replies` FROM `posts_a` WHERE `thread` IS NULL AND `email` != '' AND `subject` != '' ORDER BY `sticky` DESC, `replies` DESC, `bump` DESC LIMIT 19") or error(db_error()); |
|||
while($post = $query->fetch()) { |
|||
$this->threads[] = $post; |
|||
} |
|||
|
|||
// first prime gets headline |
|||
$body .= '<h1><a href="' . $this->threads[0]['email'] . '">' . strtoupper($this->threads[0]['subject']) . '</a></h1>'; |
|||
|
|||
$body .= '</div>' |
|||
. '</div>' |
|||
; |
|||
|
|||
$body .= '<div id="fold"><a href="http://serfin.us/a"><img src="serfinus.png" title="" /></a></div>'; |
|||
|
|||
// begin three column layout here |
|||
$body .= '<div id="below-the-fold">'; |
|||
|
|||
|
|||
// <stobor> Headline: P Left column: xxPxPx Center: PxxxPx Right: xPxxPx |
|||
|
|||
// first column |
|||
$body .= '<div class="column" id="c-left">' . |
|||
$this->spot(7) . |
|||
$this->spot(8) . |
|||
$this->spot(1) . |
|||
$this->spot(9) . |
|||
$this->spot(2) . |
|||
$this->spot(10) . |
|||
'</div>'; |
|||
|
|||
// second column |
|||
$body .= '<div class="column" id="c-center">' . |
|||
$this->spot(3) . |
|||
$this->spot(11) . |
|||
$this->spot(12) . |
|||
$this->spot(13) . |
|||
$this->spot(4) . |
|||
$this->spot(14) . |
|||
'</div>'; |
|||
|
|||
// third column |
|||
$body .= '<div class="column" id="c-right">' . |
|||
$this->spot(15) . |
|||
$this->spot(5) . |
|||
$this->spot(16) . |
|||
$this->spot(17) . |
|||
$this->spot(6) . |
|||
$this->spot(18) . |
|||
'</div>'; |
|||
|
|||
|
|||
// end container |
|||
$body .= '</div>'; |
|||
|
|||
// Finish page |
|||
$body .= '<hr/><p class="unimportant" style="margin-top:20px;text-align:center;font-size:8pt;font-weight:normal">Powered by <a href="http://tinyboard.org/">Tinyboard</a></body></html>'; |
|||
|
|||
return $body; |
|||
} |
|||
}; |
|||
|
|||
?> |
Before Width: | Height: | Size: 24 KiB |
Binary file not shown.
@ -1,27 +0,0 @@ |
|||
<?php |
|||
$theme = Array(); |
|||
|
|||
// Theme name |
|||
$theme['name'] = 'Rui\'s Mod'; |
|||
// Description (you can use Tinyboard markup here) |
|||
$theme['description'] = 'Extremely basic news listing for the homepage. It\'s suggested that you enable boardlinks for this theme.'; |
|||
$theme['version'] = 'v0.9'; |
|||
|
|||
// Theme configuration |
|||
$theme['config'] = Array(); |
|||
|
|||
$theme['config'][] = Array( |
|||
'title' => 'Title', |
|||
'name' => 'title', |
|||
'type' => 'text' |
|||
); |
|||
|
|||
$theme['config'][] = Array( |
|||
'title' => 'Slogan', |
|||
'name' => 'subtitle', |
|||
'type' => 'text' |
|||
); |
|||
|
|||
// Unique function name for building everything |
|||
$theme['build_function'] = 'rui_build'; |
|||
?> |
@ -1,77 +0,0 @@ |
|||
<?php |
|||
require 'info.php'; |
|||
|
|||
function rui_build($action, $settings) { |
|||
// Possible values for $action: |
|||
// - all (rebuild everything, initialization) |
|||
// - news (news has been updated) |
|||
// - boards (board list changed) |
|||
|
|||
Rui::build($action, $settings); |
|||
} |
|||
|
|||
// Wrap functions in a class so they don't interfere with normal Tinyboard operations |
|||
class Rui { |
|||
public static function build($action, $settings) { |
|||
global $config; |
|||
|
|||
if($action == 'all' || $action == 'news') |
|||
file_write($config['dir']['home'] . $config['file_index'], self::homepage($settings)); |
|||
} |
|||
|
|||
// Build news page |
|||
public static function homepage($settings) { |
|||
global $config; |
|||
|
|||
// HTML5 |
|||
$body = '<!DOCTYPE html><html>' |
|||
. '<head>' |
|||
. '<link rel="stylesheet" media="screen" href="' . $config['url_stylesheet'] . '"/>' |
|||
. '<title>' . $settings['title'] . '</title>' |
|||
. '</head><body>'; |
|||
|
|||
$boardlist = createBoardlist(); |
|||
$body .= '<div class="boardlist">' . $boardlist['top'] . '</div>'; |
|||
|
|||
$body .= '<h1>' . $settings['title'] . '</h1>' |
|||
. '<div class="title">' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '</div>'; |
|||
|
|||
$body .= '<div class="ban">'; |
|||
|
|||
$query = query("SELECT * FROM `news` ORDER BY `name` = 'static' DESC, `time` DESC") or error(db_error()); |
|||
if($query->rowCount() == 0) { |
|||
$body .= '<p style="text-align:center" class="unimportant">(No news to show.)</p>'; |
|||
} else { |
|||
// List news |
|||
while($news = $query->fetch()) { |
|||
$body .= '<h2 id="' . $news['id'] . '">' . |
|||
($news['subject'] ? |
|||
$news['subject'] |
|||
: |
|||
'<em>no subject</em>' |
|||
) . |
|||
|
|||
($news['name'] != 'static' ? |
|||
'<span class="unimportant"> - ' . |
|||
date($config['post_date'], $news['time']) . |
|||
'</span>' |
|||
: '') . |
|||
'</h2><p>' . $news['body'] . '</p>'; |
|||
|
|||
if($news['name'] == 'static') { |
|||
// static notice |
|||
$body .= '</div><div class="ban">'; |
|||
} |
|||
} |
|||
} |
|||
|
|||
$body .= '</div>'; |
|||
|
|||
// Finish page |
|||
$body .= '<hr/><p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a></body></html>'; |
|||
|
|||
return $body; |
|||
} |
|||
}; |
|||
|
|||
?> |
Before Width: | Height: | Size: 9.1 KiB |
Loading…
Reference in new issue