avoiding warnings when the article flag is set for things that aren't really articles
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 1 Apr 2004 12:46:31 +0000 (12:46 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 1 Apr 2004 12:46:31 +0000 (12:46 +0000)
includes/Skin.php

index 1400616..7f7ed17 100644 (file)
@@ -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;
        }