From c1a29795b47ca26fa4b8d8aa7fe429feccb75e31 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 26 Jan 2011 16:54:58 +0000 Subject: [PATCH] First round of $wgArticle removals --- includes/Skin.php | 6 ++++-- includes/SkinTemplate.php | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 584253802f..3d6c0527bc 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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(); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 5a973533fc..fc63dcebbb 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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() ); } -- 2.20.1