Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv16591
Modified Files:
NEWS compat.php index.php rss.php
Log Message:
Commited patch as proposed on the mailinglist
(Part 1/5)
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- NEWS 8 Sep 2003 21:29:57 -0000 1.23
+++ NEWS 18 Sep 2003 12:57:46 -0000 1.24
@@ -2,6 +2,15 @@
Version 0.3 ()
------------------------------------
+ * Made XHTML-compatibility fix to radio buttons of the installer (garvinhicking)
+ * Browse categories (on multiple pages) and have per-category RSS-feed (garvinhicking+sbergmann)
+ * Fixed display of category in full article (garvinhicking)
+ * Display all config options in installer when s9y is first installed (garvinhicking)
+ * Added select-dropdown configuration directive for the plugins (garvinhicking)
+ * Prepended language defines with a '@' to suppress error messages for fallback-language (garvinhicking)
+ * Fixed search results not displaying all content (garvinhicking)
+ * Fixed some undefined indexes/constants (garvinhicking)
+ * Support manual editing of the publish date on articles, can be disallowed via $serendipity['allowDateManipulation'] (garvinhicking)
* Added SQL upgrade files from 0.2 to 0.3 (troutgirl)
* Fixed a number of bugs with language detection and display during installation (tomsommer)
* Fixed bug for fetching entries on a certain date. Now s9y dies with an error message if MySQL errors occur (garvinhicking)
Index: compat.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/compat.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- compat.php 8 Jul 2003 09:13:27 -0000 1.4
+++ compat.php 18 Sep 2003 12:57:46 -0000 1.5
@@ -12,23 +12,23 @@
}
}
-if (!$_POST) {
+if (!isset($_POST)) {
$_POST = &$HTTP_POST_VARS;
}
-if (!$_GET) {
+if (!isset($_GET)) {
$_GET = &$HTTP_GET_VARS;
}
-if (!$_SESSION) {
+if (!isset($_SESSION)) {
$_SESSION = &$HTTP_SESSION_VARS;
}
-if (!$_COOKIE) {
+if (!isset($_COOKIE)) {
$_COOKIE = &$HTTP_COOKIE_VARS;
}
-if (!$_SERVER) {
+if (!isset($_SERVER)) {
$_SERVER = &$HTTP_SERVER_VARS;
}
/* vim: set sts=4 ts=4 expandtab : */
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- index.php 17 Aug 2003 18:06:03 -0000 1.26
+++ index.php 18 Sep 2003 12:57:46 -0000 1.27
@@ -10,28 +10,28 @@
if (preg_match('@/unsubscribe/(.*)/([0-9]+)@', $uri, $res)) {
serendipity_cancelSubscription(urldecode($res[1]), $res[2]);
$uri = '/archives/'. $res[2] .'_untitled.html';
-}
+}
if (preg_match('@/archives/(\d+)\.html@', $uri, $matches)) {
header('Content-Type: text/html; charset=ISO-8859-1');
- $range = $matches[1];
- $_GET['serendipity']['action'] = 'read';
- $_GET['serendipity']['range'] = $range;
-
+ $range = $matches[1];
+ $_GET['serendipity']['action'] = 'read';
+ $_GET['serendipity']['range'] = $range;
+ $_GET['serendipity']['hidefooter'] = true;
if (strlen($range) == 6) {
$date = date('m/Y', mktime(0, 0, 0, substr($range, 4, 6), 2, substr($range, 0, 4)));
} else {
$date = date('d/m/Y', strtotime($range));
}
-
+
$serendipity['blogSubTitle'] = sprintf(ENTRIES_FOR, $date);
ob_start();
include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
- if ($serendipity['pregenerate']) {
+ if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
$fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
@@ -57,7 +57,7 @@
$data = ob_get_contents();
ob_end_clean();
- if ($serendipity['pregenerate']) {
+ if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
$fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
@@ -85,7 +85,7 @@
$data = ob_get_contents();
ob_end_clean();
- if ($serendipity['pregenerate']) {
+ if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
$fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
@@ -129,20 +129,32 @@
header('Content-Type: text/html; charset=ISO-8859-1');
$serendipity['GET']['action'] = 'archives';
include_once('serendipity_genpage.inc.php');
-} else if (preg_match('@/(index\.(php|html))?@', $uri) || preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')?@')) {
+} else if (preg_match('@/categories/(.*)@', $uri, $matches) ||
+ preg_match('@/(index\.(php|html))?@', $uri) ||
+ preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')?@', $uri)) {
+
header('Content-Type: text/html; charset=ISO-8859-1');
+
if (count($serendipity['GET']) == 2) {
+ if (isset($matches) && is_array($matches) && isset($matches[1])) {
+ $serendipity['GET']['category'] = $matches[1];
+ }
+
ob_start();
include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
- if ($serendipity['pregenerate']) {
+ if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
$fp = fopen('./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];
+ }
+
if (isset($serendipity['GET']['calendarZoom'])) {
$serendipity['GET']['action'] = 'read';
$serendipity['GET']['range'] = $serendipity['GET']['calendarZoom'];
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- rss.php 25 Aug 2003 16:43:27 -0000 1.12
+++ rss.php 18 Sep 2003 12:57:46 -0000 1.13
@@ -10,6 +10,14 @@
$description = $serendipity['blogDescription'];
$title = $serendipity['blogTitle'];
$comments = FALSE;
+if (isset($_GET['category'])) {
+ $serendipity['GET']['category'] = $_GET['category'];
+}
+
+if (!isset($_GET['type'])) {
+ $_GET['type'] = 'content';
+}
+
switch ($_GET['type']) {
case 'comments':
$entries = serendipity_fetchComments(null, 15, 'desc');
@@ -19,7 +27,7 @@
break;
case 'content':
default:
- if ($_GET['all']) {
+ if (isset($_GET['all']) && $_GET['all']) {
$entries = serendipity_fetchEntries(null, true);
} else {
$entries = serendipity_fetchEntries(null, true, 15);
|