<?
-global $IP;
-include_once( "$IP/SpecialRecentchanges.php" );
+include_once( "SpecialRecentchanges.php" );
-function wfSpecialRecentchangeslinked()
+function wfSpecialRecentchangeslinked( $par = NULL )
{
global $wgUser, $wgOut, $wgLang, $wgTitle;
global $days, $target, $hideminor; # From query string
$wgOut->setPagetitle( wfMsg( "recentchanges" ) );
$sk = $wgUser->getSkin();
+ if( $par ) {
+ $target = $par;
+ }
if ( "" == $target ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
}
$nt = Title::newFromURL( $target );
- $sub = str_replace( "$1", $nt->getPrefixedText(), wfMsg( "rclsub" ) );
- $wgOut->setSubtitle( $sub );
+ $wgOut->setSubtitle( wfMsg( "rclsub", $nt->getPrefixedText() ) );
if ( ! $days ) {
$days = $wgUser->getOption( "rcdays" );
}
$days = (int)$days;
list( $limit, $offset ) = wfCheckLimits( 100, "rclimit" );
- $cutoff = date( "YmdHis", time() - ( $days * 86400 ) );
+ $cutoff = wfUnix2Timestamp( time() - ( $days * 86400 ) );
- if ( ! isset( $hideminor ) ) {
- $hideminor = $wgUser->getOption( "hideminor" );
- }
+ $hideminor = ($hideminor ? 1 : 0);
if ( $hideminor ) {
$mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
WfMsg( "show" ), "target=" . wfEscapeHTML( $nt->getPrefixedURL() ) .
"WHERE cur_timestamp > '{$cutoff}' {$cmq} AND l_to=cur_id AND l_from='" .
wfStrencode( $nt->getPrefixedDBkey() ) . "' GROUP BY cur_id " .
"ORDER BY inverse_timestamp LIMIT {$limit}";
- $res = wfQuery( $sql, $fname );
+ $res = wfQuery( $sql, DB_READ, $fname );
$note = wfMsg( "rcnote", $limit, $days );
$wgOut->addHTML( "<hr>\n{$note}\n<br>" );
- $tu = "target=" . $nt->getPrefixedURL();
- $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked", $tu );
+ $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked",
+ "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
+ false, $mlink );
+
$wgOut->addHTML( "{$note}\n" );
$s = $sk->beginRecentChangesList();
$obj = wfFetchObject( $res );
--$count;
- $ts = $obj->cur_timestamp;
- $u = $obj->cur_user;
- $ut = $obj->cur_user_text;
- $ns = $obj->cur_namespace;
- $ttl = $obj->cur_title;
- $com = $obj->cur_comment;
- $me = ( $obj->cur_minor_edit > 0 );
- $new = ( $obj->cur_is_new > 0 );
-
- $s .= $sk->recentChangesLine( $ts, $u, $ut, $ns, $ttl, $com, $me, $new );
+ $rc = RecentChange::newFromCurRow( $obj );
+ $s .= $sk->recentChangesLine( $rc );
--$limit;
}
$s .= $sk->endRecentChangesList();