Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv18579
Modified Files:
comment.php serendipity_admin.php
serendipity_functions.inc.php serendipity_genpage.inc.php
serendipity_lang_de.inc.php serendipity_sidebar_items.php
serendipity_xmlrpc.php
Log Message:
Patch to allow usage without ErrorDocument and mod_rewrite
(modified version of Craig O'Shannessy's patch)
Index: comment.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/comment.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- comment.php 13 Oct 2003 12:15:08 -0000 1.24
+++ comment.php 6 Jan 2004 10:11:39 -0000 1.25
@@ -73,6 +73,7 @@
$query = 'SELECT title FROM ' . $serendipity['dbPrefix'] . 'entries WHERE id = ' . $serendipity['GET']['entry_id'];
$entry = serendipity_db_query($query);
$entry = $serendipity['baseURL']
+ . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '')
. 'archives/'
. $serendipity['GET']['entry_id']
. '_' . serendipity_makeFilename($entry[0]['title']) . '.html';
Index: serendipity_admin.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- serendipity_admin.php 4 Jan 2004 02:30:47 -0000 1.23
+++ serendipity_admin.php 6 Jan 2004 10:11:44 -0000 1.24
@@ -66,7 +66,7 @@
</div>
<div class="serendipitySideBarContent">
- • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>entries"><?php echo AUTHOR_SUITE; ?></a><br />
+ • <a href="<?php echo $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : ''); ?>entries"><?php echo AUTHOR_SUITE; ?></a><br />
• <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>"><?php echo BACK_TO_BLOG; ?></a><br />
• <a href="?serendipity[adminModule]=logout"><?php echo LOGOUT; ?></a><br />
</div>
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -d -r1.173 -r1.174
--- serendipity_functions.inc.php 4 Jan 2004 02:30:47 -0000 1.173
+++ serendipity_functions.inc.php 6 Jan 2004 10:11:44 -0000 1.174
@@ -63,7 +63,7 @@
<td><?php echo PASSWORD ?></td><td><input type="password" name="serendipity[pass]" /></td>
</tr>
<tr>
- <td colspan="2"><input type="checkbox" name="serendipity[auto]" /> <?php echo AUTOMATIC_LOGIN ?></td>
+ <td colspan="2"><input id="autologin" type="checkbox" name="serendipity[auto]" /><label for="autologin"> <?php echo AUTOMATIC_LOGIN ?></label></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="submit" value="<?php echo LOGIN ?> >" /></td>
@@ -328,11 +328,7 @@
}
// Prepare the table
- if ($serendipity['rewrite'] == true) {
- $link = $serendipity['serendipityHTTPPath'] . 'archives/' . $year . sprintf('%02d', $month) . '.html?' . $base_query;
- } else {
- $link = 'fixme';
- }
+ $link = $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'archives/' . $year . sprintf('%02d', $month) . '.html?' . $base_query;
?>
<table width="100%" class="serendipity_calendar" cellspacing="1">
<tr>
@@ -408,11 +404,7 @@
}
// Print day
- if ($serendipity['rewrite'] == true) {
- $link = $serendipity['serendipityHTTPPath'] . 'archives/' . date('Ymd', mktime(0,0,0, $month, $currDay, $year)) . '.html?' . $base_query;
- } else {
- $link = 'fixme!';
- }
+ $link = $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'archives/' . date('Ymd', mktime(0,0,0, $month, $currDay, $year)) . '.html?' . $base_query;
if (date('m') == $month
&& date('Y') == $year
@@ -748,7 +740,7 @@
<div class='serendipity_entryFooter'>
<?php
- echo ' ' . POSTED_BY . ' ' . htmlentities($entry['username']) . ($entry['category_name'] ? ' ' . IN . ' <a href="' . $serendipity['serendipityHTTPPath'] . 'categories/' . $entry['categoryid'] . '_' . serendipity_makeFilename($entry['category_name']) . '">' . $entry['category_name'] . '</a> ' : ' ') . AT . ' <a href="' . $entryLink . '">' . date('H:i', $entry['timestamp']) . '</a>'. "\n";
+ echo ' ' . POSTED_BY . ' ' . htmlentities($entry['username']) . ($entry['category_name'] ? ' ' . IN . ' <a href="' . $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'categories/' . $entry['categoryid'] . '_' . serendipity_makeFilename($entry['category_name']) . '">' . $entry['category_name'] . '</a> ' : ' ') . AT . ' <a href="' . $entryLink . '">' . date('H:i', $entry['timestamp']) . '</a>'. "\n";
if ($entry['allow_comments'] === true || $entry['allow_comments'] == 'true' || !isset($entry['allow_comments']) || $entry['comments'] > 0) {
if (!isset($serendipity['GET']['id'])) {
@@ -773,7 +765,7 @@
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
- rdf:about="<?php echo $serendipity['baseURL']; ?>feeds/ei_<?php echo $entry['id']; ?>.rdf"
+ rdf:about="<?php echo $serendipity['baseURL'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : ''); ?>feeds/ei_<?php echo $entry['id']; ?>.rdf"
trackback:ping="<?php echo $serendipity['baseURL']; ?>comment.php?type=trackback&entry_id=<?php echo $entry['id']; ?>"
dc:title="<?php echo $entry['title']; ?>"
dc:identifier="<?php echo serendipity_archiveURL($entry['id'], $entry['title']); ?>" />
@@ -1117,7 +1109,7 @@
$title,
$poster,
$entryURI,
- $serendipity['baseURL'] .'unsubscribe/'. urlencode($subscriber['email']) .'/'. $entry_id
+ $serendipity['baseURL'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'unsubscribe/' . urlencode($subscriber['email']) . '/' . $entry_id
);
} else {
$text = sprintf(
@@ -1128,7 +1120,7 @@
$title,
$poster,
$entryURI,
- $serendipity['baseURL'] .'unsubscribe/'. urlencode($subscriber['email']) .'/'. $entry_id
+ $serendipity['baseURL'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'unsubscribe/' . urlencode($subscriber['email']) . '/' . $entry_id
);
}
@@ -1689,7 +1681,7 @@
function serendipity_archiveURL($id, $title, $key = 'baseURL') {
global $serendipity;
- return $serendipity[$key] . 'archives/' . $id . '_' . serendipity_makeFilename($title) . '.html';
+ return $serendipity[$key] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'archives/' . $id . '_' . serendipity_makeFilename($title) . '.html';
}
/**
@@ -2435,10 +2427,10 @@
for($x=1; $x<13; $x++) {
$entries = serendipity_postAmount($currYear, $x);
if ($entries > 0) {
- $a = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '.html\'>';
+ $a = "<a href='{$serendipity['serendipityHTTPPath']}" . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . "archives/$currYear" . sprintf('%02s', $x) . '.html\'>';
$b = '</a>';
- $c = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '_short.html\'>';
- $d = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '.html\'>';
+ $c = "<a href='{$serendipity['serendipityHTTPPath']}" . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . "archives/$currYear" . sprintf('%02s', $x) . '_short.html\'>';
+ $d = "<a href='{$serendipity['serendipityHTTPPath']}" . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . "archives/$currYear" . sprintf('%02s', $x) . '.html\'>';
} else {
$a = $c = '<span style="color: #CDCDCD">';
$b = $d = '</span>';
Index: serendipity_genpage.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- serendipity_genpage.inc.php 11 Nov 2003 16:17:05 -0000 1.20
+++ serendipity_genpage.inc.php 6 Jan 2004 10:11:44 -0000 1.21
@@ -18,7 +18,7 @@
<title><?php echo htmlentities($serendipity['blogTitle']); ?></title>
<meta name="Powered-By" content="Serendipity v.<?php echo $serendipity['version'] ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" />
- <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL']; ?>feeds/index.rss" />
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : ''); ?>feeds/index.rss" />
<script language="Javascript" type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.js"></script>
<?php
if (strtolower($serendipity['extCSS'])!='none') {
Index: serendipity_lang_de.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- serendipity_lang_de.inc.php 23 Dec 2003 08:48:21 -0000 1.36
+++ serendipity_lang_de.inc.php 6 Jan 2004 10:11:44 -0000 1.37
@@ -299,6 +299,7 @@
@define('ALL_CATEGORIES', 'Alle Kategorien');
@define('NO_MARKUP', 'Keine Änderung der Textformatierung');
@define('NO_MARKUP_DESCRIPTION', 'Keine Textformatierung durchführen, wie z.B. Smilies, Schnellformatierung via *, /, _, ...). Dadurch wird jeglicher eingegebener HTML-Code beibehalten.');
+@define('AUTOMATIC_LOGIN', 'Daten speichern');
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- serendipity_sidebar_items.php 23 Dec 2003 08:48:21 -0000 1.33
+++ serendipity_sidebar_items.php 6 Jan 2004 10:11:45 -0000 1.34
@@ -77,11 +77,7 @@
for($x = 0; $x < 3; $x++) {
$ts -= 1;
- if ($serendipity['rewrite'] === true) {
- $link = $serendipity['serendipityHTTPPath'] . 'archives/' . date('Ym', $ts) . '.html';
- } else {
- $link = 'fixme';
- }
+ $link = $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'archives/' . date('Ym', $ts) . '.html';
$ts_title = $serendipity['months'][date('n', $ts)] . ' ' . date('Y', $ts);
@@ -91,7 +87,7 @@
}
echo "<a href='{$serendipity['serendipityHTTPPath']}'>" . RECENT . "</a><br />\n";
- echo "<a href='{$serendipity['serendipityHTTPPath']}archive'>" . OLDER . "</a>\n";
+ echo "<a href='{$serendipity['serendipityHTTPPath']}" . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . "archive'>" . OLDER . "</a>\n";
}
}
@@ -343,7 +339,7 @@
global $serendipity;
$title = SUPERUSER . ':';
- echo "<a href=\"{$serendipity['serendipityHTTPPath']}entries\" title=\"$title\">\$ su -</a>";
+ echo "<a href=\"{$serendipity['serendipityHTTPPath']}" . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . "entries\" title=\"$title\">\$ su -</a>";
}
}
@@ -468,7 +464,7 @@
$serendipity['serendipityHTTPPath'] . 'rss.php?category=' . $category['categoryid'] . '_' . $category_id,
htmlentities($category['category_description']),
$serendipity['serendipityHTTPPath'] . 'xml.gif',
- $serendipity['serendipityHTTPPath'] . 'categories/' . $category['categoryid'] . '_' . $category_id,
+ $serendipity['serendipityHTTPPath'] . (!$serendipity['rewrite'] ? $serendipity['indexFile'] . '?/' : '') . 'categories/' . $category['categoryid'] . '_' . $category_id,
htmlentities($category['category_description']),
$category['category_name']
);
Index: serendipity_xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_xmlrpc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- serendipity_xmlrpc.php 26 Oct 2003 16:47:43 -0000 1.11
+++ serendipity_xmlrpc.php 6 Jan 2004 10:11:45 -0000 1.12
@@ -250,8 +250,8 @@
'mt_convert_breaks' => new XML_RPC_Value('', 'string'),
'mt_keywords' => new XML_RPC_Value('', 'string'),
'title' => new XML_RPC_Value($entry['title'],'string'),
- 'permalink' => new XML_RPC_Value($serendipity['baseURL'] . '/archives/' . $postid . '_.html', 'string'),
- 'link' => new XML_RPC_Value($serendipity['baseURL'] . '/archives/' . $postid . '_.html', 'string'));
+ 'permalink' => new XML_RPC_Value($serendipity['baseURL'] . (!$serendipity['rewrite'] ? '/' . $serendipity['indexFile'] . '?' : '') . '/archives/' . $postid . '_.html', 'string'),
+ 'link' => new XML_RPC_Value($serendipity['baseURL'] . (!$serendipity['rewrite'] ? '/' . $serendipity['indexFile'] . '?' : '') . '/archives/' . $postid . '_.html', 'string'));
$entry = new XML_RPC_Value($tmp, 'struct');
return new XML_RPC_Response($entry);
}
|