From: Tim Starling Date: Sat, 3 Apr 2004 00:53:17 +0000 (+0000) Subject: seconds in RC X-Git-Tag: 1.3.0beta1~632 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=d6273355514e8d6545eba50a03dc2bc6078d6ff2;p=lhc%2Fweb%2Fwiklou.git seconds in RC --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cb7123f6ff..5290a14db1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -290,4 +290,6 @@ if( !isset( $wgCommandLineMode ) ) { $wgCommandLineMode = false; } +# Show seconds in Recent Changes +$wgRCSeconds = false ?> diff --git a/includes/Skin.php b/includes/Skin.php index fd67360af5..a002ee5c25 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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; diff --git a/languages/Language.php b/languages/Language.php index 9a3433cdc1..c8663ca997 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 ); }