Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25986/plugins/serendipity_plugin_history
Modified Files:
Tag: branch-smarty
serendipity_plugin_history.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: serendipity_plugin_history.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history/serendipity_plugin_history.php,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -u -d -r1.11.2.2 -r1.11.2.3
--- serendipity_plugin_history.php 29 Oct 2004 11:02:41 -0000 1.11.2.2
+++ serendipity_plugin_history.php 12 Nov 2004 15:43:30 -0000 1.11.2.3
@@ -174,11 +174,11 @@
$full = ($this->get_config('full', 'false') != 'true') ? false : true;
if (!$min_age || !is_numeric($min_age) || $min_age < 1 || $specialage == 'year') {
- $min_age = 365 + date('L');
+ $min_age = 365 + date('L', serendipity_serverOffsetHour());
}
if (!$max_age || !is_numeric($max_age) || $max_age < 1 || $specialage == 'year') {
- $max_age = 365 + date('L');
+ $max_age = 365 + date('L', serendipity_serverOffsetHour());
}
if (!$max_entries || !is_numeric($max_entries) || $max_entries < 1) {
@@ -192,27 +192,34 @@
$dateformat = '%a, %d.%m.%Y %H:%M';
}
- $maxts = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
- $mints = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
+ $nowts = serendipity_serverOffsetHour();
+ $maxts = mktime(23, 59, 59, date('m', $nowts), date('d', $nowts), date('Y', $nowts));
+ $mints = mktime(0, 0, 0, date('m', $nowts), date('d', $nowts), date('Y', $nowts));
$e = serendipity_fetchEntries(array(($mints-$min_age*86400),
($maxts-$max_age*86400)), $full, 15);
- echo (empty($intro)) ? '' : "$intro<br />";
- if (!is_array($e)) return false;
+ echo (empty($intro) ? '' : "$intro<br />");
+
+ if (!is_array($e)) {
+ return false;
+ }
+
$e_c = @count($e);
- if ($e_c==0) return false;
- for($x=0; $x < $e_c; $x++) {
- $url = serendipity_archiveURL($e[$x]['id'],
- $e[$x]['title'],
- 'serendipityHTTPPath'
- );
- $date = ($displaydate=='0') ? '' : strftime($dateformat,$e[$x]['timestamp']);
- $t = ($maxlength==0 || strlen($e[$x]['title'])<=$maxlength) ?
- $e[$x]['title'] :
- (trim(substr($e[$x]['title'], 0, $maxlength-3)).' [...]');
- echo $date . "<a href='$url' title='".str_replace("'", '`', $e[$x][title])."'>".$t."</a> " .
- strip_tags($e[$x]['body']) . '<br />';
+ if ($e_c == 0) {
+ return false;
}
+
+ for ($x = 0; $x < $e_c; $x++) {
+ $url = serendipity_archiveURL($e[$x]['id'], $e[$x]['title'], 'serendipityHTTPPath');
+ $date = ($displaydate == '0' ? '' : serendipity_strftime($dateformat, $e[$x]['timestamp']));
+ $t = ($maxlength == 0 || strlen($e[$x]['title']) <= $maxlength)
+ ? $e[$x]['title']
+ : trim(substr($e[$x]['title'], 0, $maxlength - 3)) . ' [...]';
+
+ echo $date . '"<a href="' . $url . '" title="' . htmlspecialchars($e[$x]['title']) . '">' . $t . '</a> '
+ . strip_tags($e[$x]['body']) . '<br />';
+ }
+
echo $outro;
}
}
|