Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13542/plugins/serendipity_plugin_history
Modified Files:
serendipity_plugin_history.php
Log Message:
Translation & bugfix
Index: serendipity_plugin_history.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history/serendipity_plugin_history.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- serendipity_plugin_history.php 7 Jul 2004 21:34:37 -0000 1.4
+++ serendipity_plugin_history.php 7 Jul 2004 21:50:16 -0000 1.5
@@ -17,8 +17,12 @@
@define('PLUGIN_HISTORY_INTRO_DESC', 'Text, der vor den Einträgen angezeigt werden soll');
@define('PLUGIN_HISTORY_DISPLAYDATE', 'Datum anzeigen');
@define('PLUGIN_HISTORY_DISPLAYDATE_DESC', 'Vor jedem Eintrag das Datum anzeigen?');
- @define('PLUGIN_HISTORY_SPECIALAGE_DESC', 'Display items of a ready-made age?');
- @define('PLUGIN_HISTORY_SPECIALAGE_YEAR', 'Display items of exactly one year ago');
+ @define('PLUGIN_HISTORY_SPECIALAGE', 'Vorgefertigter Zeitrahmen');
+ @define('PLUGIN_HISTORY_SPECIALAGE_DESC', 'Wenn Sie statt einem vorgefertigten lieber einen eigenen Zeitraum einstellen möchten, wählen Sie \'Anderer\' aus und füllen die unteren beiden Felder.');
+ @define('PLUGIN_HISTORY_SPECIALAGE_YEAR', 'Zeigt Einträge vom selben Datum des letzten Jahres an.');
+ @define('PLUGIN_HISTORY_CUSTOMAGE', 'Zeitrahmen selbst einstellen');
+ @define('PLUGIN_HISTORY_OYA', 'Heute vor einem Jahr');
+ @define('PLUGIN_HISTORY_MYSELF', 'Anderer');
break;
default:
@define('PLUGIN_HISTORY_NAME', 'History');
@@ -38,9 +42,11 @@
@define('PLUGIN_HISTORY_DISPLAYDATE', 'Display date');
@define('PLUGIN_HISTORY_DISPLAYDATE_DESC', 'Display the date of each entry?');
@define('PLUGIN_HISTORY_SPECIALAGE', 'Ready-made age?');
- @define('PLUGIN_HISTORY_SPECIALAGE_DESC', 'If you want to define your own timerange instead of a ready-made, select custom here and adjust the two settings below.');
+ @define('PLUGIN_HISTORY_SPECIALAGE_DESC', 'If you want to define your own timerange instead of a ready-made, select \'I\'ll ddefine one\' here and adjust the two settings below.');
@define('PLUGIN_HISTORY_SPECIALAGE_YEAR', 'Display items of exactly one year ago');
@define('PLUGIN_HISTORY_CUSTOMAGE', 'Let me define the age');
+ @define('PLUGIN_HISTORY_OYA', 'One year ago');
+ @define('PLUGIN_HISTORY_MYSELF', 'I\'ll define one');
break;
}
@@ -85,7 +91,7 @@
$propbag->add('name', PLUGIN_HISTORY_SPECIALAGE);
$propbag->add('description', PLUGIN_HISTORY_SPECIALAGE_DESC);
$propbag->add('default', 'year');
- $propbag->add('select_values', array('year'=>'One year ago','custom'=>'I\'ll make it up'));
+ $propbag->add('select_values', array('year'=>PLUGIN_HISTORY_OYA,'custom'=>PLUGIN_HISTORY_MYSELF));
break;
case 'min_age':
$propbag->add('type', 'string');
@@ -144,16 +150,12 @@
$dateformat = $this->get_config('dateformat');
$full = ($this->get_config('full', 'false') != 'true') ? false : true;
- if (!$min_age || !is_numeric($min_age) || $min_age < 1) {
- $min_age = 365;
- }
-
- if (!$max_age || !is_numeric($max_age) || $max_age < 1 || $max_age<$min_age) {
- $max_age = 365;
+ if (!$min_age || !is_numeric($min_age) || $min_age < 1 || $specialage == 'year') {
+ $min_age = 365 + date('L');
}
- if ($specialage == 'year') {
- $min_age = $max_age = 365 + date('L');
+ if (!$max_age || !is_numeric($max_age) || $max_age < 1 || $specialage == 'year') {
+ $max_age = 365 + date('L');
}
if (!$max_entries || !is_numeric($max_entries) || $max_entries < 1) {
@@ -164,10 +166,10 @@
$dateformat = '%a, %d.%m.%Y %H:%M';
}
- $mints = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
- $maxts = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
- $e = serendipity_fetchEntries(array(($mints-$min_age*86400),
- ($maxts-$max_age*86400)), $full, 15);
+ $mints = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
+ $maxts = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
+ $e = serendipity_fetchEntries(array(($maxts-$max_age*86400),
+ ($mints-$min_age*86400)), $full, 15);
echo $intro . '<br />';
$e_c = @count($e);
|