From: Lawrence A. <la...@us...> - 2002-02-09 23:07:06
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv1045/lib/plugin Modified Files: RecentChanges.php Log Message: Changes to RecentChanges plugin. Now takes $limit < 0 to return oldest $limit changes. $days <=0 is ignored. So to get the oldest 20 changes in the last three days, use limit ||= 20, days ||= 3. Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.59 retrieving revision 1.60 diff -u -b -I^#: -d -r1.59 -r1.60 --- RecentChanges.php 9 Feb 2002 21:35:42 -0000 1.59 +++ RecentChanges.php 9 Feb 2002 23:07:01 -0000 1.60 @@ -150,9 +150,7 @@ function description () { extract($this->_args); - // FIXME: say something about show_all. - if ($show_major && $show_minor) $edits = _("edits"); elseif ($show_major) @@ -164,7 +162,7 @@ if (intval($days) != $days) $days = sprintf("%.1f", $days); } - + $lmt = abs($limit); /** * Depending how this text is split up it can be tricky or * impossible to translate with good grammar. So the seperate @@ -199,6 +197,19 @@ $desc = fmt("The %d most recent %s are listed below.", $limit, $edits); } + elseif ($limit < 0) { //$limit < 0 means we want oldest pages + if ($timespan) { + if (intval($days) == 1) + $desc = fmt("The %d oldest %s during the past day are listed below.", + $lmt, $edits); + else + $desc = fmt("The %d oldest %s during the past %s days are listed below.", + $lmt, $edits, $days); + } else + $desc = fmt("The %d oldest %s are listed below.", + $lmt, $edits); + } + else { if ($timespan) { if (intval($days) == 1) @@ -553,7 +564,7 @@ if (abs($days) == 1) $label = _("1 day"); - elseif ($days == 0) + elseif ($days <= 0) $label = "..."; //alldays else $label = sprintf(_("%s days"), abs($days)); |