Index: trunk/extensions/SocialProfile/UserStats/EditCount.php |
— | — | @@ -15,13 +15,13 @@ |
16 | 16 | $wgHooks['ArticleDelete'][] = 'removeDeletedEdits'; |
17 | 17 | |
18 | 18 | function removeDeletedEdits(&$article, &$user, &$reason){ |
19 | | - global $wgUser, $wgTitle, $wgNamespacesForEditPoints; |
| 19 | + global $wgUser, $wgTitle, $wgDBprefix, $wgNamespacesForEditPoints; |
20 | 20 | |
21 | 21 | //only keep tally for allowable namespaces |
22 | 22 | if( !is_array($wgNamespacesForEditPoints) || in_array( $wgTitle->getNamespace(), $wgNamespacesForEditPoints ) ){ |
23 | 23 | |
24 | 24 | $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"; |
26 | 26 | $res = $dbr->query($sql); |
27 | 27 | while ($row = $dbr->fetchObject( $res ) ) { |
28 | 28 | $stats = new UserStatsTrack( $row->rev_user , $row->rev_user_text ); |
— | — | @@ -34,13 +34,13 @@ |
35 | 35 | $wgHooks['ArticleUndelete'][] = 'restoreDeletedEdits'; |
36 | 36 | |
37 | 37 | function restoreDeletedEdits(&$title, $new){ |
38 | | - global $wgUser, $wgNamespacesForEditPoints; |
| 38 | + global $wgUser, $wgDBprefix, $wgNamespacesForEditPoints; |
39 | 39 | |
40 | 40 | //only keep tally for allowable namespaces |
41 | 41 | if( !is_array($wgNamespacesForEditPoints) || in_array( $title->getNamespace(), $wgNamespacesForEditPoints ) ){ |
42 | 42 | |
43 | 43 | $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"; |
45 | 45 | $res = $dbr->query($sql); |
46 | 46 | while ($row = $dbr->fetchObject( $res ) ) { |
47 | 47 | $stats = new UserStatsTrack( $row->rev_user, $row->rev_user_text ); |