fixing category feature, again
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Mon, 1 Mar 2004 15:47:55 +0000 (15:47 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Mon, 1 Mar 2004 15:47:55 +0000 (15:47 +0000)
includes/Parser.php
includes/Skin.php

index ee1aa7f..2e4e802 100644 (file)
@@ -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 . "<strong>" . $text . "</strong>" . $trail;
                        return $s;
                }
-               if ( $ns == $category && $wgUseCategoryMagic ) {
+               if ( $ns == $category && $this->mOptions->getUseCategoryMagic() ) {
                        $t = explode ( ":" , $nt->getText() ) ;
                        array_shift ( $t ) ;
                        $t = implode ( ":" , $t ) ;
index a163ad0..0464692 100644 (file)
@@ -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<br>\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 ;