Version 1.1-alpha7()
------------------------------------------------------------------------
+ * Add new frontend view "Archive by Authors": /archive/Axx.html to
+ view the archive listing for specific authors only (like viewing
+ archive by specific categories only via /archive/Cxx.html etc.)
+ (garvinhicking)
+
* Templating: Add new {$entry.html_title} variable that holds
unescaped HTML code of the Entry's title (garvinhicking)
*
* The archives are created according to the current timestamp and show the current year.
* $serendipity['GET']['category'] is honoured like in serendipity_fetchEntries()
+ * $serendipity['GET']['viewAuthor'] is honoured like in serendipity_fetchEntries()
*
* @access public
* @return null
$cat_get = '';
}
+ if (isset($serendipity['GET']['viewAuthor'])) {
+ $author_get = '/A' . (int)$serendipity['GET']['viewAuthor'];
+ } else {
+ $author_get = '';
+ }
+
$output = array();
for ($y = $thisYear; $y >= $lastYear; $y--) {
$output[$y]['year'] = $y;
AND timestamp >= $s
AND timestamp <= $e "
. (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . time() : '')
- . (!empty($cat_sql) ? ' AND ' . $cat_sql : '') . "
+ . (!empty($cat_sql) ? ' AND ' . $cat_sql : '')
+ . (!empty($serendipity['GET']['viewAuthor']) ? ' AND e.authorid = ' . (int)$serendipity['GET']['viewAuthor'] : '') . "
GROUP BY ec.entryid", false, 'assoc');
if (is_array($entries)) {
$entry_count = count($entries);
$data = array();
$data['entry_count'] = $entry_count;
- $data['link'] = serendipity_archiveDateUrl($y . '/'. sprintf('%02s', $m) . $cat_get);
- $data['link_summary'] = serendipity_archiveDateUrl($y . '/'. sprintf('%02s', $m) . $cat_get, true);
+ $data['link'] = serendipity_archiveDateUrl($y . '/'. sprintf('%02s', $m) . $cat_get . $author_get);
+ $data['link_summary'] = serendipity_archiveDateUrl($y . '/'. sprintf('%02s', $m) . $cat_get . $author_get, true);
$data['date'] = $s;
$output[$y]['months'][] = $data;
}
$serendipity['GET']['category'] = $cat;
unset($_args[$k]);
}
+ } elseif ($v{0} == 'A') { /* Author */
+ $serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
+ unset($_args[$k]);
} elseif ($v{0} == 'W') { /* Week */
$week = substr($v, 1);
if (is_numeric($week)) {
$serendipity['GET']['category'] = $cat;
unset($_args[$k]);
}
+ } elseif ($v{0} == 'A') { /* Author */
+ $serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
+ unset($_args[$k]);
}
}
unset($_args[$k]);
unset($serendipity['uriArguments'][$k]);
}
+ } elseif ($v{0} == 'A') { /* Author */
+ $serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
+ unset($_args[$k]);
}
}