global $wgDBname;
return "$wgDBname:watchlist:user:$this->id:page:$this->ns:$this->ti";
}
-
+
/**
* Is mTitle being watched by mUser?
*/
$key = $this->watchKey();
$iswatched = $wgMemc->get( $key );
if( is_integer( $iswatched ) ) return $iswatched;
-
+
$dbr =& wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'watchlist', 1, array( 'wl_user' => $this->id, 'wl_namespace' => $this->ns,
+ $res = $dbr->select( 'watchlist', 1, array( 'wl_user' => $this->id, 'wl_namespace' => $this->ns,
'wl_title' => $this->ti ), $fname );
$iswatched = ($dbr->numRows( $res ) > 0) ? 1 : 0;
$wgMemc->set( $key, $iswatched );
# accidentally reloads a watch-add operation.
$dbw =& wfGetDB( DB_MASTER );
$dbw->replace( 'watchlist', array(array('wl_user', 'wl_namespace', 'wl_title', 'wl_notificationtimestamp')),
- array(
+ array(
'wl_user' => $this->id,
'wl_namespace' => ($this->ns & ~1),
'wl_title' => $this->ti,
- 'wl_notificationtimestamp' => '0'
+ 'wl_notificationtimestamp' => NULL
), $fname );
# the following code compensates the new behaviour, introduced by the enotif patch,
'wl_user' => $this->id,
'wl_namespace' => ($this->ns | 1 ),
'wl_title' => $this->ti,
- 'wl_notificationtimestamp' => '0'
+ 'wl_notificationtimestamp' => NULL
), $fname );
global $wgMemc;
$success = false;
$dbw =& wfGetDB( DB_MASTER );
- $dbw->delete( 'watchlist',
- array(
- 'wl_user' => $this->id,
+ $dbw->delete( 'watchlist',
+ array(
+ 'wl_user' => $this->id,
'wl_namespace' => ($this->ns & ~1),
'wl_title' => $this->ti
), $fname
'wl_title' => $this->ti
), $fname
);
-
+
if ( $dbw->affectedRows() ) {
$success = true;
}
$dbw =& wfGetDB( DB_MASTER );
$watchlist = $dbw->tableName( 'watchlist' );
-
- $res = $dbw->select( 'watchlist', 'wl_user',
+
+ $res = $dbw->select( 'watchlist', 'wl_user',
array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ),
$fname, 'FOR UPDATE'
);