global $IP;
include_once( "$IP/SpecialRecentchanges.php" );
-function wfSpecialRecentchangeslinked()
+function wfSpecialRecentchangeslinked( $par = NULL )
{
global $wgUser, $wgOut, $wgLang, $wgTitle;
- global $days, $limit, $target, $hideminor; # From query string
+ global $days, $target, $hideminor; # From query string
$fname = "wfSpecialRecentchangeslinked";
$wgOut->setPagetitle( wfMsg( "recentchanges" ) );
$sk = $wgUser->getSkin();
+ if( $par ) {
+ $target = $par;
+ }
if ( "" == $target ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
$days = $wgUser->getOption( "rcdays" );
if ( ! $days ) { $days = 7; }
}
- if ( ! $limit ) {
- $limit = $wgUser->getOption( "rclimit" );
- if ( ! $limit ) { $limit = 100; }
- }
- $cutoff = date( "YmdHis", time() - ( $days * 86400 ) );
+ $days = (int)$days;
+ list( $limit, $offset ) = wfCheckLimits( 100, "rclimit" );
+ $cutoff = wfUnix2Timestamp( time() - ( $days * 86400 ) );
if ( ! isset( $hideminor ) ) {
$hideminor = $wgUser->getOption( "hideminor" );
"ORDER BY inverse_timestamp LIMIT {$limit}";
$res = wfQuery( $sql, $fname );
- $note = str_replace( "$1", $limit, wfMsg( "rcnote" ) );
- $note = str_replace( "$2", $days, $note );
+ $note = wfMsg( "rcnote", $limit, $days );
$wgOut->addHTML( "<hr>\n{$note}\n<br>" );
$tu = "target=" . $nt->getPrefixedURL();