summaryrefslogtreecommitdiff
path: root/templates/themes/recent
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-05-06 01:33:10 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-05-06 01:33:10 +1000
commita6104587203f1b1b448e6977066d6e649de91ae8 (patch)
tree58f3f17daaeb47de3ecc87f9967b432612147e68 /templates/themes/recent
parentac2837c6204221554ceebc56c5fb9e38be4e0925 (diff)
a lot more improvements
Diffstat (limited to 'templates/themes/recent')
-rw-r--r--templates/themes/recent/info.php6
-rw-r--r--templates/themes/recent/theme.php28
2 files changed, 17 insertions, 17 deletions
diff --git a/templates/themes/recent/info.php b/templates/themes/recent/info.php
index 83d7477a..d4cf1029 100644
--- a/templates/themes/recent/info.php
+++ b/templates/themes/recent/info.php
@@ -60,11 +60,11 @@
$theme['build_function'] = 'recentposts_build';
$theme['install_callback'] = 'recentposts_install';
- if(!function_exists('recentposts_install')) {
+ if (!function_exists('recentposts_install')) {
function recentposts_install($settings) {
- if(!is_numeric($settings['limit_images']) || $settings['limit_images'] < 0)
+ if (!is_numeric($settings['limit_images']) || $settings['limit_images'] < 0)
return Array(false, '<strong>' . utf8tohtml($settings['limit_images']) . '</strong> is not a non-negative integer.');
- if(!is_numeric($settings['limit_posts']) || $settings['limit_posts'] < 0)
+ if (!is_numeric($settings['limit_posts']) || $settings['limit_posts'] < 0)
return Array(false, '<strong>' . utf8tohtml($settings['limit_posts']) . '</strong> is not a non-negative integer.');
}
}
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index 13a5546f..986fac6a 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -17,13 +17,13 @@
public function build($action, $settings) {
global $config, $_theme;
- if($action == 'all') {
+ if ($action == 'all') {
copy('templates/themes/recent/recent.css', $config['dir']['home'] . $settings['css']);
}
$this->excluded = explode(' ', $settings['exclude']);
- if($action == 'all' || $action == 'post')
+ if ($action == 'all' || $action == 'post')
file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings));
}
@@ -38,15 +38,15 @@
$boards = listBoards();
$query = '';
- foreach($boards as &$_board) {
- if(in_array($_board['uri'], $this->excluded))
+ 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 AND `file` != 'deleted' AND `thumb` != 'spoiler' UNION ALL ", $_board['uri'], $_board['uri']);
}
$query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_images'], $query);
$query = query($query) or error(db_error());
- while($post = $query->fetch()) {
+ while ($post = $query->fetch()) {
openBoard($post['board']);
// board settings won't be available in the template file, so generate links now
@@ -58,15 +58,15 @@
$query = '';
- foreach($boards as &$_board) {
- if(in_array($_board['uri'], $this->excluded))
+ 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 ' . (int)$settings['limit_posts'], $query);
$query = query($query) or error(db_error());
- while($post = $query->fetch()) {
+ while ($post = $query->fetch()) {
openBoard($post['board']);
$post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
@@ -78,8 +78,8 @@
// Total posts
$query = 'SELECT SUM(`top`) AS `count` FROM (';
- foreach($boards as &$_board) {
- if(in_array($_board['uri'], $this->excluded))
+ 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']);
}
@@ -90,8 +90,8 @@
// Unique IPs
$query = 'SELECT COUNT(DISTINCT(`ip`)) AS `count` FROM (';
- foreach($boards as &$_board) {
- if(in_array($_board['uri'], $this->excluded))
+ foreach ($boards as &$_board) {
+ if (in_array($_board['uri'], $this->excluded))
continue;
$query .= sprintf("SELECT `ip` FROM `posts_%s` UNION ALL ", $_board['uri']);
}
@@ -102,8 +102,8 @@
// Active content
$query = 'SELECT SUM(`filesize`) AS `count` FROM (';
- foreach($boards as &$_board) {
- if(in_array($_board['uri'], $this->excluded))
+ foreach ($boards as &$_board) {
+ if (in_array($_board['uri'], $this->excluded))
continue;
$query .= sprintf("SELECT `filesize` FROM `posts_%s` UNION ALL ", $_board['uri']);
}