示例#1
0
文件: api.php 项目: JackPotte/xtools
    true
);*/
$dbInfo = $fnc->getDBInfo($lang, $wiki);
if (isset($dbInfo['error'])) {
    toDie($phptemp->getConf('nowiki', $url));
}
$wgDBname = $dbInfo['dbname'];
$wgDBserver = $dbInfo['server'];
$dbr = new Database($wgDBserver, $wgDBPort, $wgDBUser, $wgDBPass, $wgDBname, true);
$wgNamespaces = $fnc->getNamespaces('enwiki_p');
$cnt = new Counter($name);
$final_array = array('query' => array('count' => array()));
$retUser = $cnt->getName();
$retIP = $cnt->getIP() ? "true" : "false";
$retExists = $cnt->getExists() ? "true" : "false";
$retUID = $cnt->getUID();
$retDeleted = intval($cnt->getDeleted());
$retLive = intval($cnt->getLive());
$retTotal = intval($cnt->getTotal());
$retGroupList = $cnt->getGroupList();
$retGroupList['_element'] = 'g';
//$retUniqueArticles = $cnt->getUniqueArticles();
//$retUniqueArticleCount = number_format( count($retUniqueArticles['total']) );
$retFirstEdit = $cnt->getFirstEdit();
$retAveragePageEdits = $cnt->getAveragePageEdits();
$retMonthTotals = $cnt->getMonthTotals();
$retNamespaceTotals = $cnt->getNamespaceTotals();
$retOptedIn = $http->getWhichOptIn($cnt->getName());
$final_array['query']['count']['username'] = $retUser;
$final_array['query']['count']['is_ip'] = $retIP;
$final_array['query']['count']['user_exists'] = $retExists;