From 980c9668575bcd182307f88c01a335e10e1a92c1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 20 Nov 2003 06:57:00 +0000 Subject: [PATCH] contribs talk link; RFE 845599 --- includes/SpecialContributions.php | 10 ++++++++-- includes/Title.php | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 6719274393..b538cf9713 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -24,10 +24,16 @@ function wfSpecialContributions( $par = "" ) $sk = $wgUser->getSkin(); $id = User::idFromName( $nt->getText() ); - if ( 0 == $id ) { $ul = $nt->getText(); } - else { + if ( 0 == $id ) { + $ul = $nt->getText(); + } else { $ul = $sk->makeKnownLink( $nt->getPrefixedText(), $nt->getText() ); } + $talk = $nt->getTalkPage(); + if( $talk ) + $ul .= " (" . $sk->makeLinkObj( $talk, $wgLang->getNsText(Namespace::getTalk(0)) ) . ")"; + else + $ul .= "brrrp"; $wgOut->setSubtitle( wfMsg( "contribsub", $ul ) ); if ( ! isset( $hideminor ) ) { diff --git a/includes/Title.php b/includes/Title.php index 2480679b0e..7396b6b64a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -453,5 +453,13 @@ class Title { wfProfileOut( $fname ); return true; } + + function getTalkPage() { + return Title::makeTitle( Namespace::getTalk( $this->getNamespace() ), $this->getDBkey() ); + } + + function getSubjectPage() { + return Title::makeTitle( Namespace::getSubject( $this->getNamespace() ), $this->getDBkey() ); + } } ?> -- 2.20.1