Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438
Modified Files:
index.php serendipity_config.inc.php
Log Message:
- Add ability to see all entries made by a single user
- Groundwork for dynamic URIs
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- serendipity_config.inc.php 20 Dec 2004 11:46:37 -0000 1.119
+++ serendipity_config.inc.php 22 Dec 2004 17:44:51 -0000 1.120
@@ -16,7 +16,7 @@
include_once(S9Y_INCLUDE_PATH . 'include/compat.inc.php');
// The version string
-$serendipity['version'] = '0.8-alpha8';
+$serendipity['version'] = '0.8-alpha9';
// Name of folder for the default theme
$serendipity['defaultTemplate'] = 'default';
@@ -101,6 +101,7 @@
*/
@define('PATH_ARCHIVES', 'archives');
@define('PATH_ARCHIVE', 'archive');
+@define('PATH_AUTHORS', 'authors');
@define('PATH_UNSUBSCRIBE', 'unsubscribe');
@define('PATH_DELETE', 'delete');
@define('PATH_APPROVE', 'approve');
@@ -108,9 +109,15 @@
@define('PATH_CATEGORIES', 'categories');
@define('PATH_PLUGIN', 'plugin');
@define('PATH_ADMIN', 'admin');
-@define('PATH_AUTHOR', 'author');
+@define('PATH_ENTRIES', 'entries');
@define('PATH_SMARTY_COMPILE', 'templates_c'); // will be placed inside the template directory
+
+/* Changing this is NOT recommended, rewrite rules does not take them into account - yet */
+@define('PERM_ARCHIVES', '%id%-%title%.html');
+@define('PERM_CATEGORIES', '%id%-%title%');
+@define('PERM_AUTHORS', '%id%-%title%');
+
/* URI patterns
* Note that it's important to use @ as the pattern delimiter. DO NOT use shortcuts
* like \d or \s, since mod_rewrite will use the regexps as well and chokes on them.
@@ -120,10 +127,11 @@
@define('PAT_APPROVE', '@/'.PATH_APPROVE.'/(.*)/(.*)/([0-9]+)@');
@define('PAT_DELETE', '@/'.PATH_DELETE.'/(.*)/(.*)/([0-9]+)@');
@define('PAT_ARCHIVES', '@/'.PATH_ARCHIVES.'([/A-Za-z0-9]+)\.html@');
+@define('PAT_AUTHORS', '@/'.PATH_AUTHORS.'/([0-9]+)@');
@define('PAT_COMMENTSUB', '@/([0-9]+)[_\-][' . PAT_FILENAME . ']*\.html@i');
@define('PAT_FEEDS', '@/'.PATH_FEEDS.'/@');
@define('PAT_FEED', '@/(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$@');
-@define('PAT_ADMIN', '@/(' . PATH_ADMIN . '|' . PATH_AUTHOR . ')(/.+)?@');
+@define('PAT_ADMIN', '@/(' . PATH_ADMIN . '|'. PATH_ENTRIES .')(/.+)?@');
@define('PAT_ARCHIVE', '@/'.PATH_ARCHIVE.'$@');
@define('PAT_CATEGORIES', '@/'.PATH_CATEGORIES.'/([0-9]+)@');
@define('PAT_PLUGIN', '@/' . PATH_PLUGIN . '/(.*)@');
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- index.php 20 Dec 2004 17:48:25 -0000 1.67
+++ index.php 22 Dec 2004 17:44:51 -0000 1.68
@@ -238,6 +238,15 @@
$serendipity['head_subtitle'] = $serendipity['blogTitle'];
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+} else if (preg_match(PAT_AUTHORS, $uri, $matches)) {
+ $serendipity['GET']['viewAuthor'] = $matches[1];
+ $serendipity['GET']['action'] = 'read';
+
+ $uInfo = serendipity_fetchUsers($serendipity['viewAuthor']);
+ $serendipity['head_title'] = sprintf(ENTRIES_BY, $uInfo[0]['username']);
+ $serendipity['head_subtitle'] = $serendipity['blogTitle'];
+
+ include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if (preg_match('@/(index(\.php|\.html)?)|'. preg_quote($serendipity['indexFile']) .'@', $uri) ||
preg_match('@^/' . preg_quote(trim($serendipity['serendipityHTTPPath'], '/')) . '/?(\?.*)?$@', $uri)) {
$serendipity['uriArguments'][] = PATH_ARCHIVES;
|