diff options
| author | Jason Puglisi <jason@puglisi.im> | 2015-03-20 09:47:40 -0400 |
|---|---|---|
| committer | Jason Puglisi <jason@puglisi.im> | 2015-03-20 09:47:40 -0400 |
| commit | 034b288a1317a940c3a5722c6d2864d1ea08f5db (patch) | |
| tree | 9f241bf478e0beeb7fb33350677c2c7d9f40634b /templates | |
| parent | 1283e51ca50c9085a0f1b763fa4928c91b7c8e69 (diff) | |
Fixed to work with multiple images
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/themes/recent/theme.php | 8 |
1 files 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, |
