예제 #1
0
파일: index.php 프로젝트: Krinkle/xtools
<?php

//Requires
require_once '/data/project/xtools/modules/WebTool.php';
require_once 'Counter.php';
require_once PEACHY_BASE_SYS_DIR . '/Peachy/Init.php';
//Load WebTool class
$wt = new WebTool('topedits');
$wt->setLimits();
$wt->getPageTemplate('form');
$namespace = $wgRequest->getVal('namespace');
//kompatibility
$page = $wgRequest->getVal('page');
$page = $wgRequest->getVal('article', $page);
$wi = $wt->wikiInfo;
$lang = $wi->lang;
$wiki = $wi->wiki;
$domain = $wi->domain;
$uinput = explode("|", $wgRequest->getVal('user'));
foreach ($uinput as $uitem) {
    $tmpui = $wt->getUserInfo($lang, $wiki, $uitem);
    if ($tmpui->userid || $tmpui->isIP) {
        $users["list"][] = $tmpui;
        $users["names"][] = "'" . $tmpui->userDb . "'";
    }
}
$perflog->stack[] = $users;
$ui = $users["list"][0];
$user = $ui->user;
//Show form if &article parameter is not set (or empty)
if (!$user && (!$page || !$lang || !$wiki || strval($namespace) == "")) {
예제 #2
0
파일: index.php 프로젝트: Krinkle/xtools
<?php

//Requires
require_once '/data/project/xtools/modules/WebTool.php';
require_once 'Counter.php';
//Load WebTool class
$wt = new WebTool('Automated Edits', 'autoedits', array());
$wt->setLimits();
$wt->getPageTemplate("form");
$wi = $wt->wikiInfo;
$lang = $wi->lang;
$wiki = $wi->wiki;
$domain = $wi->domain;
$ui = $wt->getUserInfo();
$user = $ui->user;
$begin = $wt->checkDate($wgRequest->getVal('begin'));
$end = $wt->checkDate($wgRequest->getVal('end'));
//Show form if &article parameter is not set (or empty)
if (!$lang || !$wiki || !$user) {
    $wt->showPage();
}
$dbr = $wt->loadDatabase($lang, $wiki);
$cnt = new Counter($dbr, $user, $domain, true);
//Start doing the DB request
$data = $cnt->calcAutoEditsDB($dbr, $begin, $end);
$list = '';
foreach ($data["tools"] as $toolname => $count) {
    $list .= '
				<tr>
				<td><a href="//en.wikipedia.org/wiki/' . Counter::$AEBTypes[$toolname]["shortcut"] . '">' . $toolname . '</a></td>
				<td class="tdnum" >' . $wt->numFmt($count) . '</td>