Show links to user page, talk page and contributions page on Special:Newpages
authorRob Church <robchurch@users.mediawiki.org>
Wed, 22 Mar 2006 16:09:21 +0000 (16:09 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 22 Mar 2006 16:09:21 +0000 (16:09 +0000)
RELEASE-NOTES
includes/SpecialNewpages.php

index 1c5f733..7660375 100644 (file)
@@ -378,6 +378,7 @@ Special Pages:
   account creation is disabled.
 * JavaScript filter for Special:Allmessages
 * (bug 3047) Don't mention talk pages on Special:Movepage when there isn't one
+* Show links to user page, talk page and contributions page on Special:Newpages
 
 Misc.:
 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
index 2ab576b..fe100cc 100644 (file)
@@ -65,14 +65,10 @@ class NewPagesPage extends QueryPage {
 
                $length = wfMsg( 'nbytes', $wgLang->formatNum( $result->length ) );
 
-               if ( $u == 0 ) { # not by a logged-in user
-                       $userPage = Title::makeTitle( NS_SPECIAL, 'Contributions' );
-                       $linkParams = 'target=' . urlencode( $ut );
-               } else {
-                       $userPage = Title::makeTitle( NS_USER, $ut );
-                       $linkParams = '';
-               }
-               $ul = $skin->makeLinkObj( $userPage, htmlspecialchars( $ut ), $linkParams );
+               $userLink  = $skin->makeLinkObj( Title::makeTitle( NS_USER, $ut ), htmlspecialchars( $ut ) );
+               $talkLink  = $skin->makeLinkObj( Title::makeTitle( NS_USER_TALK, $ut ), $wgLang->getNsText( NS_TALK ) );
+               $contLink  = $skin->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Contributions' ), wfMsg( 'contribslink' ), 'target=' . urlencode( $ut ) );
+               $userTools = "$userLink ($talkLink | $contLink)";
 
                $d = $wgLang->timeanddate( $result->timestamp, true );
 
@@ -85,7 +81,7 @@ class NewPagesPage extends QueryPage {
                        $link = $skin->makeKnownLink( $ns . ':' . $result->title, '' );
                }
 
-               $s = "{$d} {$link} ({$length}) . . {$ul}";
+               $s = "{$d} {$link} ({$length}) . . {$userTools}";
                $s .= $skin->commentBlock( $result->comment );
                return $s;
        }