$offlimit = $limit + $offset;
$querylimit = $offlimit + 1;
$hideminor = ($wgRequest->getVal( 'hideminor' ) ? 1 : 0);
+ $sk = $wgUser->getSkin();
+
+ $userCond = "";
$nt = Title::newFromURL( $target );
$nt->setNamespace( Namespace::getUser() );
- $sk = $wgUser->getSkin();
$id = User::idFromName( $nt->getText() );
if ( 0 == $id ) {
$ul = $nt->getText();
} else {
$ul = $sk->makeLinkObj( $nt, $nt->getText() );
+ $userCond = "=" . $id;
}
$talk = $nt->getTalkPage();
if( $talk )
$ul .= " (" . $sk->makeLinkObj( $talk, $wgLang->getNsText(Namespace::getTalk(0)) ) . ")";
else
$ul .= "brrrp";
+
+ if ( $target == 'newbies' ) {
+ # View the contributions of all recently created accounts
+ $row = wfGetArray("user",array("max(user_id) as m"),false);
+ $userCond = ">" . ($row->m - $row->m / 100);
+ $ul = "";
+ $id = 0;
+ }
+
$wgOut->setSubtitle( wfMsg( "contribsub", $ul ) );
if ( $hideminor ) {
}
$oldtable=$wgIsPg?'"old"':'old';
- if ( 0 == $id ) {
- $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new FROM cur " .
+ if ( $userCond == "" ) {
+ $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new,cur_user_text FROM cur " .
"WHERE cur_user_text='" . wfStrencode( $nt->getText() ) . "' {$cmq} " .
"ORDER BY inverse_timestamp LIMIT {$querylimit}";
$res1 = wfQuery( $sql, DB_READ, $fname );
- $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit FROM $oldtable " .
+ $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text FROM $oldtable " .
"WHERE old_user_text='" . wfStrencode( $nt->getText() ) . "' {$omq} " .
"ORDER BY inverse_timestamp LIMIT {$querylimit}";
$res2 = wfQuery( $sql, DB_READ, $fname );
} else {
- $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new FROM cur " .
- "WHERE cur_user={$id} {$cmq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
+ $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new,cur_user_text FROM cur " .
+ "WHERE cur_user {$userCond} {$cmq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
$res1 = wfQuery( $sql, DB_READ, $fname );
- $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit FROM $oldtable " .
- "WHERE old_user={$id} {$omq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
+ $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text FROM $oldtable " .
+ "WHERE old_user {$userCond} {$omq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
$res2 = wfQuery( $sql, DB_READ, $fname );
}
$nCur = wfNumRows( $res1 );
$comment =$obj1->cur_comment;
$me = $obj1->cur_minor_edit;
$isnew = $obj1->cur_is_new;
+ $usertext = $obj1->cur_user_text;
+
$obj1 = wfFetchObject( $res1 );
$topmark = true;
--$nCur;
$ts = $obj2->old_timestamp;
$comment =$obj2->old_comment;
$me = $obj2->old_minor_edit;
+ $usertext = $obj2->old_user_text;
$obj2 = wfFetchObject( $res2 );
$topmark = false;
--$nOld;
}
if( $n >= $offset )
- ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, ( $me > 0), $isnew );
+ ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, ( $me > 0), $isnew, $usertext );
}
$wgOut->addHTML( "</ul>\n" );
}
TODO: This would probably look a lot nicer in a table.
*/
-function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew )
+function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $target )
{
global $wgLang, $wgOut, $wgUser, $wgRequest;
$page = Title::makeName( $ns, $t );
$sysop = $wgUser->isSysop();
if($sysop ) {
$extraRollback = $wgRequest->getBool( "bot" ) ? '&bot=1' : '';
- $target = $wgRequest->getText( 'target' );
+ # $target = $wgRequest->getText( 'target' );
$topmarktext .= " [". $sk->makeKnownLink( $page,
wfMsg( "rollbacklink" ),
"action=rollback&from=" . urlencode( $target ) . $extraRollback ) ."]";