if ( 0 == $id ) {
$sql = "SELECT DISTINCT bl_from FROM brokenlinks WHERE bl_to='" .
wfStrencode( $nt->getPrefixedDBkey() ) . "' LIMIT 500";
- $res = wfQuery( $sql, $fname );
+ $res = wfQuery( $sql, DB_READ, $fname );
if ( 0 == wfNumRows( $res ) ) {
$wgOut->addHTML( wfMsg( "nolinkshere" ) );
$lid = $row->bl_from;
$sql = "SELECT cur_namespace,cur_title,cur_is_redirect " .
"FROM cur WHERE cur_id={$lid}";
- $res2 = wfQuery( $sql, $fname );
+ $res2 = wfQuery( $sql, DB_READ, $fname );
$s = wfFetchObject( $res2 );
$n = Title::makeName( $s->cur_namespace, $s->cur_title );
$fname = "wfShowIndirectLinks";
$sql = "SELECT DISTINCT l_from FROM links WHERE l_to={$lid} LIMIT 500";
- $res = wfQuery( $sql, $fname );
+ $res = wfQuery( $sql, DB_READ, $fname );
if ( 0 == wfNumRows( $res ) ) {
if ( 0 == $level ) {
$sql = "SELECT cur_id,cur_is_redirect FROM cur " .
"WHERE cur_namespace={$ns} AND cur_title='{$t}'";
- $res2 = wfQuery( $sql, $fname );
+ $res2 = wfQuery( $sql, DB_READ, $fname );
$s = wfFetchObject( $res2 );
if ( 1 == $s->cur_is_redirect ) {
{
$sql = "SELECT cur_namespace,cur_title FROM cur WHERE " .
"cur_id={$id}";
- $res = wfQuery( $sql, "Article::nameOf" );
+ $res = wfQuery( $sql, DB_READ, "Article::nameOf" );
if ( 0 == wfNumRows( $res ) ) { return NULL; }
$s = wfFetchObject( $res );
$dkey = wfStrencode( $key );
$query = "SELECT iw_url FROM interwiki WHERE iw_prefix='$dkey'";
- $res = wfQuery( $query, "Title::getInterwikiLink" );
+ $res = wfQuery( $query, DB_READ, "Title::getInterwikiLink" );
if(!$res) return "";
$s = wfFetchObject( $res );
$ns = $this->getNamespace();
$t = wfStrencode( $this->getDBkey() );
$sql = "SELECT COUNT(*) AS n FROM archive WHERE ar_namespace=$ns AND ar_title='$t'";
- if( $res = wfQuery( $sql ) ) {
+ if( $res = wfQuery( $sql, DB_READ ) ) {
$s = wfFetchObject( $res );
return $s->n;
}
$nt = Title::newFromText( $name );
$sql = "SELECT user_id FROM user WHERE user_name='" .
wfStrencode( $nt->getText() ) . "'";
- $res = wfQuery( $sql, "User::idFromName" );
+ $res = wfQuery( $sql, DB_READ, "User::idFromName" );
if ( 0 == wfNumRows( $res ) ) { return 0; }
else {
$this->mNewtalk=0; # reset talk page status
if($this->mId) {
$sql = "SELECT 1 FROM user_newtalk WHERE user_id={$this->mId}";
- $res = wfQuery ($sql, "User::loadFromDatabase" );
+ $res = wfQuery ($sql, DB_READ, "User::loadFromDatabase" );
if (wfNumRows($res)>0) {
$this->mNewtalk= 1;
$newtalk = $wgMemc->get( $key );
if($newtalk === false) {
$sql = "SELECT 1 FROM user_newtalk WHERE user_ip='{$this->mName}'";
- $res = wfQuery ($sql, "User::loadFromDatabase" );
+ $res = wfQuery ($sql, DB_READ "User::loadFromDatabase" );
$this->mNewtalk = (wfNumRows($res)>0) ? 1 : 0;
wfFreeResult( $res );
$sql = "SELECT user_name,user_password,user_newpassword,user_email," .
"user_options,user_rights,user_touched FROM user WHERE user_id=" .
"{$this->mId}";
- $res = wfQuery( $sql, "User::loadFromDatabase" );
+ $res = wfQuery( $sql, DB_READ, "User::loadFromDatabase" );
if ( wfNumRows( $res ) > 0 ) {
$s = wfFetchObject( $res );
WHERE wl_user={$this->mId} AND
wl_namespace = " . ($title->getNamespace() & ~1) . " AND
wl_title='" . wfStrencode( $title->getDBkey() ) . "'";
- $res = wfQuery( $sql );
+ $res = wfQuery( $sql, DB_READ );
return (wfNumRows( $res ) > 0);
} else {
return false;
$sql = "REPLACE INTO watchlist (wl_user, wl_namespace,wl_title)
VALUES ({$this->mId}," . (($title->getNamespace() | 1) - 1) .
",'" . wfStrencode( $title->getDBkey() ) . "')";
- wfQuery( $sql );
+ wfQuery( $sql, DB_WRITE );
$this->invalidateCache();
}
}
$sql = "DELETE FROM watchlist WHERE wl_user={$this->mId} AND
wl_namespace=" . (($title->getNamespace() | 1) - 1) .
" AND wl_title='" . wfStrencode( $title->getDBkey() ) . "'";
- wfQuery( $sql );
+ wfQuery( $sql, DB_WRITE );
$this->invalidateCache();
}
}
if ( ! $this->mNewtalk ) {
if( $this->mId ) {
$sql="DELETE FROM user_newtalk WHERE user_id={$this->mId}";
- wfQuery ($sql,"User::saveSettings");
+ wfQuery ($sql, DB_WRITE, "User::saveSettings");
} else {
$sql="DELETE FROM user_newtalk WHERE user_ip='{$this->mName}'";
- wfQuery ($sql,"User::saveSettings");
+ wfQuery ($sql, DB_WRITE, "User::saveSettings");
$wgMemc->delete( "$wgDBname:newtalk:ip:{$this->mName}" );
}
}
"user_rights= '" . wfStrencode( implode( ",", $this->mRights ) ) . "', " .
"user_touched= '" . wfStrencode( $this->mTouched ) .
"' WHERE user_id={$this->mId}";
- wfQuery( $sql, "User::saveSettings" );
+ wfQuery( $sql, DB_WRITE, "User::saveSettings" );
#$wgMemc->replace( "$wgDBname:user:id:$this->mId", $this );
$wgMemc->delete( "$wgDBname:user:id:$this->mId" );
}
$sql = "SELECT user_id FROM user WHERE user_name='" .
wfStrencode( $s ) . "'";
- $res = wfQuery( $sql, "User::idForName" );
+ $res = wfQuery( $sql, DB_READ, "User::idForName" );
if ( 0 == wfNumRows( $res ) ) { return 0; }
$s = wfFetchObject( $res );
wfStrencode( $this->mEmail ) . "', '" .
wfStrencode( implode( ",", $this->mRights ) ) . "', '" .
$this->encodeOptions() . "')";
- wfQuery( $sql, "User::addToDatabase" );
+ wfQuery( $sql, DB_WRITE, "User::addToDatabase" );
$this->mId = $this->idForName();
}
}
if($sql && !$user->getNewtalk()) { # only insert if real user and it's not already there
- wfQuery( $sql, $fname );
+ wfQuery( $sql, DB_WRITE, $fname );
}
}
}
$sql = "UPDATE LOW_PRIORITY cur SET cur_counter=(1+cur_counter)," .
"cur_timestamp=cur_timestamp WHERE cur_id={$this->mPageID}";
- $res = wfQuery( $sql, "ViewCountUpdate::doUpdate" );
+ $res = wfQuery( $sql, DB_WRITE, "ViewCountUpdate::doUpdate" );
}
}
$fname = "Installation script: populatedata()";
$sql = "DELETE FROM site_stats";
- wfQuery( $sql, $fname );
+ wfQuery( $sql, DB_WRITE, $fname );
$sql = "INSERT INTO site_stats (ss_row_id,ss_total_views," .
"ss_total_edits,ss_good_articles) VALUES (1,0,0,0)";
- wfQuery( $sql, $fname );
+ wfQuery( $sql, DB_WRITE, $fname );
$sql = "DELETE FROM user";
- wfQuery( $sql, $fname );
+ wfQuery( $sql, DB_WRITE, $fname );
$u = User::newFromName( "WikiSysop" );
if ( 0 == $u->idForName() ) {
$dlp = addslashes( wfMsg( "dellogpage" ) );
$sql = "DELETE FROM cur";
- wfQuery( $sql, $fname );
+ wfQuery( $sql, DB_WRITE, $fname );
$sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
"cur_restrictions) VALUES ({$wns},'{$ulp}','" .
wfStrencode( wfMsg( "uploadlogpagetext" ) ) . "','sysop')";
- wfQuery( $sql );
+ wfQuery( $sql, DB_WRITE, $fname );
$sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
"cur_restrictions) VALUES ({$wns},'{$dlp}','" .
wfStrencode( wfMsg( "dellogpagetext" ) ) . "','sysop')";
- wfQuery( $sql );
+ wfQuery( $sql, DB_WRITE, $fname );
$sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text) " .
"VALUES (0,'" . wfStrencode( wfMsg( "mainpage" ) ) . "','" .
wfStrencode( wfMsg( "mainpagetext" ) ) . "')";
- wfQuery( $sql );
+ wfQuery( $sql, DB_WRITE, $fname );
}
?>
"Intl" => "Interlanguage links",
"Allpages" => "All pages by title",
- "Ipblocklist" => "Blocked IP addresses",
+ "Ipblocklist" => "Blocked users/IP addresses",
"Maintenance" => "Maintenance page",
"Specialpages" => "",
"Contributions" => "",
);
/* private */ $wgSysopSpecialPagesEn = array(
- "Blockip" => "Block an IP address",
+ "Blockip" => "Block a user/IP address",
"Asksql" => "Query the database",
"Undelete" => "Restore deleted pages"
);