wfQuery now takes three parameters -- one extra for DB replication purposes
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Sep 2003 01:34:06 +0000 (01:34 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Sep 2003 01:34:06 +0000 (01:34 +0000)
18 files changed:
includes/ImagePage.php
includes/LinkCache.php
includes/LinksUpdate.php
includes/LogPage.php
includes/Math.php
includes/OutputPage.php
includes/SearchEngine.php
includes/SearchUpdate.php
includes/SiteStatsUpdate.php
includes/Skin.php
includes/SpecialAllpages.php
includes/SpecialAncientpages.php
includes/SpecialAsksql.php
includes/SpecialBooksources.php
includes/SpecialCategories.php
includes/SpecialContributions.php
includes/SpecialImagelist.php
includes/SpecialListusers.php

index e86efa1..300883f 100644 (file)
@@ -30,7 +30,7 @@ class ImagePage extends Article {
                $sql = "SELECT img_size,img_description,img_user," .
                  "img_user_text,img_timestamp FROM image WHERE " .
                  "img_name='" . wfStrencode( $this->mTitle->getDBkey() ) . "'";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
 
                if ( 0 == wfNumRows( $res ) ) { return; }
 
@@ -46,7 +46,7 @@ class ImagePage extends Article {
                  "oi_user_text,oi_timestamp,oi_archive_name FROM oldimage WHERE " .
                  "oi_name='" . wfStrencode( $this->mTitle->getDBkey() ) . "' " .
                  "ORDER BY oi_timestamp DESC";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
 
                while ( $line = wfFetchObject( $res ) ) {
                        $s .= $sk->imageHistoryLine( false, $line->oi_timestamp,
@@ -65,7 +65,7 @@ class ImagePage extends Article {
 
                $sql = "SELECT il_from FROM imagelinks WHERE il_to='" .
                  wfStrencode( $this->mTitle->getDBkey() ) . "'";
-               $res = wfQuery( $sql, "Article::imageLinks" );
+               $res = wfQuery( $sql, DB_READ, "Article::imageLinks" );
 
                if ( 0 == wfNumRows( $res ) ) {
                        $wgOut->addHtml( "<p>" . wfMsg( "nolinkstoimage" ) . "\n" );
@@ -137,18 +137,18 @@ class ImagePage extends Article {
                        }
                        $sql = "DELETE FROM image WHERE img_name='" .
                          wfStrencode( $image ) . "'";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
 
                        $sql = "SELECT oi_archive_name FROM oldimage WHERE oi_name='" .
                          wfStrencode( $image ) . "'";
-                       $res = wfQuery( $sql, $fname );
+                       $res = wfQuery( $sql, DB_READ, $fname );
 
                        while ( $s = wfFetchObject( $res ) ) {
                                $this->doDeleteOldImage( $s->oi_archive_name );
                        }       
                        $sql = "DELETE FROM oldimage WHERE oi_name='" .
                          wfStrencode( $image ) . "'";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
 
                        # Image itself is now gone, and database is cleaned.
                        # Now we remove the image description page.
@@ -161,7 +161,7 @@ class ImagePage extends Article {
                        $this->doDeleteOldImage( $oldimage );
                        $sql = "DELETE FROM oldimage WHERE oi_archive_name='" .
                          wfStrencode( $oldimage ) . "'";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
 
                        $deleted = $oldimage;
                } else {
index fdac736..379da89 100644 (file)
@@ -91,7 +91,7 @@ class LinkCache {
                if( $id === FALSE ) {
                        $sql = "SELECT HIGH_PRIORITY cur_id FROM cur WHERE cur_namespace=" .
                          "{$ns} AND cur_title='" . wfStrencode( $t ) . "'";
-                       $res = wfQuery( $sql, "LinkCache::addLink" );
+                       $res = wfQuery( $sql, DB_READ, "LinkCache::addLink" );
 
                        if ( 0 == wfNumRows( $res ) ) {
                                $id = 0;
@@ -115,7 +115,7 @@ class LinkCache {
                $sql = "SELECT HIGH_PRIORITY cur_id,cur_namespace,cur_title
                        FROM cur,links
                        WHERE cur_id=l_to AND l_from='{$dbkeyfrom}'";
-               $res = wfQuery( $sql, "LinkCache::preFill" );
+               $res = wfQuery( $sql, DB_READ, "LinkCache::preFill" );
                while( $s = wfFetchObject( $res ) ) {
                        $this->addGoodLink( $s->cur_id,
                                Title::makeName( $s->cur_namespace, $s->cur_title )
@@ -129,7 +129,7 @@ class LinkCache {
                $sql = "SELECT HIGH_PRIORITY bl_to
                        FROM brokenlinks
                        WHERE bl_from='{$id}'";
-               $res = wfQuery( $sql, "LinkCache::preFill" );
+               $res = wfQuery( $sql, DB_READ, "LinkCache::preFill" );
                while( $s = wfFetchObject( $res ) ) {
                        $this->addBadLink( $s->bl_to );
                }
index 2b30abb..de4b861 100644 (file)
@@ -32,7 +32,7 @@ class LinksUpdate {
 
                if( $wgDBtransactions ) {
                        $sql = "BEGIN";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
                
                #------------------------------------------------------------------------------
@@ -43,12 +43,12 @@ class LinksUpdate {
                        if ( count( $del ) ) {
                                $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}' AND l_to IN(".
                                        implode( ",", $del ) . ")";
-                               wfQuery( $sql, $fname );
+                               wfQuery( $sql, DB_WRITE, $fname );
                        }
                } else {
                        # Delete everything
                        $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                        
                        # Get the addition list
                        $add = $wgLinkCache->getGoodLinks();
@@ -68,7 +68,7 @@ class LinksUpdate {
                        }
                }
                if ( "" != $sql ) { 
-                       wfQuery( $sql, $fname ); 
+                       wfQuery( $sql, DB_WRITE, $fname ); 
                }
 
                #------------------------------------------------------------------------------
@@ -79,12 +79,12 @@ class LinksUpdate {
                        if ( count( $del ) ) {
                                $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId} AND bl_to IN('" .    
                                        implode( "','", $del ) . "')";
-                               wfQuery( $sql, $fname );
+                               wfQuery( $sql, DB_WRITE, $fname );
                        }
                } else {
                        # Delete all
                        $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                        
                        # Get addition list
                        $add = $wgLinkCache->getBadLinks();
@@ -104,13 +104,13 @@ class LinksUpdate {
                        }
                }
                if ( "" != $sql ) { 
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
 
                #------------------------------------------------------------------------------
                # Image links
                $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
                
                # Get addition list
                $add = $wgLinkCache->getImageLinks();
@@ -128,13 +128,13 @@ class LinksUpdate {
                                $sql .= "('{$this->mTitleEnc}','{$iname}')";
                        }
                }
-               if ( "" != $sql ) { wfQuery( $sql, $fname ); }
+               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
 
                $this->fixBrokenLinks();
 
                if( $wgDBtransactions ) {
                        $sql = "COMMIT";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
                wfProfileOut();
        }
@@ -149,11 +149,11 @@ class LinksUpdate {
 
                if( $wgDBtransactions ) {
                        $sql = "BEGIN";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
                
                $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $a = $wgLinkCache->getGoodLinks();
                $sql = "";
@@ -167,10 +167,10 @@ class LinksUpdate {
                                $sql .= "('{$this->mTitleEnc}',{$lid})";
                        }
                }
-               if ( "" != $sql ) { wfQuery( $sql, $fname ); }
+               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
 
                $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $a = $wgLinkCache->getBadLinks();
                $sql = "";
@@ -185,10 +185,10 @@ class LinksUpdate {
                                $sql .= "({$this->mId},'{$blt}')";
                        }
                }
-               if ( "" != $sql ) { wfQuery( $sql, $fname ); }
+               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
                
                $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $a = $wgLinkCache->getImageLinks();
                $sql = "";
@@ -203,13 +203,13 @@ class LinksUpdate {
                                $sql .= "('{$this->mTitleEnc}','{$iname}')";
                        }
                }
-               if ( "" != $sql ) { wfQuery( $sql, $fname ); }
+               if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); }
 
                $this->fixBrokenLinks();
 
                if( $wgDBtransactions ) {
                        $sql = "COMMIT";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
                wfProfileOut();
        }
@@ -219,7 +219,7 @@ class LinksUpdate {
                /* Call for a newly created page, or just to make sure state is consistent */
                
                $sql = "SELECT bl_from FROM brokenlinks WHERE bl_to='{$this->mTitleEnc}'";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
                if ( 0 == wfNumRows( $res ) ) { return; }
 
                $sql = "INSERT INTO links (l_from,l_to) VALUES ";
@@ -235,11 +235,11 @@ class LinksUpdate {
                        $sql2 .= $row->bl_from;
                }
                $sql2 .= ")";
-               wfQuery( $sql, $fname );
-               wfQuery( $sql2, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
+               wfQuery( $sql2, DB_WRITE, $fname );
 
                $sql = "DELETE FROM brokenlinks WHERE bl_to='{$this->mTitleEnc}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
        }
        
 }
index 08ad054..a2d5e92 100644 (file)
@@ -21,7 +21,7 @@ class LogPage {
                $sql = "SELECT cur_id,cur_text,cur_timestamp FROM cur " .
                        "WHERE cur_namespace=" . Namespace::getWikipedia() . " AND " .
                        "cur_title='" . wfStrencode($this->mTitle ) . "'";
-               $res = wfQuery( $sql, "LogPage::getContent" );
+               $res = wfQuery( $sql, DB_READ, "LogPage::getContent" );
 
                if( wfNumRows( $res ) > 0 ) {
                        $s = wfFetchObject( $res );
@@ -67,7 +67,7 @@ class LogPage {
                                wfStrencode( $this->mTitle ) . "', '" .
                                wfStrencode( $this->mContent ) . "', '" .
                                wfStrencode( $this->mComment ) . "', 'sysop', '{$won}','{$now}')";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                        $this->mId = wfInsertId();
                } else {
                        $sql = "UPDATE cur SET cur_timestamp='{$now}', " .
@@ -76,7 +76,7 @@ class LogPage {
                          "cur_comment='" . wfStrencode( $this->mComment ) . "', " .
                          "cur_restrictions='sysop', inverse_timestamp='{$won}', cur_touched='{$now}' " .
                          "WHERE cur_id={$this->mId}";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
                
                # And update recentchanges
@@ -86,7 +86,7 @@ class LogPage {
                        rc_cur_id) VALUES ('{$now}','{$now}',{$uid},'{$ut}',4,'" .
                                wfStrencode( $this->mTitle ) . "','" .
                                wfStrencode( $this->mComment ) . "',{$this->mId})";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                        }
                return true;
        }
index 60fe6a8..3479a99 100644 (file)
@@ -25,7 +25,7 @@ function renderMath( $tex )
     else
        $sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM math WHERE math_inputhash = '".$md5_sql."'";
 
-    $res = wfQuery( $sql, $fname );
+    $res = wfQuery( $sql, DB_READ, $fname );
     if ( wfNumRows( $res ) == 0 )
     {
        $cmd = "./math/texvc ".escapeshellarg($wgTmpDirectory)." ".
@@ -94,7 +94,7 @@ function renderMath( $tex )
 
        $sql = "REPLACE INTO math VALUES ('".$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html.", ".$sql_mathml.")";
        
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_WRITE, $fname );
        # we don't really care if it fails
 
        if (($math == 0) || ($rpage->math_html == '') || (($math == 1) && ($conservativeness != 2)) || (($math == 4) && ($conservativeness == 0)))
index 2fd15de..3919d21 100644 (file)
@@ -561,7 +561,7 @@ class OutputPage {
                global $wgUser ;
                $sk = $wgUser->getSkin() ;
                $sql = "SELECT l_from FROM links WHERE l_to={$id}" ;
-               $res = wfQuery ( $sql ) ;
+               $res = wfQuery ( $sql, DB_READ ) ;
                while ( $x = wfFetchObject ( $res ) )
                {
                #  $t = new Title ; 
index 210286e..314cf3f 100644 (file)
@@ -175,7 +175,7 @@ class SearchEngine {
                  "WHERE cur_id=si_page AND {$this->mTitlecond} " .
                  "{$searchnamespaces} {$redircond}" .
                  "LIMIT {$offset}, {$limit}";
-               $res1 = wfQuery( $sql, $fname );
+               $res1 = wfQuery( $sql, DB_READ, $fname );
                $num = wfNumRows($res1);
 
                if ( $wgDisableTextSearch ) {
@@ -186,7 +186,7 @@ class SearchEngine {
                          "WHERE cur_id=si_page AND {$this->mTextcond} " .
                          "{$searchnamespaces} {$redircond} " .
                          "LIMIT {$offset}, {$limit}";
-                       $res2 = wfQuery( $sql, $fname );
+                       $res2 = wfQuery( $sql, DB_READ, $fname );
                        $num = $num + wfNumRows($res2);
                }
 
@@ -422,7 +422,7 @@ class SearchEngine {
                  "WHERE cur_id=si_page AND {$this->mTitlecond} ORDER BY cur_namespace LIMIT 1";
 
                if ( "" != $this->mTitlecond ) {
-                       $res = wfQuery( $sql, $fname );
+                       $res = wfQuery( $sql, DB_READ, $fname );
                }                               
                if ( isset( $res ) && 0 != wfNumRows( $res ) ) {
                        $s = wfFetchObject( $res );
index 9e9ff2a..f77ba41 100644 (file)
@@ -28,7 +28,7 @@ class SearchUpdate {
                        $sql = "UPDATE LOW_PRIORITY searchindex SET si_title='" .
                          wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) .
                          "' WHERE si_page={$this->mId}";
-                       wfQuery( $sql, "SearchUpdate::doUpdate" );
+                       wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" );
                        return;
                }
                
@@ -71,7 +71,7 @@ class SearchUpdate {
                $sql = "REPLACE DELAYED INTO searchindex (si_page,si_title,si_text) VALUES ({$this->mId},'" .
                  wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "','" .
                  wfStrencode( $text ) . "')";
-               wfQuery( $sql, "SearchUpdate::doUpdate" );
+               wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" );
        }
 }
 
index 61ca846..f8ab804 100644 (file)
@@ -33,7 +33,7 @@ class SiteStatsUpdate {
 
                $sql = "UPDATE LOW_PRIORITY site_stats SET " . implode ( ",", $a ) .
                  " WHERE ss_row_id=1";
-               wfQuery( $sql, "SiteStatsUpdate::doUpdate" );
+               wfQuery( $sql, DB_WRITE, "SiteStatsUpdate::doUpdate" );
        }
 }
 
index dc6886c..2ea643d 100644 (file)
@@ -6,7 +6,7 @@
 # Language class has internationalized names
 #
 /* private */ $wgValidSkinNames = array(
-       "Standard", "Nostalgia", "CologneBlue", "Smarty", "Montparnasse"
+       "Standard", "Nostalgia", "CologneBlue" #, "Smarty", "Montparnasse"
 );
 
 # For some odd PHP bug, this function can't be part of a class
@@ -1140,7 +1140,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
                } else {
                        $threshold = $wgUser->getOption("stubthreshold") ;
                        if ( $threshold > 0 ) {
-                               $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
+                               $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'", DB_READ ) ;
 
                                if ( wfNumRows( $res ) > 0 ) {
                                        $s = wfFetchObject( $res );
@@ -1812,6 +1812,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
 include_once( "SkinStandard.php" );
 include_once( "SkinNostalgia.php" );
 include_once( "SkinCologneBlue.php" );
-include_once( "SkinSmarty.php" );
+
+#include_once( "SkinSmarty.php" );
 
 ?>
index 8ba8225..2e01937 100644 (file)
@@ -37,13 +37,13 @@ function indexShowToplevel()
        $out = "";
        
        $sql = "SELECT COUNT(*) AS count $fromwhere";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $s = wfFetchObject( $res );
        $count = $s->count;
        $sections = ceil( $count / $indexMaxperpage );
        
        $sql = "SELECT cur_title $fromwhere $order LIMIT 1";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $s = wfFetchObject( $res );
        $inpoint = $s->cur_title;
        
@@ -52,7 +52,7 @@ function indexShowToplevel()
        for( $i = 1; $i < $sections; $i++ ) {
                $from = $i * $indexMaxperpage;
                $sql = "SELECT cur_title $fromwhere $order LIMIT $from,2";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
        
                $s = wfFetchObject( $res );
                $outpoint = $s->cur_title;
@@ -66,7 +66,7 @@ function indexShowToplevel()
        
        $from = $i * $indexMaxperpage;
        $sql = "SELECT cur_title $fromwhere $order LIMIT " . ($count-1) . ",1";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $s = wfFetchObject( $res );
        $outpoint = $s->cur_title;
        $out .= indexShowline( $inpoint, $outpoint );
@@ -106,7 +106,7 @@ FROM cur
 WHERE cur_namespace=0 AND cur_title >= '" . wfStrencode( $from ) . "'
 ORDER BY cur_title
 LIMIT {$indexMaxperpage}";
-       $res = wfQuery( $sql, "indexShowChunk" );
+       $res = wfQuery( $sql, DB_READ, "indexShowChunk" );
 
        # FIXME: Dynamic column widths, backlink to main list,
        # side links to next and previous
index 95f8334..60c736a 100644 (file)
@@ -11,7 +11,7 @@ function wfSpecialAncientpages()
          "cur_timestamp FROM cur USE INDEX (cur_timestamp) " .
          "WHERE cur_namespace=0 AND cur_is_redirect=0 " .
          " ORDER BY cur_timestamp LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = wfShowingResults( $offset, $limit );
        $wgOut->addHTML( "<p>{$top}\n" );
index 062e1c1..5466dad 100644 (file)
@@ -72,7 +72,7 @@ class SqlQueryForm {
                        $connection = wfGetDB( $wgDBsqluser, $wgDBsqlpassword );
                }
                $this->logQuery( $wpSqlQuery );
-               $res = wfQuery( $wpSqlQuery, "SpecialAsksql::doSubmit" );
+               $res = wfQuery( $wpSqlQuery, DB_READ, "SpecialAsksql::doSubmit" );
                $this->logFinishedQuery();
 
                $n = 0;
index b1ae00f..c7630f5 100644 (file)
@@ -34,7 +34,7 @@ class BookSourceList {
                        $sql = "SELECT cur_text FROM cur " .
                                "WHERE cur_namespace=4 and cur_title='" .
                                wfStrencode( $bstitle->getDBkey() ) . "'";
-                       $res = wfQuery( $sql, $fname );
+                       $res = wfQuery( $sql, DB_READ, $fname );
                        if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) {       
                                $bstext = $s->cur_text;
                                $bstext = str_replace( "MAGICNUMBER", $this->mIsbn, $bstext );
index 831cc9b..c23dc08 100644 (file)
@@ -10,7 +10,7 @@ function wfSpecialCategories()
        $r .= "<OL>\n" ;
        $cat = ucfirst ( wfMsg ( "category" ) ) ;
        $sql = "SELECT cur_title FROM cur WHERE cur_title LIKE \"{$cat}:%\"" ;
-       $res = wfQuery ( $sql ) ;
+       $res = wfQuery ( $sql, DB_READ ) ;
        while ( $x = wfFetchObject ( $res ) )
          {
            $t = explode ( ":" , $x->cur_title , 2 ) ;
@@ -24,7 +24,7 @@ function wfSpecialCategories()
 
        $r .= "<hr>\n" ;
        $sql = "SELECT DISTINCT bl_to FROM brokenlinks WHERE bl_to LIKE \"{$cat}:%\"" ;
-       $res = wfQuery ( $sql ) ;
+       $res = wfQuery ( $sql, DB_READ ) ;
        $r .= "<OL>\n" ;
        while ( $x = wfFetchObject ( $res ) )
          {
index fc88af8..d25a0ac 100644 (file)
@@ -49,20 +49,20 @@ function wfSpecialContributions( $par = "" )
                $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment FROM cur " .
                  "WHERE cur_user_text='" . wfStrencode( $nt->getText() ) . "' {$cmq} " .
                  "ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}";
-               $res1 = wfQuery( $sql, $fname );
+               $res1 = wfQuery( $sql, DB_READ, $fname );
 
                $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment FROM old " .
                  "WHERE old_user_text='" . wfStrencode( $nt->getText() ) . "' {$omq} " .
                  "ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}";
-               $res2 = wfQuery( $sql, $fname );
+               $res2 = wfQuery( $sql, DB_READ, $fname );
        } else {
                $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment FROM cur " .
                  "WHERE cur_user={$id} {$cmq} ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}";
-               $res1 = wfQuery( $sql, $fname );
+               $res1 = wfQuery( $sql, DB_READ, $fname );
 
                $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment FROM old " .
                  "WHERE old_user={$id} {$omq} ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}";
-               $res2 = wfQuery( $sql, $fname );
+               $res2 = wfQuery( $sql, DB_READ, $fname );
        }
        $nCur = wfNumRows( $res1 );
        $nOld = wfNumRows( $res2 );
index 4c02240..2b0a49f 100644 (file)
@@ -85,7 +85,7 @@ function wfSpecialImagelist()
        $text = str_replace( "$2", $bydate, $text );
        $wgOut->addHTML( "{$text}<br>\n<p>" );
 
-       $res = wfQuery( $sql, "wfSpecialImagelist" );
+       $res = wfQuery( $sql, DB_READ, "wfSpecialImagelist" );
        while ( $s = wfFetchObject( $res ) ) {
                $name = $s->img_name;
                $ut = $s->img_user_text;
index 7fb1bf0..629776f 100644 (file)
@@ -15,7 +15,7 @@ function wfSpecialListusers()
 
        $sql = "SELECT user_name,user_rights FROM user ORDER BY " .
          "user_name LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, "wfSpecialListusers" );
+       $res = wfQuery( $sql, DB_READ, "wfSpecialListusers" );
 
        $sk = $wgUser->getSkin();
        while ( $s = wfFetchObject( $res ) ) {