Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv17848
Modified Files:
index.php rss.php search.php serendipity.css
serendipity.css.php
Log Message:
more code style (now commited in some bundled parts ;)
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- index.php 3 Jul 2003 22:15:47 -0000 1.16
+++ index.php 7 Jul 2003 12:41:17 -0000 1.17
@@ -1,68 +1,65 @@
<?php
// We need to set this to return a 200 since we use .htaccess ErrorDocument
// rules to handle archives.
-header("HTTP/1.0 200\r\n");
-include_once("serendipity_config.inc.php");
+header('HTTP/1.0 200\r\n');
+include_once('serendipity_config.inc.php');
$track_referer = true;
$uri = $_SERVER['REQUEST_URI'];
if (preg_match('@/archives/(\d+)\.html@', $uri, $matches)) {
- header("Content-Type: text/html; charset=ISO-8859-1");
+ header('Content-Type: text/html; charset=ISO-8859-1');
$range = $matches[1];
- $_GET['serendipity']['action'] = "read";
+ $_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['range'] = $range;
if (strlen($range) == 6) {
- $date = date("m/Y", mktime(0,0,0, substr($range, 4, 6), 2, substr($range, 0, 4)));
+ $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));
+ $date = date('d/m/Y', strtotime($range));
}
$serendipity['blogSubTitle'] = "Entries for $date";
ob_start();
- include_once("serendipity_genpage.inc.php");
+ include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
if ($serendipity['pregenerate']) {
- $fp = fopen("./archives/{$matches[1]}", "w");
+ $fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
}
echo $data;
-}
-else
-if (preg_match('@/archives/(\d+)_short\.html@', $uri, $matches)) {
- header("Content-Type: text/html; charset=ISO-8859-1");
+} else if (preg_match('@/archives/(\d+)_short\.html@', $uri, $matches)) {
+ header('Content-Type: text/html; charset=ISO-8859-1');
$range = $matches[1];
- $_GET['serendipity']['action'] = "read";
+ $_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['range'] = $range;
- $_GET['serendipity']['short'] = true;
+ $_GET['serendipity']['short'] = true;
if (strlen($range) == 6) {
- $date = date("m/Y", mktime(0,0,0, substr($range, 4, 6), 2, substr($range, 0, 4)));
+ $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));
+ $date = date('d/m/Y', strtotime($range));
}
$serendipity['blogSubTitle'] = "Topics for $date";
ob_start();
- include_once("serendipity_genpage.inc.php");
+ include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
if ($serendipity['pregenerate']) {
- $fp = fopen("./archives/{$matches[1]}", "w");
+ $fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
}
echo $data;
-}
-else if (preg_match('@/(\d+)_\w*\.html@i', $uri, $matches)) {
- header("Content-Type: text/html; charset=ISO-8859-1");
+} else if (preg_match('@/(\d+)_\w*\.html@i', $uri, $matches)) {
+ header('Content-Type: text/html; charset=ISO-8859-1');
$id = $matches[1];
serendipity_track_referrer($id);
@@ -78,18 +75,18 @@
$serendipity['blogTitle'] = htmlspecialchars($title);
ob_start();
- include_once("serendipity_genpage.inc.php");
+ include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
if ($serendipity['pregenerate']) {
- $fp = fopen("./archives/{$matches[1]}", "w");
+ $fp = fopen('./archives/' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
}
print $data;
} else if (preg_match('@/feeds/@', $uri)) {
- header("Content-Type: text/html; charset=utf-8");
+ header('Content-Type: text/html; charset=utf-8');
if (preg_match('@/index.(rss|rdf|rss2)$@', $uri, $matches)) {
switch ($matches[1]) {
case 'rss':
@@ -101,14 +98,14 @@
}
ob_start();
- include_once("rss.php");
+ include_once('rss.php');
$data = ob_get_contents();
ob_end_clean();
$data = ltrim($data);
if ($serendipity['pregenerate']) {
- $fp = fopen("./feeds/index.{$matches[1]}", "w");
+ $fp = fopen('./feeds/index.' . $matches[1], 'w');
fwrite($fp, $data);
fclose($fp);
}
@@ -116,21 +113,20 @@
print $data;
}
} else if (preg_match('@/admin$@', $uri)) {
- header("Location: {$serendipity['serendipityHTTPPath']}serendipity_admin.php");
- exit;
+ header("Location: {$serendipity['serendipityHTTPPath']}serendipity_admin.php");
+ exit;
} else if (preg_match('@/entries$@', $uri)) {
- header("Location: {$serendipity['serendipityHTTPPath']}serendipity_entries.php");
- exit;
-}
-else if (preg_match('@/archive$@', $uri)) {
- header("Content-Type: text/html; charset=ISO-8859-1");
- $serendipity['GET']['action']="archives";
- include_once("serendipity_genpage.inc.php");
+ header("Location: {$serendipity['serendipityHTTPPath']}serendipity_entries.php");
+ exit;
+} else if (preg_match('@/archive$@', $uri)) {
+ 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)) {
- header("Content-Type: text/html; charset=ISO-8859-1");
+ header('Content-Type: text/html; charset=ISO-8859-1');
if (count($serendipity['GET']) == 2) {
ob_start();
- include_once("serendipity_genpage.inc.php");
+ include_once('serendipity_genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
if ($serendipity['pregenerate']) {
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rss.php 3 Jul 2003 22:10:38 -0000 1.4
+++ rss.php 7 Jul 2003 12:41:17 -0000 1.5
@@ -1,18 +1,18 @@
<?php
-header("Content-Type: text/xml");
-include_once("serendipity_config.inc.php");
+header('Content-Type: text/xml');
+include_once('serendipity_config.inc.php');
$version = $_GET['version'];
if (empty($version)) {
$version = '2.0';
}
-$description = $serendipity['blogDescription'];
-$title = $serendipity['blogTitle'];
+$description = $serendipity['blogDescription'];
+$title = $serendipity['blogTitle'];
switch ($type) {
case 'comments':
- $entries = serendipity_fetchComments(null, true, 15);
- $title = $title . ' Comments';
+ $entries = serendipity_fetchComments(null, true, 15);
+ $title = $title . ' Comments';
$description = 'Comments from ' . $description;
break;
case 'content':
Index: search.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/search.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- search.php 25 May 2003 16:36:33 -0000 1.3
+++ search.php 7 Jul 2003 12:41:17 -0000 1.4
@@ -1,5 +1,5 @@
<?php
-include_once("serendipity_config.inc.php");
-include_once("serendipity_genpage.inc.php");
+include_once('serendipity_config.inc.php');
+include_once('serendipity_genpage.inc.php');
?>
Index: serendipity.css
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity.css,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- serendipity.css 28 Mar 2003 20:05:26 -0000 1.1.1.1
+++ serendipity.css 7 Jul 2003 12:41:17 -0000 1.2
@@ -4,7 +4,6 @@
#content {
width: auto;
-
}
#serendipityRightSideBar {
Index: serendipity.css.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- serendipity.css.php 27 Jun 2003 15:01:05 -0000 1.10
+++ serendipity.css.php 7 Jul 2003 12:41:17 -0000 1.11
@@ -1,15 +1,15 @@
<?php
-header("Content-type: text/css");
-if (!@include_once("serendipity_config.inc.php")) {
- readfile('serendipity.css');
-}
-else if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') ."/style.css") ) {
- echo str_replace("{TEMPLATE_PATH}", $serendipity['baseURL']."/templates/".serendipity_get_config_var('template', 'default')."/", file_get_contents($serendipity['templatePath'] . serendipity_get_config_var('template', 'default') ."/style.css"));
-} else if ( file_exists($serendipity['templatePath'] ."default/style.css")) {
- readfile ($serendipity['templatePath'] ."default/style.css");
+header('Content-type: text/css');
+
+if (!@include_once('serendipity_config.inc.php')) {
+ readfile('serendipity.css');
+} else if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) {
+ echo str_replace('{TEMPLATE_PATH}', $serendipity['baseURL'] . '/templates/' . serendipity_get_config_var('template', 'default'). '/', file_get_contents($serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css'));
+} else if (file_exists($serendipity['templatePath'] . 'default/style.css')) {
+ readfile ($serendipity['templatePath'] . 'default/style.css');
} else {
- include_once("serendipity_config.inc.php");
- $css = serendipity_getCSS($_REQUEST['style']);
- echo $css['data'];
+ include_once('serendipity_config.inc.php');
+ $css = serendipity_getCSS($_REQUEST['style']);
+ echo $css['data'];
}
?>
|