summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2015-03-30 06:27:05 +0200
committerczaks <marcin@6irc.net>2015-03-30 06:27:05 +0200
commit8f30b02c977548a855acc70d9bd2ed3fb976522b (patch)
treed9c4343d60a5fe4f97e642cbe37b1c556570b63d
parent5d8e023fc4ba7692eb81bf690c8a04dac9d561ee (diff)
parentcdac85bb2bf40c6d4caaf2725f0c40d6b0865cb2 (diff)
Merge branch 'master' of github.com:vichan-devel/Tinyboard
-rw-r--r--js/quick-reply.js3
-rw-r--r--templates/themes/recent/theme.php13
2 files changed, 11 insertions, 5 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js
index 07fe4aef..6661501c 100644
--- a/js/quick-reply.js
+++ b/js/quick-reply.js
@@ -83,11 +83,12 @@
}\
#quick-reply textarea {\
width: 100%;\
+ min-width: 100%;\
box-sizing: border-box;\
-webkit-box-sizing:border-box;\
-moz-box-sizing: border-box;\
font-size: 10pt;\
- resize: vertical;\
+ resize: vertical horizontal;\
}\
#quick-reply input, #quick-reply select, #quick-reply textarea {\
margin: 0 0 1px 0;\
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index 2ea6a7b9..ce64c80e 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -125,15 +125,20 @@
$stats['unique_posters'] = number_format($query->fetchColumn());
// Active content
- /*$query = 'SELECT SUM(`filesize`) FROM (';
+ $query = 'SELECT DISTINCT(`files`) 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 .= sprintf("SELECT `files` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
}
- $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query);
+ $query = preg_replace('/UNION ALL $/', ' WHERE `num_files` > 0) AS `posts_all`', $query);
$query = query($query) or error(db_error());
- $stats['active_content'] = $query->fetchColumn();*/
+ $files = $query->fetchAll();
+ $stats['active_content'] = 0;
+ foreach ($files as &$file) {
+ preg_match_all('/"size":([0-9]*)/', $file[0], $matches);
+ $stats['active_content'] += array_sum($matches[1]);
+ }
return Element('themes/recent/recent.html', Array(
'settings' => $settings,