From 74c787aab500dbbb3e75584efdc4190730cdd054 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Mon, 1 Mar 2004 15:47:55 +0000 Subject: [PATCH] fixing category feature, again --- includes/Parser.php | 7 ++++--- includes/Skin.php | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index ee1aa7f152..2e4e802dac 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -140,7 +140,7 @@ class Parser function categoryMagic () { - global $wgLang ; + global $wgLang , $wgUser ; if ( !$this->mOptions->getUseCategoryMagic() ) return ; $id = $this->mTitle->getArticleID() ; $cat = ucfirst ( wfMsg ( "category" ) ) ; @@ -154,7 +154,8 @@ class Parser $children = array() ; - $sk =& $this->mGetSkin(); +# $sk =& $this->mGetSkin(); + $sk =& $wgUser->getSkin() ; $doesexist = false ; if ( $doesexist ) { @@ -742,7 +743,7 @@ class Parser $s .= $prefix . "" . $text . "" . $trail; return $s; } - if ( $ns == $category && $wgUseCategoryMagic ) { + if ( $ns == $category && $this->mOptions->getUseCategoryMagic() ) { $t = explode ( ":" , $nt->getText() ) ; array_shift ( $t ) ; $t = implode ( ":" , $t ) ; diff --git a/includes/Skin.php b/includes/Skin.php index a163ad044d..04646929c8 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -14,15 +14,15 @@ include_once( "RecentChange.php" ); # For some odd PHP bug, this function can't be part of a class function getCategories () { - global $wgOut , $wgTitle , $wgUseCategoryMagic , $wgUser ; + global $wgOut , $wgTitle , $wgUseCategoryMagic , $wgUser , $wgParser ; if ( !isset ( $wgUseCategoryMagic ) || !$wgUseCategoryMagic ) return "" ; - if ( count ( $wgOut->mCategoryLinks ) == 0 ) return "" ; + if ( count ( $wgParser->mCategoryLinks ) == 0 ) return "" ; if ( !$wgOut->isArticle() ) return "" ; $sk = $wgUser->getSkin() ; $s = "" ; $s .= "\n
\n"; $s .= $sk->makeKnownLink ( "Special:Categories" , "Categories" , "article=".$wgTitle->getDBkey() ) ; - $t = implode ( " | " , $wgOut->mCategoryLinks ) ; + $t = implode ( " | " , $wgParser->mCategoryLinks ) ; if ( $t != "" ) $s .= " : " ; $s .= $t ; return $s ; -- 2.20.1