First round of $wgArticle removals
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 26 Jan 2011 16:54:58 +0000 (16:54 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 26 Jan 2011 16:54:58 +0000 (16:54 +0000)
includes/Skin.php
includes/SkinTemplate.php

index 5842538..3d6c052 100644 (file)
@@ -1483,10 +1483,12 @@ class Skin extends Linker {
                        return '';
                }
 
+               $article = new Article( $this->mTitle, 0 );
+
                $s = '';
 
                if ( !$wgDisableCounters ) {
-                       $count = $wgLang->formatNum( $wgArticle->getCount() );
+                       $count = $wgLang->formatNum( $article->getCount() );
 
                        if ( $count ) {
                                $s = wfMsgExt( 'viewcount', array( 'parseinline' ), $count );
@@ -1494,7 +1496,7 @@ class Skin extends Linker {
                }
 
                if ( $wgMaxCredits != 0 ) {
-                       $s .= ' ' . Credits::getCredits( $wgArticle, $wgMaxCredits, $wgShowCreditsIfMax );
+                       $s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
                } else {
                        $s .= $this->lastModified();
                }
index 5a97353..fc63dce 100644 (file)
@@ -345,9 +345,11 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'skin', $this );
                $tpl->set( 'logo', $this->logoText() );
                if ( $out->isArticle() && ( !isset( $oldid ) || isset( $diff ) ) &&
-                       $this->mTitle->exists() ){
+                       $this->mTitle->exists() )
+               {
+                       $article = new Article( $this->mTitle, 0 );
                        if ( !$wgDisableCounters ) {
-                               $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
+                               $viewcount = $wgLang->formatNum( $article->getCount() );
                                if ( $viewcount ) {
                                        $tpl->set( 'viewcount', wfMsgExt( 'viewcount', array( 'parseinline' ), $viewcount ) );
                                } else {
@@ -383,7 +385,7 @@ class SkinTemplate extends Skin {
                        $this->credits = false;
 
                        if( $wgMaxCredits != 0 ){
-                               $this->credits = Credits::getCredits( $wgArticle, $wgMaxCredits, $wgShowCreditsIfMax );
+                               $this->credits = Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
                        } else {
                                $tpl->set( 'lastmod', $this->lastModified() );
                        }