From: Magnus Manske Date: Mon, 1 Mar 2004 15:47:55 +0000 (+0000) Subject: fixing category feature, again X-Git-Tag: 1.3.0beta1~888 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=74c787aab500dbbb3e75584efdc4190730cdd054;p=lhc%2Fweb%2Fwiklou.git fixing category feature, again --- 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 ;