# Variables beginning with 'o' for old article 'n' for new article
+ # Attempt to move the article
+
$ot = Title::newFromText( $this->oldTitle );
$nt = Title::newFromText( $this->newTitle );
return;
}
+ # Update counters if the article got moved in or out of NS_MAIN namespace
+ $ons = $ot->getNamespace();
+ $nns = $nt->getNamespace();
+
+ # moved out of article namespace ?
+ if ( $ons == NS_MAIN and $nns != NS_MAIN ) {
+ $u = new SiteStatsUpdate( 0, 1, -1); # not viewed, edited, removing
+ }
+ # moved in article namespace ?
+ elseif ( $ons != NS_MAIN and $nns == NS_MAIN ) {
+ $u = new SiteStatsUpdate( 0, 1, +1 ); # not viewed, edited, adding
+ }
+
+ # save it for later update
+ array_push( $wgDeferredUpdateList, $u );
+ unset($u);
+
# Move talk page if
# (1) the checkbox says to,
# (2) the namespaces are not themselves talk namespaces, and of course
# (3) it exists.
-
- $ons = $ot->getNamespace();
- $nns = $nt->getNamespace();
if ( ( $wgRequest->getVal('wpMovetalk') == 1 ) &&
( ! Namespace::isTalk( $ons ) ) &&