/**	
  * hasProblems
  * (returns TRUE if there's a problem)
  * - Checks an article to see if it contains an image in the intro section
  * - Checks to see if there's a {{nointroimg}} template
  * - Checks to see if there's an {{nfd}} template
  * - Checks to see if there's an {{copyvio}} template
  * - Checks to see if there's an {{copyviobot}} template
  * - Makes sure an article has been NABbed
  * - Makes sure last edit has been patrolled
  **/
 function hasProblems($t, $dbr)
 {
     $r = Revision::newFromTitle($t);
     $intro = Article::getSection($r->getText(), 0);
     //check for intro image
     if (preg_match('/\\[\\[Image:(.*?)\\]\\]/', $intro)) {
         return true;
     }
     //check for {{nointroimg}} template
     if (preg_match('/{{nointroimg/', $intro)) {
         return true;
     }
     //check for {{nfd}} template
     if (preg_match('/{{nfd/', $intro)) {
         return true;
     }
     //check for {{copyvio}} or {{copyviobot}} template
     if (preg_match('/{{copyvio/', $intro)) {
         return true;
     }
     //is it NABbed?
     $is_nabbed = Newarticleboost::isNABbed($dbr, $t->getArticleId());
     if (!$is_nabbed) {
         return true;
     }
     //last edit patrolled?
     if (!GoodRevision::patrolledGood($t)) {
         return true;
     }
     //all clear?
     return false;
 }
 function getLastGoodRevision($aid)
 {
     $t = Title::newFromId($aid);
     $r = null;
     if (GoodRevision::patrolledGood($t)) {
         $gr = GoodRevision::newFromTitle($t, $aid);
         $r = Revision::newFromId($gr->latestGood());
     }
     return $r;
 }
Exemplo n.º 3
0
 /**	
  * hasProblems
  * (returns TRUE if there's a problem)
  * - Makes sure last edit has been patrolled
  **/
 function hasProblems($pageid)
 {
     if (empty($pageid)) {
         return true;
     }
     $t = Title::newFromId($pageid);
     if (!$t) {
         return true;
     }
     //last edit patrolled?
     if (!GoodRevision::patrolledGood($t)) {
         return true;
     }
     //all clear?
     return false;
 }
Exemplo n.º 4
0
 function getNextArticleId()
 {
     global $wgMemc;
     $key = $this->pageIdsKey;
     $pageIds = $wgMemc->get($key);
     if (empty($pageIds) || $this->fetchMoreArticleIds()) {
         $pageIds = $this->getUncategorizedPageIds();
         $wgMemc->set($key, $pageIds, $this->oneWeek);
         // Remove old inuse article ids
         $wgMemc->set($this->inUseKey, array(), $this->halfHour);
     }
     $pageId = -1;
     foreach ($pageIds as $page) {
         try {
             if (!$this->skipped($page) && !$this->inUse($page) && GoodRevision::patrolledGood(Title::newFromId($page))) {
                 $this->markInUse($page);
                 $pageId = $page;
                 break;
             }
         } catch (Exception $e) {
             $this->skip($page);
             continue;
         }
     }
     return $pageId;
 }