r10953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10952‎ | r10953 | r10954 >
Date:14:54, 8 September 2005
Author:avar
Status:old
Tags:
Comment:
* Optimizing by using User::edits() on includes
* Minor fixes
Modified paths:
  • /trunk/extensions/Editcount/SpecialEditcount.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Editcount/SpecialEditcount.php
@@ -16,7 +16,7 @@
1717 $wgExtensionFunctions[] = 'wfSpecialEditcount';
1818 $wgExtensionCredits['specialpage'][] = array(
1919 'name' => 'Editcount',
20 - 'author' => 'Ævar Arnfjörð Bjarmason',
 20+ 'author' => 'Ævar Arnfjörð Bjarmason'
2121 );
2222
2323 function wfSpecialEditcount() {
@@ -63,12 +63,10 @@
6464
6565 if ( $this->including() ) {
6666 if ( $namespace === null ) {
67 - if ($uid != 0) {
68 - $total = $this->getTotal( $this->editsByNs( $uid ) );
69 - $out = $wgContLang->formatNum( $total );
70 - } else {
 67+ if ($uid != 0)
 68+ $out = $wgContLang->formatNum( User::edits( $uid ) );
 69+ else
7170 $out = "";
72 - }
7371 } else {
7472 $out = $wgContLang->formatNum( $this->editsInNs( $uid, $namespace ) );
7573 }
@@ -155,7 +153,7 @@
156154 * @return string
157155 */
158156 function editsInNs( $uid, $ns ) {
159 - $fname = 'Editcount::editsInNn';
 157+ $fname = 'Editcount::editsInNs';
160158 $nscount = array();
161159
162160 $dbr =& wfGetDB( DB_SLAVE );
@@ -228,9 +226,7 @@
229227 }
230228 $out .="
231229 </table>
232 - </form>
233 - ";
234 -
 230+ </form>";
235231 $wgOut->addHTML( $out );
236232 }
237233

Status & tagging log