* (bug 9628) Show warnings about slave lag on Special:Contributions, Special:Watchlis...
authorRob Church <robchurch@users.mediawiki.org>
Fri, 18 May 2007 20:17:53 +0000 (20:17 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 18 May 2007 20:17:53 +0000 (20:17 +0000)
* A little release notes tweaking

RELEASE-NOTES
includes/DefaultSettings.php
includes/OutputPage.php
includes/SpecialContributions.php
includes/SpecialWatchlist.php
languages/messages/MessagesEn.php
skins/monobook/main.css

index 1533729..26e7b03 100644 (file)
@@ -20,15 +20,17 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 
 == Configuration changes since 1.10 ==
 
-
 == New features since 1.10 ==
 
 * (bug 8868) Separate "blocked" message for autoblocks
 * Adding expiry of block to block messages
 * Bulk mail options ($wgEnotifImpersonal, $wgEnotifUseJobQ) for large sites
-* Links to redirect pages in categories are wrapped in <span
-  class="redirect-in-category"></span>
-* New hook "ImageOpenShowImageInlineBefore" in ImagePage.php in openShowImage()
+* Links to redirect pages in categories are wrapped in
+  <span class="redirect-in-category"></span>
+* Introduced 'ImageOpenShowImageInlineBefore' hook; see docs/hooks.txt for
+  more information
+* (bug 9628) Show warnings about slave lag on Special:Contributions,
+  Special:Watchlist
   
 == Bugfixes since 1.10 ==
 
index de3cdaa..a4ea590 100644 (file)
@@ -1125,7 +1125,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '71';
+$wgStyleVersion = '72';
 
 
 # Server-side caching:
index 42c1b4c..397d521 100644 (file)
@@ -1233,5 +1233,21 @@ class OutputPage {
        public function showNewSectionLink() {
                return $this->mNewSectionLink;
        }
+       
+       /**
+        * Show a warning about slave lag
+        *
+        * If the lag is higher than 30 seconds, then the warning is
+        * a bit more obvious
+        *
+        * @param int $lag Slave lag
+        */
+       public function showLagWarning( $lag ) {
+               $message = $lag >= 30 ? 'lag-warn-high' : 'lag-warn-normal';
+               $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) );
+               $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
+       }
+       
 }
-?>
+
+?>
\ No newline at end of file
index c3db78b..d2d9b03 100644 (file)
@@ -157,6 +157,16 @@ class ContribsPager extends IndexPager {
                wfProfileOut( __METHOD__ );
                return $ret;
        }
+       
+       /**
+        * Get the Database object in use
+        *
+        * @return Database
+        */
+       public function getDatabase() {
+               return $this->mDb;
+       }
+       
 }
 
 /**
@@ -226,6 +236,11 @@ function wfSpecialContributions( $par = null ) {
                $wgOut->addWikiText( wfMsg( 'nocontribs' ) );
                return;
        }
+
+       # Show a message about slave lag, if applicable
+       if( ( $lag = $pager->getDatabase()->getLag() ) > 0 )
+               $wgOut->showLagWarning( $lag );
+
        $wgOut->addHTML( 
                '<p>' . $pager->getNavigationBar() . '</p>' .
                $pager->getBody() .
index 2e660bd..403ee8f 100644 (file)
@@ -267,6 +267,10 @@ function wfSpecialWatchlist( $par ) {
                $wgLang->formatNum( $npages ), '',
                $specialTitle->getFullUrl( 'edit=yes' ) );
        $wgOut->addWikiText( $header );
+       
+       # Show a message about slave lag, if applicable
+       if( ( $lag = $dbr->getLag() ) > 0 )
+               $wgOut->showLagWarning( $lag );
 
        if ( $wgEnotifWatchlist && $wgShowUpdatedMarker ) {
                $wgOut->addHTML( '<form action="' .
index 642da27..6481858 100644 (file)
@@ -2915,6 +2915,11 @@ Please confirm that really want to recreate this page.',
 'livepreview-failed'  => "Live preview failed!\nTry normal preview.",
 'livepreview-error'   => "Failed to connect: $1 \"$2\"\nTry normal preview.",
 
+# Friendlier slave lag warnings
+'lag-warn-normal' => 'Changes newer than $1 seconds may not be shown in this list.',
+'lag-warn-high' => 'Due to high database server lag, changes newer than $1 seconds
+may not be shown in this list.',
+
 );
 
 ?>
index 3198330..4b9dd35 100644 (file)
@@ -1593,6 +1593,24 @@ p.mw-ipb-conveniencelinks {
        float: right;
 }
 
+/* Friendlier slave lag warnings */
+div.mw-lag-warn-normal,
+div.mw-lag-warn-high {
+       width: 75%;
+       padding: 3px;
+       text-align: center;
+       margin: 3px auto;
+}
+div.mw-lag-warn-normal {
+       border: 1px solid #FFCC66;
+       background-color: #FFFFCC;
+}
+div.mw-lag-warn-high {
+       font-weight: bold;
+       border: 2px solid #CC3333;
+       background-color: #CC9999;
+}
+
 /**
  * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS.
  * When the day comes, it can be moved to a *real* common.css.