function wfSpecialImagecounter($par) { global $wgRequest, $wgSitename, $wgLanguageCode; global $wgDeferredUpdateList, $wgOut; $wgOut->setSyndicated(true); $fname = "wfSpecialImagecounter"; $id = $wgRequest->getVal("id"); $t = Title::newFromID($id); if ($t != null) { Article::incViewCount($t->getArticleID()); } else { error_log("Imagecounter didn't get anything for {$id}"); } $u = new SiteStatsUpdate(1, 0, 0); array_push($wgDeferredUpdateList, $u); $wgOut->disable(); }
/** * Do standard deferred updates after page view */ public function viewUpdates() { global $wgDeferredUpdateList, $wgDisableCounters, $wgUser; if (wfReadOnly()) { return; } # Don't update page view counters on views from bot users (bug 14044) if (!$wgDisableCounters && !$wgUser->isAllowed('bot') && $this->getID()) { Article::incViewCount($this->getID()); $u = new SiteStatsUpdate(1, 0, 0); array_push($wgDeferredUpdateList, $u); } # Update newtalk / watchlist notification status $wgUser->clearNotification($this->mTitle); }
/** * Do standard deferred updates after page view * @private */ function viewUpdates() { global $wgDeferredUpdateList; if (0 != $this->getID()) { global $wgDisableCounters; if (!$wgDisableCounters) { Article::incViewCount($this->getID()); $u = new SiteStatsUpdate(1, 0, 0); array_push($wgDeferredUpdateList, $u); } } # Update newtalk / watchlist notification status global $wgUser; $wgUser->clearNotification($this->mTitle); }
/** * Do standard deferred updates after page view * @private */ function viewUpdates() { global $wgDeferredUpdateList; if (0 != $this->getID()) { global $wgDisableCounters; if (!$wgDisableCounters) { Article::incViewCount($this->getID()); $u = new SiteStatsUpdate(1, 0, 0); array_push($wgDeferredUpdateList, $u); } } # Update newtalk status if user is reading their own # talk page global $wgUser; global $wgShowNewtalkForUserOrUserTalkPage; if ($wgShowNewtalkForUserOrUserTalkPage) { # We need to check both the user_talk and user page for pending updates # If nothing is pending, then we clear the newtalk flag if ($this->mTitle->getText() == $wgUser->getName()) { if ($this->mTitle->getNamespace() == NS_USER_TALK && !$wgUser->checkNotificationPendingForArticleOrTalk($this->mTitle, NS_USER, $lvr) || $this->mTitle->getNamespace() == NS_USER && !$wgUser->checkNotificationPendingForArticleOrTalk($this->mTitle, NS_USER_TALK, $lvr)) { $wgUser->setNewtalk(0); $wgUser->saveNewtalk(); } } } else { if ($this->mTitle->getNamespace() == NS_USER_TALK && $this->mTitle->getText() == $wgUser->getName()) { $wgUser->setNewtalk(0); $wgUser->saveNewtalk(); } } $wgUser->clearNotification($this->mTitle); }
/** * Do standard deferred updates after page view * @private */ function viewUpdates() { global $wgDeferredUpdateList, $wgUseEnotif; if (0 != $this->getID()) { global $wgDisableCounters; if (!$wgDisableCounters) { Article::incViewCount($this->getID()); $u = new SiteStatsUpdate(1, 0, 0); array_push($wgDeferredUpdateList, $u); } } # Update newtalk status if user is reading their own # talk page if (!wfRunHooks('UserClearNewTalkNotification', array(&$this))) { return; } global $wgUser; if (wfRunHooks('ArticleEditUpdateNewTalk', array(&$this))) { if ($this->mTitle->getNamespace() == NS_USER_TALK && $this->mTitle->getText() == $wgUser->getName()) { if ($wgUseEnotif) { require_once 'UserTalkUpdate.php'; $u = new UserTalkUpdate(0, $this->mTitle->getNamespace(), $this->mTitle->getDBkey(), false, false, false); } else { $wgUser->setNewtalk(0); $wgUser->saveNewtalk(); } } elseif ($wgUseEnotif) { $wgUser->clearNotification($this->mTitle); } } }