From a5fff41a25f1b0f40ebafc406717573f3c7a26b2 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 26 Jan 2005 09:34:28 +0000 Subject: [PATCH] Get ride of the username in links when user is logged in. Instead use special pages just like the already existent [[Special:Watchlist]]. That's one more step to get pages rendered for logged users cached. --- includes/SkinTemplate.php | 29 +++++++++++++---------------- includes/SpecialMycontributions.php | 7 +++++++ includes/SpecialMypage.php | 7 +++++++ includes/SpecialMytalk.php | 7 +++++++ includes/SpecialPage.php | 5 +++++ 5 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 includes/SpecialMycontributions.php create mode 100644 includes/SpecialMypage.php create mode 100644 includes/SpecialMytalk.php diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index cfca563064..c3ac8def18 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -410,16 +410,14 @@ class SkinTemplate extends Skin { global $wgShowIPinHeader; $personal_urls = array(); if ($this->loggedin) { + /* Logged in users personal toolbar */ $personal_urls['userpage'] = array( - 'text' => $this->username, - 'href' => &$this->userpageUrlDetails['href'], - 'class' => $this->userpageUrlDetails['exists']?false:'new' + 'text' => wfMsg('mypage'), + 'href' => $this->makeSpecialUrl('Mypage') ); - $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage); $personal_urls['mytalk'] = array( 'text' => wfMsg('mytalk'), - 'href' => &$usertalkUrlDetails['href'], - 'class' => $usertalkUrlDetails['exists']?false:'new' + 'href' => $this->makeSpecialUrl('Mytalk') ); $personal_urls['preferences'] = array( 'text' => wfMsg('preferences'), @@ -431,7 +429,7 @@ class SkinTemplate extends Skin { ); $personal_urls['mycontris'] = array( 'text' => wfMsg('mycontris'), - 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username ) ) + 'href' => $this->makeSpecialUrl('Mycontributions') ); $personal_urls['logout'] = array( 'text' => wfMsg('userlogout'), @@ -439,23 +437,22 @@ class SkinTemplate extends Skin { ); } else { if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) { + /* Anonymous with session users personal toolbar */ $personal_urls['anonuserpage'] = array( - 'text' => $this->username, - 'href' => &$this->userpageUrlDetails['href'], - 'class' => $this->userpageUrlDetails['exists']?false:'new' + 'text' => wfMsg('mypage'), + 'href' => $this->makeSpecialUrl('Mypage') ); - $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage); - $personal_urls['anontalk'] = array( - 'text' => wfMsg('anontalk'), - 'href' => &$usertalkUrlDetails['href'], - 'class' => $usertalkUrlDetails['exists']?false:'new' + $personal_urls['mytalk'] = array( + 'text' => wfMsg('mytalk'), + 'href' => $this->makeSpecialUrl('Mytalk') ); + $personal_urls['anonlogin'] = array( 'text' => wfMsg('userlogin'), 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ) ); } else { - + /* Anonymous users personal toolbar */ $personal_urls['login'] = array( 'text' => wfMsg('userlogin'), 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ) diff --git a/includes/SpecialMycontributions.php b/includes/SpecialMycontributions.php new file mode 100644 index 0000000000..f75f375351 --- /dev/null +++ b/includes/SpecialMycontributions.php @@ -0,0 +1,7 @@ +redirect ( $t->getFullURL().'&target='.$wgUser->getName() ); +} +?> \ No newline at end of file diff --git a/includes/SpecialMypage.php b/includes/SpecialMypage.php new file mode 100644 index 0000000000..edc1fd8b0f --- /dev/null +++ b/includes/SpecialMypage.php @@ -0,0 +1,7 @@ +getName() ); + $wgOut->redirect ($t->getFullURL()); +} +?> \ No newline at end of file diff --git a/includes/SpecialMytalk.php b/includes/SpecialMytalk.php new file mode 100644 index 0000000000..71e8bf7667 --- /dev/null +++ b/includes/SpecialMytalk.php @@ -0,0 +1,7 @@ +getName() ); + $wgOut->redirect ($t->getFullURL()); +} +?> \ No newline at end of file diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index c7f1f64d25..27bf4b1193 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -31,6 +31,11 @@ $wgSpecialPages = array( 'Userlogout' => new UnlistedSpecialPage( 'Userlogout' ), 'Preferences' => new SpecialPage( 'Preferences' ), 'Watchlist' => new SpecialPage( 'Watchlist' ), + + 'Mytalk' => new UnlistedSpecialPage( 'Mytalk'), + 'Mycontributions' => new UnlistedSpecialPage( 'Mycontributions'), + 'Mypage' => new UnlistedSpecialPage( 'Mypage'), + 'Recentchanges' => new SpecialPage( 'Recentchanges' ), 'Upload' => new SpecialPage( 'Upload' ), 'Imagelist' => new SpecialPage( 'Imagelist' ), -- 2.20.1