Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16299
Modified Files:
index.php serendipity_functions.inc.php
Log Message:
Fix more pagination issues:
* When restricted to a 'range' the index.php would no langer recognize a
matched page because the URI does not match the regex
* Appending of a category was done with '?&' instead of '&' only
* Hide pagination footer for search results, fixed false if-condition for
hidden footer
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.400
retrieving revision 1.401
diff -u -d -r1.400 -r1.401
--- serendipity_functions.inc.php 20 Aug 2004 10:55:32 -0000 1.400
+++ serendipity_functions.inc.php 21 Aug 2004 12:38:20 -0000 1.401
@@ -421,7 +421,7 @@
$categoryid = serendipity_db_escape_string($_categoryid[0]);
if (is_numeric($categoryid)) {
- $base_query = '?serendipity[category]=' . $categoryid;
+ $base_query = 'serendipity[category]=' . $categoryid;
$add_query = '&' . $base_query;
$querystring = "SELECT timestamp
FROM {$serendipity['dbPrefix']}entries e,
@@ -962,6 +962,7 @@
ORDER BY
timestamp DESC";
+ $serendipity['hidefooter'] = true;
return serendipity_db_query($querystring);
}
@@ -1079,7 +1080,12 @@
$add_query = '';
if (is_array($serendipity['GET'])) {
$page_get_array = $serendipity['GET'];
- unset($page_get_array['range']);
+ if ((isset($serendipity['GET']['calendarZoom']) && isset($serendipity['GET']['range']) && $serendipity['GET']['calendarZoom'] == $serendipity['GET']['range'])
+ || (!isset($serendipity['GET']['calendarZoom']) && $serendipity['GET']['action'] != 'read')) {
+ // The 'range' variable is always set by the layout.php, even if we didn't specify one. But to still be able to paginate through ALL entries, we need to not propagate this variable in special cases where s9y automatically sets the 'range' variable.
+ unset($page_get_array['range']);
+ }
+
unset($page_get_array['page']);
unset($page_get_array['action']);
unset($page_get_array['adminAction']);
@@ -1380,8 +1386,8 @@
} // end for-loop (dates)
if (!isset($serendipity['GET']['id']) &&
- (!isset($serendipity['GET']['hidefooter']) || $serendipity['GET']['hidefooter'] == false &&
- count($entries) <= (!empty($serendipity['fetchLimit']) ? $serendipity['fetchLimit'] : 15))) {
+ (!isset($serendipity['GET']['hidefooter']) || $serendipity['GET']['hidefooter'] == false) &&
+ (count($entries) <= (!empty($serendipity['fetchLimit']) ? $serendipity['fetchLimit'] : 15))) {
serendipity_printEntryFooter();
} else {
serendipity_printEntryFooter(true);
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- index.php 28 Jul 2004 08:18:31 -0000 1.46
+++ index.php 21 Aug 2004 12:38:20 -0000 1.47
@@ -39,11 +39,14 @@
}
-if (preg_match(PAT_ARCHIVES, $uri, $matches)) {
- $range = $matches[1];
+if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range']) && is_numeric($serendipity['GET']['range'])) {
+ if (!empty($serendipity['GET']['range'])) {
+ $range = $serendipity['GET']['range'];
+ } else {
+ $range = $matches[1];
+ }
$_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['range'] = $range;
- $_GET['serendipity']['hidefooter'] = true;
if (strlen($range) == 6) {
$date = serendipity_formatTime('%B %Y', mktime(0, 0, 0, substr($range, 4, 6), 2, substr($range, 0, 4)));
|