示例#1
0
 private function downVote()
 {
     $pageId = $this->getRequest()->getVal('pageId');
     if (!$pageId) {
         MWDebug::warning("no pageId to downvote");
         return;
     }
     UCIPatrol::downVoteItem($pageId);
     $this->recordImageVote($this->getUser(), $pageId, -1);
     // check if the image has enough votes that it will be removed from queue
     $table = "user_completed_images";
     $dbr = wfGetDB(DB_SLAVE);
     $row = $dbr->selectRow($table, array("uci_image_name", "uci_article_name", "uci_downvotes"), array("uci_article_id" => $pageId), __METHOD__);
     $title = Title::newFromText($this->getRequest()->getVal("articleTitle"));
     if ($row->uci_downvotes < UCIPatrol::UCI_DOWNVOTES) {
         UCIPatrol::logUCIDownVote($title, $pageId);
     } else {
         UCIPatrol::logUCIRejected($title, $pageId);
     }
     $this->skip();
 }