r37700 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37699‎ | r37700 | r37701 >
Date:16:10, 15 July 2008
Author:ashley
Status:old
Tags:
Comment:
Take $wgDBprefix into account
Modified paths:
  • /trunk/extensions/SocialProfile/UserStats/EditCount.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserStats/EditCount.php
@@ -15,13 +15,13 @@
1616 $wgHooks['ArticleDelete'][] = 'removeDeletedEdits';
1717
1818 function removeDeletedEdits(&$article, &$user, &$reason){
19 - global $wgUser, $wgTitle, $wgNamespacesForEditPoints;
 19+ global $wgUser, $wgTitle, $wgDBprefix, $wgNamespacesForEditPoints;
2020
2121 //only keep tally for allowable namespaces
2222 if( !is_array($wgNamespacesForEditPoints) || in_array( $wgTitle->getNamespace(), $wgNamespacesForEditPoints ) ){
2323
2424 $dbr = wfGetDB( DB_MASTER );
25 - $sql = "SELECT rev_user_text, rev_user, count(*) AS the_count FROM revision WHERE rev_page = {$article->getID()} AND rev_user <> 0 GROUP BY rev_user_text";
 25+ $sql = "SELECT rev_user_text, rev_user, count(*) AS the_count FROM ".$wgDBprefix."revision WHERE rev_page = {$article->getID()} AND rev_user <> 0 GROUP BY rev_user_text";
2626 $res = $dbr->query($sql);
2727 while ($row = $dbr->fetchObject( $res ) ) {
2828 $stats = new UserStatsTrack( $row->rev_user , $row->rev_user_text );
@@ -34,13 +34,13 @@
3535 $wgHooks['ArticleUndelete'][] = 'restoreDeletedEdits';
3636
3737 function restoreDeletedEdits(&$title, $new){
38 - global $wgUser, $wgNamespacesForEditPoints;
 38+ global $wgUser, $wgDBprefix, $wgNamespacesForEditPoints;
3939
4040 //only keep tally for allowable namespaces
4141 if( !is_array($wgNamespacesForEditPoints) || in_array( $title->getNamespace(), $wgNamespacesForEditPoints ) ){
4242
4343 $dbr = wfGetDB( DB_MASTER );
44 - $sql = "SELECT rev_user_text, rev_user, count(*) AS the_count FROM revision WHERE rev_page = {$title->getArticleID()} AND rev_user <> 0 GROUP BY rev_user_text";
 44+ $sql = "SELECT rev_user_text, rev_user, count(*) AS the_count FROM ".$wgDBprefix."revision WHERE rev_page = {$title->getArticleID()} AND rev_user <> 0 GROUP BY rev_user_text";
4545 $res = $dbr->query($sql);
4646 while ($row = $dbr->fetchObject( $res ) ) {
4747 $stats = new UserStatsTrack( $row->rev_user, $row->rev_user_text );

Status & tagging log