From 5ffc3e3f0927f03a503b58473443122433f64ca5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 1 Apr 2004 12:46:31 +0000 Subject: [PATCH] avoiding warnings when the article flag is set for things that aren't really articles --- includes/Skin.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 1400616537..7f7ed17ac6 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -673,11 +673,12 @@ class Skin { if ( isset( $oldid ) || isset( $diff ) ) { return ""; } if ( 0 == $wgArticle->getID() ) { return ""; } - if ( $wgDisableCounters ) { - $s = ""; - } else { + $s = ""; + if ( !$wgDisableCounters ) { $count = $wgLang->formatNum( $wgArticle->getCount() ); - $s = wfMsg( "viewcount", $count ); + if ( $count ) { + $s = wfMsg( "viewcount", $count ); + } } $s .= $this->lastModified(); $s .= " " . wfMsg( "gnunote" ); @@ -687,9 +688,14 @@ class Skin { function lastModified() { global $wgLang, $wgArticle; - - $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true ); - $s = " " . wfMsg( "lastmodified", $d ); + + $timestamp = $wgArticle->getTimestamp(); + if ( $timestamp ) { + $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true ); + $s = " " . wfMsg( "lastmodified", $d ); + } else { + $s = ""; + } return $s; } -- 2.20.1