Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12245
Modified Files:
index.php rss.php serendipity_config.inc.php
Log Message:
- Use pretty URIs when linking to category RSS
PS: Waiting with version bump
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- serendipity_config.inc.php 3 Jan 2005 12:14:24 -0000 1.126
+++ serendipity_config.inc.php 3 Jan 2005 18:03:39 -0000 1.127
@@ -119,6 +119,7 @@
@define('PERM_ARCHIVES', '%id%-%title%.html');
@define('PERM_CATEGORIES', '%id%-%title%');
@define('PERM_AUTHORS', '%id%-%title%');
+@define('PERM_FEEDS_CATEGORIES', '%id%-%title%.rss');
/* URI patterns
* Note that it's important to use @ as the pattern delimiter. DO NOT use shortcuts
@@ -132,6 +133,7 @@
@define('PAT_AUTHORS', '@/'.PATH_AUTHORS.'/([0-9]+)@');
@define('PAT_COMMENTSUB', '@/([0-9]+)[_\-]([' . PAT_FILENAME . ']*)\.html@i');
@define('PAT_FEEDS', '@/'.PATH_FEEDS.'/@');
+@define('PAT_FEEDS_CATEGORIES', '@/'.PATH_FEEDS.'\/'. PATH_CATEGORIES .'/([0-9]+)@');
@define('PAT_FEED', '@/(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$@');
@define('PAT_ADMIN', '@/(' . PATH_ADMIN . '|'. PATH_ENTRIES .')(/.+)?@');
@define('PAT_ARCHIVE', '@/'.PATH_ARCHIVE.'$@');
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- index.php 22 Dec 2004 17:44:51 -0000 1.68
+++ index.php 3 Jan 2005 18:03:39 -0000 1.69
@@ -188,9 +188,16 @@
fclose($fp);
}
print $data;
-} elseif (preg_match(PAT_FEEDS, $uri) && preg_match('@/(index|atom|rss|comments|opml)\.(rss[0-9]?|rdf|rss|xml|atom)$@', $uri, $matches)) {
+} elseif (preg_match(PAT_FEEDS, $uri)) {
header('Content-Type: text/html; charset=utf-8');
- list($_GET['version'], $_GET['type']) = serendipity_discover_rss($matches[1], $matches[2]);
+
+ if (preg_match('@/(index|atom|rss|comments|opml)\.(rss[0-9]?|rdf|rss|xml|atom)$@', $uri, $matches)) {
+ list($_GET['version'], $_GET['type']) = serendipity_discover_rss($matches[1], $matches[2]);
+ }
+
+ if (preg_match(PAT_FEEDS_CATEGORIES, $uri, $matches)) {
+ $_GET['category'] = $matches[1];
+ }
ob_start();
include_once(S9Y_INCLUDE_PATH . 'rss.php');
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- rss.php 20 Dec 2004 13:48:29 -0000 1.37
+++ rss.php 3 Jan 2005 18:03:39 -0000 1.38
@@ -79,9 +79,8 @@
}
if (!empty($serendipity['GET']['category'])) {
- $category = split('_', $serendipity['GET']['category'], 2);
- $category = $category[1];
- $title = serendipity_utf8_encode(htmlspecialchars("$category - $title"));
+ $cInfo = serendipity_fetchCategoryInfo((int)$serendipity['GET']['category']);
+ $title = serendipity_utf8_encode(htmlspecialchars($title . ' - '. $cInfo['category_name']));
} else {
$title = serendipity_utf8_encode(htmlspecialchars($title));
}
|