Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10984
Modified Files:
serendipity_plugin_history.php
Log Message:
MFH done the right way, Jay ;-)
Index: serendipity_plugin_history.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history/serendipity_plugin_history.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- serendipity_plugin_history.php 19 Dec 2004 11:45:38 -0000 1.19
+++ serendipity_plugin_history.php 20 Dec 2004 13:16:42 -0000 1.20
@@ -165,7 +165,7 @@
function generate_content(&$title)
{
global $serendipity;
- $title = $this->get_config('title', PLUGIN_HISTORY_NAME);
+ $title = $this->get_config('title', $this->title);
$intro = $this->get_config('intro');
$outro = $this->get_config('outro');
$maxlength = $this->get_config('maxlength');
@@ -178,11 +178,11 @@
$full = ($this->get_config('full', 'false') != 'true') ? false : true;
if (!is_numeric($min_age) || $min_age < 0 || $specialage == 'year') {
- $min_age = 365 + date('L');
+ $min_age = 365 + date('L', serendipity_serverOffsetHour());
}
if (!is_numeric($max_age) || $max_age < 1 || $specialage == 'year') {
- $max_age = 365 + date('L');
+ $max_age = 365 + date('L', serendipity_serverOffsetHour());
}
if (!is_numeric($max_entries) || $max_entries < 1) {
@@ -196,15 +196,22 @@
$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-$max_age*86400),
($maxts-$min_age*86400)), $full, $max_entries);
echo (empty($intro)) ? '' : "$intro<br />";
- if (!is_array($e)) return false;
+ if (!is_array($e)) {
+ return false;
+ }
+
$e_c = @count($e);
- if ($e_c==0) return false;
+ if ($e_ c== 0) {
+ return false;
+ }
+
for($x=0; $x < $e_c; $x++) {
$url = serendipity_archiveURL($e[$x]['id'],
$e[$x]['title'],
@@ -213,7 +220,7 @@
$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)).' [...]');
+ (trim(serendipity_mb('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 />';
}
@@ -222,4 +229,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file
|