2 include_once( "SpecialRecentchanges.php" );
4 function wfSpecialRecentchangeslinked( $par = NULL )
6 global $wgUser, $wgOut, $wgLang, $wgTitle;
7 global $days, $target, $hideminor; # From query string
8 $fname = "wfSpecialRecentchangeslinked";
10 $wgOut->setPagetitle( wfMsg( "recentchanges" ) );
11 $sk = $wgUser->getSkin();
16 if ( "" == $target ) {
17 $wgOut->errorpage( "notargettitle", "notargettext" );
20 $nt = Title
::newFromURL( $target );
22 $wgOut->errorpage( "notargettitle", "notargettext" );
25 $id = $nt->getArticleId();
27 $wgOut->setSubtitle( wfMsg( "rclsub", $nt->getPrefixedText() ) );
30 $days = $wgUser->getOption( "rcdays" );
31 if ( ! $days ) { $days = 7; }
34 list( $limit, $offset ) = wfCheckLimits( 100, "rclimit" );
35 $cutoff = wfUnix2Timestamp( time() - ( $days * 86400 ) );
37 $hideminor = ($hideminor ?
1 : 0);
39 $mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
40 WfMsg( "show" ), "target=" . wfEscapeHTML( $nt->getPrefixedURL() ) .
41 "&days={$days}&limit={$limit}&hideminor=0" );
43 $mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
44 WfMsg( "hide" ), "target=" . wfEscapeHTML( $nt->getPrefixedURL() ) .
45 "&days={$days}&limit={$limit}&hideminor=1" );
48 $cmq = "AND cur_minor_edit=0";
51 $sql = "SELECT cur_id,cur_namespace,cur_title,cur_user,cur_comment," .
52 "cur_user_text,cur_timestamp,cur_minor_edit,cur_is_new FROM links, cur " .
53 "WHERE cur_timestamp > '{$cutoff}' {$cmq} AND l_to=cur_id AND l_from=$id " .
54 "GROUP BY cur_id ORDER BY inverse_timestamp LIMIT {$limit}";
55 $res = wfQuery( $sql, DB_READ
, $fname );
57 $note = wfMsg( "rcnote", $limit, $days );
58 $wgOut->addHTML( "<hr>\n{$note}\n<br>" );
60 $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked",
61 "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
64 $wgOut->addHTML( "{$note}\n" );
66 $s = $sk->beginRecentChangesList();
67 $count = wfNumRows( $res );
70 if ( 0 == $count ) { break; }
71 $obj = wfFetchObject( $res );
74 $rc = RecentChange
::newFromCurRow( $obj );
75 $s .= $sk->recentChangesLine( $rc );
78 $s .= $sk->endRecentChangesList();
81 $wgOut->addHTML( $s );