* Fix permalink patterns for some cases to properly detect pagination variables instead of interpreting search words as those (garvinhicking)

This commit is contained in:
Garvin Hicking 2007-03-11 12:50:42 +00:00
parent 9d6e2b8a97
commit 88188ee8e3
2 changed files with 36 additions and 21 deletions

View File

@ -3,6 +3,10 @@
Version 1.2 ()
------------------------------------------------------------------------
* Fix permalink patterns for some cases to properly detect
pagination variables instead of interpreting search words
as those (garvinhicking)
* Improve performance of displaying the complete archive. Instead
of year*months SQL queries, only one query is now used.
(garvinhicking)

View File

@ -107,8 +107,11 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
unset($_args[$k]);
}
} elseif ($v{0} == 'A') { /* Author */
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
$url_author = substr($v, 1);
if (is_numeric($url_author)) {
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)$url_author;
unset($_args[$k]);
}
} elseif ($v{0} == 'W') { /* Week */
$week = substr($v, 1);
if (is_numeric($week)) {
@ -351,10 +354,13 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
unset($_args[$k]);
}
} elseif ($v{0} == 'A') { /* Author */
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
$url_author = substr($v, 1);
if (is_numeric($url_author)) {
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)$url_author;
unset($_args[$k]);
}
}
}
include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if (preg_match(PAT_PLUGIN, $uri, $matches)) {
@ -392,10 +398,13 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
unset($serendipity['uriArguments'][$k]);
}
} elseif ($v{0} == 'A') { /* Author */
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)substr($v, 1);
$url_author = substr($v, 1);
if (is_numeric($url_author)) {
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)$url_author;
unset($_args[$k]);
}
}
}
if (!$is_multicat) {
$matches[1] = serendipity_searchPermalink($serendipity['permalinkCategoryStructure'], implode('/', $_args), $matches[1], 'category');
@ -463,6 +472,8 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
$serendipity['GET']['page'] = $page;
unset($_args[$k]);
unset($serendipity['uriArguments'][$k]);
} else {
$search[] = $v;
}
} else {
$search[] = $v;