From 1283e51ca50c9085a0f1b763fa4928c91b7c8e69 Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Thu, 19 Mar 2015 21:49:57 -0400 Subject: [PATCH 1/3] Fixed and re-enabled active content stat for recent theme --- templates/themes/recent/theme.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 2ea6a7b9..9307c6a9 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -125,15 +125,18 @@ $stats['unique_posters'] = number_format($query->fetchColumn()); // Active content - /*$query = 'SELECT SUM(`filesize`) FROM ('; + $query = 'SELECT `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) + $stats['active_content'] += intval(preg_replace('/.*"size":([0-9]*).*/', '$1', $file[0])); return Element('themes/recent/recent.html', Array( 'settings' => $settings, From 034b288a1317a940c3a5722c6d2864d1ea08f5db Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Fri, 20 Mar 2015 09:47:40 -0400 Subject: [PATCH 2/3] Fixed to work with multiple images --- templates/themes/recent/theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 9307c6a9..ce64c80e 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -125,7 +125,7 @@ $stats['unique_posters'] = number_format($query->fetchColumn()); // Active content - $query = 'SELECT `files` FROM ('; + $query = 'SELECT DISTINCT(`files`) FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; @@ -135,8 +135,10 @@ $query = query($query) or error(db_error()); $files = $query->fetchAll(); $stats['active_content'] = 0; - foreach ($files as &$file) - $stats['active_content'] += intval(preg_replace('/.*"size":([0-9]*).*/', '$1', $file[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, From 25c2a18a71e76bc70b0b04e3e7e3aaa3738a623d Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Sun, 29 Mar 2015 22:31:38 -0400 Subject: [PATCH 3/3] Made quick-reply box resizable horizontally --- js/quick-reply.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;\