$id = $this->getID();
if ( 0 == $id ) return;
- $s = $dbr->selectRow( 'cur', $this->getCurContentFields(), array( 'cur_id' => $id ), $fname,
+ $s = $dbr->selectRow( 'cur', $this->getCurContentFields(), array( 'cur_id' => $id ), $fname,
$this->getSelectOptions() );
if ( $s === false ) {
return;
}
$rid = $rt->getArticleID();
if ( 0 != $rid ) {
- $redirRow = $dbr->selectRow( 'cur', $this->getCurContentFields(),
+ $redirRow = $dbr->selectRow( 'cur', $this->getCurContentFields(),
array( 'cur_id' => $rid ), $fname, $this->getSelectOptions() );
if ( $redirRow !== false ) {
$this->mTitle->mRestrictions = explode( ',', trim( $s->cur_restrictions ) );
$this->mTitle->mRestrictionsLoaded = true;
} else { # oldid set, retrieve historical version
- $s = $dbr->getArray( 'old', $this->getOldContentFields(), array( 'old_id' => $oldid ),
+ $s = $dbr->getArray( 'old', $this->getOldContentFields(), array( 'old_id' => $oldid ),
$fname, $this->getSelectOptions() );
if ( $s === false ) {
return;
return false;
}
- $s = $dbr->selectRow( 'cur', $this->getCurContentFields(), array( 'cur_id' => $id ),
+ $s = $dbr->selectRow( 'cur', $this->getCurContentFields(), array( 'cur_id' => $id ),
$fname, $this->getSelectOptions() );
if ( $s === false ) {
return false;
if( $rt && $rt->getInterwiki() == '' && $rt->getNamespace() != NS_SPECIAL ) {
$rid = $rt->getArticleID();
if ( 0 != $rid ) {
- $redirRow = $dbr->selectRow( 'cur', $this->getCurContentFields(),
+ $redirRow = $dbr->selectRow( 'cur', $this->getCurContentFields(),
array( 'cur_id' => $rid ), $fname, $this->getSelectOptions() );
if ( $redirRow !== false ) {
$this->mTitle->mRestrictions = explode( ',', trim( $s->cur_restrictions ) );
$this->mTitle->mRestrictionsLoaded = true;
} else { # oldid set, retrieve historical version
- $s = $dbr->selectRow( 'old', $this->getOldContentFields(), array( 'old_id' => $oldid ),
+ $s = $dbr->selectRow( 'old', $this->getOldContentFields(), array( 'old_id' => $oldid ),
$fname, $this->getSelectOptions() );
if ( $s === false ) {
return false;
function forUpdate( $x = NULL ) {
return wfSetVar( $this->mForUpdate, $x );
}
-
+
# Get the database which should be used for reads
function &getDB() {
if ( $this->mForUpdate ) {
} else {
$options = 'FOR UPDATE';
}
- }
+ }
return $options;
}
-
+
function getID() {
if( $this->mTitle ) {
return $this->mTitle->getArticleID();
if ( -1 == $this->mCounter ) {
$id = $this->getID();
$dbr =& $this->getDB();
- $this->mCounter = $dbr->selectField( 'cur', 'cur_counter', 'cur_id='.$id,
+ $this->mCounter = $dbr->selectField( 'cur', 'cur_counter', 'cur_id='.$id,
'Article::getCount', $this->getSelectOptions() );
}
return $this->mCounter;
$sql .= ' '. $this->getSelectOptions();
$res = $dbr->query($sql, $fname);
-
+
while ( $line = $dbr->fetchObject( $res ) ) {
$contribs[] = array($line->old_user, $line->old_user_text, $line->user_real_name);
}
# Add link titles as META keywords
$wgOut->addMetaTags() ;
-
+
$this->viewUpdates();
wfProfileOut( $fname );
}
# The talk page isn't in the regular link tables, so we need to update manually:
$talkns = $ns ^ 1; # talk -> normal; normal -> talk
- $dbw->updateArray( 'cur', array('cur_touched' => $dbw->timestamp($now) ),
+ $dbw->updateArray( 'cur', array('cur_touched' => $dbw->timestamp($now) ),
array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname );
# standard deferred updates
# Add this page to my watchlist
-
+
function watch( $add = true ) {
global $wgUser, $wgOut, $wgLang;
global $wgDeferredUpdateList;
}
# Output protection confirmation dialog
-
+
function confirmProtect( $par, $reason, $limit = 'sysop' ) {
global $wgOut;
}
# UI entry point for page deletion
-
+
function delete() {
global $wgUser, $wgOut, $wgMessageCache, $wgRequest;
$fname = 'Article::delete';
}
# Output deletion confirmation dialog
-
+
function confirmDelete( $par, $reason ) {
global $wgOut;
# Perform a deletion and output success or failure messages
-
+
function doDelete( $reason ) {
global $wgOut, $wgUser, $wgLang;
$fname = 'Article::doDelete';
if ($exists < 1) {
$wgOut->addHTML( wfMsg('noarticletext') );
} else {
- $numwatchers = $dbr->selectField( 'watchlist', 'COUNT(*)', $wl_clause, $fname,
+ $numwatchers = $dbr->selectField( 'watchlist', 'COUNT(*)', $wl_clause, $fname,
$this->getSelectOptions() );
$wgOut->addHTML( "<ul><li>" . wfMsg("numwatchers", $numwatchers) . '</li>' );
$old = $dbr->selectField( 'old', 'COUNT(*)', $old_clause, $fname, $this->getSelectOptions() );
# - then, find the number of *other* authors in 'old'
# find 'cur' author
- $cur_author = $dbr->selectField( 'cur', 'cur_user_text', $cur_clause, $fname,
+ $cur_author = $dbr->selectField( 'cur', 'cur_user_text', $cur_clause, $fname,
$this->getSelectOptions() );
# find number of 'old' authors excluding 'cur' author
$cur_author = $dbr->selectField( 'cur', 'cur_user_text', $cur_clause, $fname,
$this->getSelectOptions() );
$authors = $dbr->selectField( 'cur', 'COUNT(DISTINCT old_user_text)',
- $old_clause + array( 'old_user_text<>' . $dbr->addQuotes( $cur_author ) ),
+ $old_clause + array( 'old_user_text<>' . $dbr->addQuotes( $cur_author ) ),
$fname, $this->getSelectOptions() );
$wgOut->addHTML( '<li>' . wfMsg('numtalkauthors', $authors) . '</li></ul>' );