seconds in RC
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 3 Apr 2004 00:53:17 +0000 (00:53 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 3 Apr 2004 00:53:17 +0000 (00:53 +0000)
includes/DefaultSettings.php
includes/Skin.php
languages/Language.php

index cb7123f..5290a14 100644 (file)
@@ -290,4 +290,6 @@ if( !isset( $wgCommandLineMode ) ) {
        $wgCommandLineMode = false;
 }
 
+# Show seconds in Recent Changes
+$wgRCSeconds = false
 ?>
index fd67360..a002ee5 100644 (file)
@@ -1976,7 +1976,7 @@ class Skin {
 
        function recentChangesLineOld( &$rc, $watched = false )
        {
-               global $wgTitle, $wgLang, $wgUser;
+               global $wgTitle, $wgLang, $wgUser, $wgRCSeconds;
 
                # Extract DB fields into local scope
                extract( $rc->mAttribs );
@@ -2035,7 +2035,7 @@ class Skin {
                }
 
                # Timestamp
-               $s .= "; " . $wgLang->time( $rc_timestamp, true ) . " . . ";
+               $s .= "; " . $wgLang->time( $rc_timestamp, true, $wgRCSeconds ) . " . . ";
 
                # User link (or contributions for unregistered users)
                if ( 0 == $rc_user ) {
@@ -2081,7 +2081,7 @@ class Skin {
 #      function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
        function recentChangesLineNew( &$baseRC, $watched = false )
        {
-               global $wgTitle, $wgLang, $wgUser;
+               global $wgTitle, $wgLang, $wgUser, $wgRCSeconds;
 
                # Create a specialised object
                $rc = RCCacheEntry::newFromParent( $baseRC ) ;
@@ -2110,7 +2110,7 @@ class Skin {
                        $clink = $this->makeKnownLinkObj( $rc->getTitle(), "" ) ;
                }
                
-               $time = $wgLang->time( $rc_timestamp, true );
+               $time = $wgLang->time( $rc_timestamp, true, $wgRCSeconds );
                $rc->watched = $watched ;
                $rc->link = $clink ;
                $rc->timestamp = $time;
index 9a3433c..c8663ca 100644 (file)
@@ -1706,11 +1706,14 @@ class Language {
                }
        }
 
-       function time( $ts, $adj = false )
+       function time( $ts, $adj = false, $seconds = false )
        {
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
 
                $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
+               if ( $seconds ) { 
+                       $t .= ":" . substr( $ts, 12, 2 );
+               }
                return $this->formatNum( $t );
        }