Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27788/plugins/serendipity_plugin_history
Modified Files:
serendipity_plugin_history.php
Log Message:
The last change wasn't MFH'd, now it is.
Index: serendipity_plugin_history.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history/serendipity_plugin_history.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- serendipity_plugin_history.php 2 Dec 2004 14:11:30 -0000 1.18
+++ serendipity_plugin_history.php 19 Dec 2004 11:45:38 -0000 1.19
@@ -164,8 +164,8 @@
function generate_content(&$title)
{
- global $serendipity;
- $title = $this->get_config('title', $this->title);
+ global $serendipity;
+ $title = $this->get_config('title', PLUGIN_HISTORY_NAME);
$intro = $this->get_config('intro');
$outro = $this->get_config('outro');
$maxlength = $this->get_config('maxlength');
@@ -177,53 +177,46 @@
$dateformat = $this->get_config('dateformat');
$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', serendipity_serverOffsetHour());
+ if (!is_numeric($min_age) || $min_age < 0 || $specialage == 'year') {
+ $min_age = 365 + date('L');
}
- if (!$max_age || !is_numeric($max_age) || $max_age < 1 || $specialage == 'year') {
- $max_age = 365 + date('L', serendipity_serverOffsetHour());
+ if (!is_numeric($max_age) || $max_age < 1 || $specialage == 'year') {
+ $max_age = 365 + date('L');
}
- if (!$max_entries || !is_numeric($max_entries) || $max_entries < 1) {
+ if (!is_numeric($max_entries) || $max_entries < 1) {
$max_entries = 5;
}
- if (!$maxlength ||!is_numeric($maxlength) ||$maxlength <0)
+ if (!is_numeric($maxlength) ||$maxlength <0)
$maxlength = 30;
-
- if (!$dateformat || strlen($dateformat) < 1) {
+
+ if (strlen($dateformat) < 1) {
$dateformat = '%a, %d.%m.%Y %H:%M';
}
- $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;
- }
+ $maxts = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
+ $mints = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
+ $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;
$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' ? '' : serendipity_strftime($dateformat, $e[$x]['timestamp']));
- $t = ($maxlength == 0 || strlen($e[$x]['title']) <= $maxlength)
- ? $e[$x]['title']
- : trim(serendipity_mb('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 />';
+ 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 />';
}
-
echo $outro;
}
}
|