Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25901
Modified Files:
index.php
Log Message:
- Simplyfy and clean the index.php area regarding index.php and categories *A LOT*
- Show title of selected category in header
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- index.php 3 Dec 2004 10:07:37 -0000 1.62
+++ index.php 10 Dec 2004 19:58:00 -0000 1.63
@@ -188,36 +188,18 @@
} else if (preg_match(PAT_PLUGIN, $uri, $matches)) {
serendipity_plugin_api::hook_event('external_plugin', $matches[1]);
exit;
-} else if (preg_match(PAT_CATEGORIES, $uri, $matches) ||
- preg_match('@/(index(\.php|\.html)?)|'. preg_quote($serendipity['indexFile']) .'@', $uri) ||
- preg_match('@^/' . preg_quote(trim($serendipity['serendipityHTTPPath'], '/')) . '/?(\?.*)?$@', $uri)) {
-
- if (count($serendipity['GET']) == 2) {
- if (isset($matches) && is_array($matches) && isset($matches[1])) {
- $serendipity['GET']['category'] = $matches[1];
- }
+} else if (preg_match(PAT_CATEGORIES, $uri, $matches)) {
+ $serendipity['GET']['category'] = $matches[1];
+ $serendipity['GET']['action'] = 'read';
+ $cInfo = serendipity_fetchCategoryInfo($serendipity['GET']['category']);
+ $serendipity['head_title'] = $cInfo['category_name'];
+ $serendipity['head_subtitle'] = $serendipity['blogTitle'];
- ob_start();
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
- $data = ob_get_contents();
- ob_end_clean();
- if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
- $fp = fopen($serendipity['serendipityPath'] . 'index.html', 'w');
- fwrite($fp, $data);
- fclose($fp);
- }
- print $data;
- } else {
- if (isset($matches) && is_array($matches) && isset($matches[1])) {
- $serendipity['GET']['category'] = $matches[1];
- }
+} else if (preg_match('@/(index(\.php|\.html)?)|'. preg_quote($serendipity['indexFile']) .'@', $uri) ||
+ preg_match('@^/' . preg_quote(trim($serendipity['serendipityHTTPPath'], '/')) . '/?(\?.*)?$@', $uri)) {
- if (isset($serendipity['GET']['calendarZoom'])) {
- $serendipity['GET']['action'] = 'read';
- $serendipity['GET']['range'] = $serendipity['GET']['calendarZoom'];
- }
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
- }
} else {
header('HTTP/1.0 404 Not found');
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
|