Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25986
Modified Files:
Tag: branch-smarty
index.php rss.php
Log Message:
* Support for adding timezone offsets in configuration
* Fixed XHTML compliance of calendar
* Adjusted coding style in some places
* Fixed entry preview to not show comments/trackbacks
* Fixed draft display in frontend entry overview
* New variable "is_preview" for smarty template
* Removed some hard-coded language strings in smarty templates
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.28.2.6
retrieving revision 1.28.2.7
diff -u -d -r1.28.2.6 -r1.28.2.7
--- rss.php 8 Nov 2004 09:25:18 -0000 1.28.2.6
+++ rss.php 12 Nov 2004 15:43:22 -0000 1.28.2.7
@@ -38,14 +38,14 @@
// See if the client has provided the required headers.
// Always convert the provided header into GMT timezone to allow comparing to the server-side last-modified header
$modified_since = !empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])
- ? gmdate('D, d M Y H:i:s \G\M\T', strtotime(stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE'])))
+ ? gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour(strtotime(stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE'])), true))
: false;
$none_match = !empty($_SERVER['HTTP_IF_NONE_MATCH'])
? str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH']))
: false;
if (is_array($latest_entry) && isset($latest_entry[0]['last_modified'])) {
- $last_modified = gmdate('D, d M Y H:i:s \G\M\T', $latest_entry[0]['last_modified']);
+ $last_modified = gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour($latest_entry[0]['last_modified'], true));
$etag = '"' . $last_modified . '"';
header('Last-Modified: ' . $last_modified);
@@ -180,7 +180,7 @@
break;
case 'atom0.3':
- $modified = gmdate('Y-m-d\TH:i:s\Z', $entries[0]['last_modified']);
+ $modified = gmdate('Y-m-d\TH:i:s\Z', serendipity_serverOffsetHour($entries[0]['last_modified']));
print <<<HEAD
<feed version="0.3"
xmlns="http://purl.org/atom/ns#"
@@ -207,7 +207,7 @@
break;
case 'opml1.0':
- $modified = gmdate('Y-m-d\TH:i:s\Z', $entries[0]['last_modified']);
+ $modified = gmdate('Y-m-d\TH:i:s\Z', serendipity_serverOffsetHour($entries[0]['last_modified']));
print <<<HEAD
<opml version="{$version}">
<head>
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.49.2.11
retrieving revision 1.49.2.12
diff -u -d -r1.49.2.11 -r1.49.2.12
--- index.php 6 Nov 2004 21:33:04 -0000 1.49.2.11
+++ index.php 12 Nov 2004 15:43:21 -0000 1.49.2.12
@@ -2,15 +2,13 @@
#apd_set_pprof_trace();
-function microtime_float()
-{
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
+function microtime_float() {
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
-
// 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');
@@ -28,15 +26,15 @@
$uri = $_SERVER['REQUEST_URI'];
if (preg_match(PAT_UNSUBSCRIBE, $uri, $res)) {
- if ( serendipity_cancelSubscription(urldecode($res[1]), $res[2]) ) {
+ if (serendipity_cancelSubscription(urldecode($res[1]), $res[2])) {
define('DATA_UNSUBSCRIBED', urldecode($res[1]));
}
- $uri = '/'.PATH_UNSUBSCRIBE.'/'. $res[2] .'_untitled.html';
+ $uri = '/' . PATH_UNSUBSCRIBE . '/' . $res[2] . '_untitled.html';
}
if (preg_match(PAT_DELETE, $uri, $res) && $serendipity['serendipityAuthedUser'] === true) {
- if ( $res[1] == 'comment' && serendipity_deleteComment($res[2], $res[3], 'comments') ) {
+ if ($res[1] == 'comment' && serendipity_deleteComment($res[2], $res[3], 'comments')) {
define('DATA_COMMENT_DELETED', $res[2]);
} elseif ( $res[1] == 'trackback' && serendipity_deleteComment($res[2], $res[3], 'trackbacks') ) {
define('DATA_TRACKBACK_DELETED', $res[2]);
@@ -44,29 +42,26 @@
}
if (preg_match(PAT_APPROVE, $uri, $res) && $serendipity['serendipityAuthedUser'] === true) {
- if ( $res[1] == 'comment' && serendipity_approveComment($res[2], $res[3]) ) {
+ if ($res[1] == 'comment' && serendipity_approveComment($res[2], $res[3])) {
define('DATA_COMMENT_APPROVED', $res[2]);
- } elseif ( $res[1] == 'trackback' && serendipity_approveComment($res[2], $res[3]) ) {
+ } elseif ($res[1] == 'trackback' && serendipity_approveComment($res[2], $res[3])) {
define('DATA_TRACKBACK_APPROVED', $res[2]);
}
}
if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range']) && is_numeric($serendipity['GET']['range'])) {
-
preg_match_all('@/([a-z0-9]+)@i', $matches[1], $args);
/* Attempt to locate hidden variables within the URI */
foreach ($args[1] as $k => $v){
- if ( $v{0} == 'C' ) { /* category */
+ if ($v{0} == 'C') { /* category */
$serendipity['GET']['category'] = substr($v, 1);
unset($args[1][$k]);
-
- } elseif ( $v{0} == 'W' ) { /* Week */
+ } elseif ($v{0} == 'W') { /* Week */
$week = substr($v, 1);
unset($args[1][$k]);
-
- } elseif ( $v == 'summary' ) { /* Summary */
+ } elseif ($v == 'summary') { /* Summary */
$serendipity['short_archives'] = true;
unset($args[1][$k]);
}
@@ -78,25 +73,24 @@
$_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['hidefooter'] = true;
- if ( $week ) {
- $tm = strtotime('+ '. ($week-2) .' WEEKS monday', mktime(0,0,0,1,1,$year));
+ if ($week) {
+ $tm = strtotime('+ '. ($week-2) .' WEEKS monday', mktime(0, 0, 0, 1, 1, $year));
$ts = mktime(0, 0, 0, date('m', $tm), date('j', $tm), $year);
$te = mktime(23, 59, 59, date('m', $tm), date('j', $tm)+7, $year);
- $date = serendipity_formatTime(WEEK .' '. $week .', %Y', $ts);
+ $date = serendipity_formatTime(WEEK .' '. $week .', %Y', $ts, false);
} else {
- if ( $day ) {
+ if ($day) {
$ts = mktime(0, 0, 0, $month, $day, $year);
$te = mktime(23, 59, 59, $month, $day, $year);
- $date = serendipity_formatTime(DATE_FORMAT_ENTRY, $ts);
+ $date = serendipity_formatTime(DATE_FORMAT_ENTRY, $ts, false);
} else {
$ts = mktime(0, 0, 0, $month, 1, $year);
$te = mktime(23, 59, 59, $month, date('t', $ts), $year);
- $date = serendipity_formatTime('%B %Y', $ts);
+ $date = serendipity_formatTime('%B %Y', $ts, $false);
}
}
$serendipity['range'] = array($ts, $te);
-
$serendipity['smarty']->assign('head_subtitle', sprintf(ENTRIES_FOR, $date));
ob_start();
@@ -215,7 +209,7 @@
if (isset($serendipity['GET']['calendarZoom'])) {
$serendipity['GET']['action'] = 'read';
- $serendipity['GET']['range'] = $serendipity['GET']['calendarZoom'];
+ $serendipity['GET']['range'] = $serendipity['GET']['calendarZoom'];
}
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
}
|