コード例 #1
0
ファイル: index.php プロジェクト: JackPotte/xtools
   'toolserver',
   true
);*/
$dbInfo = $fnc->getDBInfo($lang, $wiki);
if (isset($dbInfo['error']) && $wiki != "wikidata") {
    $fnc->toDie($phptemp->getConf('nowiki', $url));
}
$wgDBname = $dbInfo['dbname'];
$wgDBserver = $dbInfo['server'];
$dbr = new Database($wgDBserver, $wgDBPort, $wgDBUser, $wgDBPass, $wgDBname, true);
if ($dbInfo['server'] == 1) {
    $fnc->toDie("In order to both discourage editcountitis and give the English Wikipedia editors a chance to realize what editing is all about and why I created this tool in the first place, I have disabled my edit counters (pcount, simplecount, autoedits) until August 17 2010. Please use this time to reflect on why I made this tool in the first place: To serve curiosity, not to create false judgement descisions about editors. -X! 13 August 2010");
}
$wgNamespaces = $fnc->getNamespaces('enwiki_p');
$cnt = new Counter($name);
$graphArray = array('colors' => array(0 => 'FF5555', 1 => '55FF55', 2 => 'FFFF55', 3 => 'FF55FF', 4 => '5555FF', 5 => '55FFFF', 6 => 'C00000', 7 => '0000C0', 8 => '008800', 9 => '00C0C0', 10 => 'FFAFAF', 11 => '808080', 12 => '00C000', 13 => '404040', 14 => 'C0C000', 15 => 'C000C0', 100 => '75A3D1', 101 => 'A679D2', 102 => '660000', 103 => '000066', 104 => 'FAFFAF', 105 => '408345', 106 => '5c8d20', 107 => 'e1711d', 108 => '94ef2b', 109 => '756a4a', 110 => '6f1dab', 111 => '301e30', 112 => '5c9d96', 113 => 'a8cd8c', 114 => 'f2b3f1', 115 => '9b5828', 118 => '99FFFF', 119 => '99BBFF', 120 => 'FF99FF', 121 => 'CCFFFF', 122 => 'CCFF00', 123 => 'CCFFCC', 200 => '33FF00', 201 => '669900', 202 => '666666', 203 => '999999', 204 => 'FFFFCC', 205 => 'FF00CC', 206 => 'FFFF00', 207 => 'FFCC00', 208 => 'FF0000', 209 => 'FF6600', 446 => '06DCFB', 447 => '892EE4', 460 => '99FF66', 461 => '99CC66', 470 => 'CCCC33', 471 => 'CCFF33', 480 => '6699FF', 481 => '66FFFF', 490 => '995500', 491 => '998800', 710 => 'FFCECE', 711 => 'FFC8F2', 828 => 'F7DE00', 829 => 'BABA21', 866 => 'FFFFFF', 867 => 'FFCCFF', 1198 => 'FF34B3', 1199 => '8B1C62'), 'names' => $wgNamespaces['names'], 'monthly' => $cnt->getMonthTotals(), 'gross' => $cnt->getNamespaceTotals());
$graph = new Graph($graphArray, IPHONE);
$uniqueEdits = $cnt->getUniqueArticles();
if (!$cnt->getExists()) {
    $fnc->toDie($phptemp->getConf('nosuchuser', $cnt->getName()));
}
$phptemp->assign("page", $cnt->getName());
$content->assign("username", $cnt->getName());
$content->assign("usernameurl", rawurlencode($cnt->getName()));
$content->assign("url", $url);
$content->assign("loadwiki", "&wiki={$wiki}&lang={$lang}");
if (count($cnt->getGroupList())) {
    $content->assign("groups", implode(', ', $cnt->getGroupList()));
}
if ($cnt->getLive() > 0) {
    $content->assign("firstedit", $cnt->getFirstEdit());
コード例 #2
0
ファイル: api.php プロジェクト: JackPotte/xtools
$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;
$final_array['query']['count']['user_id'] = $retUID;
$final_array['query']['count']['opted_in'] = $retOptedIn;
$final_array['query']['count']['counts'] = array('deleted' => $retDeleted, 'live' => $retLive, 'total' => $retTotal);
$final_array['query']['count']['groups'] = $retGroupList;
$final_array['query']['count']['firstedit'] = $retFirstEdit;
$final_array['query']['count']['averagepagedits'] = $retAveragePageEdits;
if (in_array('topedits', $prop) && $retOptedIn != "false") {
}
if (in_array('namespacetotals', $prop)) {
}
コード例 #3
0
ファイル: slowcount.php プロジェクト: JackPotte/xtools
	$wgDBPass, 
	'toolserver', 
	true
);*/
if ($wiki == 'wikidata') {
    $lang = "wikidata";
    $wiki = "wikimedia";
}
$dbInfo = $fnc->getDBInfo($lang, $wiki);
if (isset($dbInfo['error'])) {
    $fnc->toDie($phptemp->getConf('nowiki', $url));
}
$dbr = new Database($dbInfo['server'], $wgDBPort, $wgDBUser, $wgDBPass, $dbInfo['dbname'], true);
$wgNamespaces = $fnc->getNamespaces('enwiki_p');
$cnt = new Counter($name);
$graphArray = array('colors' => array(0 => 'FF5555', 1 => '55FF55', 2 => 'FFFF55', 3 => 'FF55FF', 4 => '5555FF', 5 => '55FFFF', 6 => 'C00000', 7 => '0000C0', 8 => '008800', 9 => '00C0C0', 10 => 'FFAFAF', 11 => '808080', 12 => '00C000', 13 => '404040', 14 => 'C0C000', 15 => 'C000C0', 100 => '75A3D1', 101 => 'A679D2', 102 => '660000', 103 => '000066', 104 => 'FAFFAF', 105 => '408345', 106 => '5c8d20', 107 => 'e1711d', 108 => '94ef2b', 109 => '756a4a', 110 => '6f1dab', 111 => '301e30', 112 => '5c9d96', 113 => 'a8cd8c', 114 => 'f2b3f1', 115 => '9b5828'), 'names' => $wgNamespaces['names'], 'monthly' => $cnt->getMonthTotals(), 'gross' => $cnt->getNamespaceTotals());
$graph = new Graph($graphArray);
$uniqueEdits = $cnt->getUniqueArticles();
if (!$cnt->getExists()) {
    $fnc->toDie($phptemp->getConf('nosuchuser', $cnt->getName()));
}
$phptemp->assign("page", $cnt->getName());
$content->assign("username", $cnt->getName());
$content->assign("usernameurl", urlencode($cnt->getName()));
$content->assign("url", $url);
if (count($cnt->getGroupList())) {
    $content->assign("groups", implode(', ', $cnt->getGroupList()));
}
if ($cnt->getLive() > 0) {
    $content->assign("firstedit", $cnt->getFirstEdit());
    $content->assign("unique", number_format(count($uniqueEdits['total'])));