Пример #1
0
/**
 * constructor
 */
function wfSpecialWantedpages($par = null, $specialPage)
{
    $inc = $specialPage->including();
    if ($inc) {
        @(list($limit, $nlinks) = explode('/', $par, 2));
        $limit = (int) $limit;
        $nlinks = $nlinks === 'nlinks';
        $offset = 0;
    } else {
        list($limit, $offset) = wfCheckLimits();
        $nlinks = true;
    }
    $wpp = new WantedPagesPage($inc, $nlinks);
    $wpp->doQuery($offset, $limit, !$inc);
}
 public function getQueryInfo()
 {
     // oryginal query modyfied by hook WantedPages::getQueryInfo
     $query = parent::getQueryInfo();
     // extend the query with "exclude titles" option
     $excludes = array();
     foreach ($this->excludetitles as $title) {
         $excludes[] = " pl_title NOT LIKE '%" . trim($title) . "%' ";
     }
     if (is_array($excludes) && count($excludes) > 0) {
         $exclude = implode(" AND ", $excludes);
         $query['conds'][] = " (" . $exclude . ") ";
     }
     return $query;
 }
/**
 * constructor
 */
function wfSpecialWantedpages()
{
    list($limit, $offset) = wfCheckLimits();
    $wpp = new WantedPagesPage();
    $wpp->doQuery($offset, $limit);
}
<?php

//
// Refresh the cache of the Special:Wantedpages page.  To be called hourly.
//
define('WH_USE_BACKUP_DB', true);
require_once 'commandLine.inc';
$MAX_RESULTS = 1000000;
$included = false;
$nlinks = true;
$wpp = new WantedPagesPage($included, $links);
$wpp->recache($MAX_RESULTS);
$wpp = new DeadendPagesPage($included, $links);
$wpp->recache($MAX_RESULTS);