Exemplo n.º 1
0
    $langs[$k] = str_replace(array('/data/project/xtools/public_html/pcount/configs/', '.conf'), '', $newlang);
    if ($langs[$k] == "qqq") {
        unset($langs[$k]);
    }
}
$language = new Language($langs);
$lang = $language->getLang();
$phptemp = new PHPtemp('/data/project/xtools/public_html/templates/main.tpl');
if (in_string('iPhone', $_SERVER['HTTP_USER_AGENT']) && $lang == "en" && !isset($_GET['nophone'])) {
    define('IPHONE', true);
    $phptemp = new PHPtemp('/data/project/xtools/public_html/templates/iphone.tpl');
    $content = new PHPtemp('/data/project/xtools/public_html/pcount/templates/iphone.tpl');
} else {
    define('IPHONE', false);
    $phptemp = new PHPtemp('/data/project/xtools/public_html/templates/main.tpl');
    $content = new PHPtemp('/data/project/xtools/public_html/pcount/templates/pcount.tpl');
}
$langlinks = $language->generateLangLinks();
if (is_file('/data/project/xtools/public_html/configs/' . $lang . '.conf')) {
    $phptemp->load_config('/data/project/xtools/public_html/configs/' . $lang . '.conf', 'main');
    $content->load_config('/data/project/xtools/public_html/configs/' . $lang . '.conf', 'main');
} else {
    $phptemp->load_config('/data/project/xtools/public_html/configs/en.conf', 'main');
    $content->load_config('/data/project/xtools/public_html/configs/en.conf', 'main');
}
$phptemp->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
$content->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
$phptemp->assign("header", $phptemp->getConf('tool'));
$phptemp->assign("curlang", $lang);
$phptemp->assign("langlinks", $langlinks);
$phptemp->assign("source2", "//tools.wmflabs.org/xtools/pcount/source.php");
Exemplo n.º 2
0
<?php

error_reporting(E_ERROR);
ini_set("display_errors", 1);
require_once '/data/project/xtools/public_html/phptemp/PHPtemp.php';
require_once '/data/project/xtools/public_html/phptemp/Language.php';
$phptemp = new PHPtemp('/data/project/xtools/public_html/templates/main.tpl');
$content = new PHPtemp('/data/project/xtools/public_html/pcount/templates/translate.tpl');
$langs = glob("/data/project/xtools/public_html/pcount/configs/*.conf");
foreach ($langs as $k => $newlang) {
    $langs[$k] = str_replace(array('/data/project/xtools/public_html/pcount/configs/', '.conf'), '', $newlang);
    if ($langs[$k] == "qqq") {
        unset($langs[$k]);
    }
}
$language = new Language($langs);
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->load_config('/data/project/xtools/public_html/configs/en.conf', 'main');
$phptemp->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
$content->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
require_once '/data/project/xtools/public_html/counter_commons/Database.php';
require_once '/data/project/xtools/public_html/counter_commons/Email.php';
require_once '/data/project/xtools/database.inc';
require_once '/data/project/xtools/textdiff/textdiff.php';
$wgDBPort = 3306;
$wgDBUser = $toolserver_username;
$wgDBPass = $toolserver_password;
/*$tdbr = new Database( 
	'sql-toolserver', 
	$wgDBPort, 
Exemplo n.º 3
0
<?php

error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once '/data/project/xtools/public_html/phptemp/PHPtemp.php';
require_once '/data/project/xtools/public_html/phptemp/Language.php';
$phptemp = new PHPtemp('/data/project/xtools/public_html/templates/main.tpl');
$content = new PHPtemp('/data/project/xtools/public_html/pcount/templates/source.tpl');
$language = new Language(array('en'));
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->load_config('/data/project/xtools/public_html/configs/' . $lang . '.conf', 'main');
$phptemp->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
$content->load_config('/data/project/xtools/public_html/configs/' . $lang . '.conf', 'main');
$content->load_config('/data/project/xtools/public_html/pcount/configs/' . $lang . '.conf', 'pcount');
$dirs = array('http' => '/data/project/xtools/public_html/counter_commons/HTTP.php', 'database' => '/data/project/xtools/public_html/counter_commons/Database.php', 'functions' => '/data/project/xtools/public_html/counter_commons/Functions.php', 'counter' => '/data/project/xtools/public_html/pcount/counter.php', 'index' => '/data/project/xtools/public_html/pcount/index.php', 'Language' => '/data/project/xtools/public_html/phptemp/Language.php', 'main.tpl' => '/data/project/xtools/public_html/templates/main.tpl', 'pcount.tpl' => '/data/project/xtools/public_html/pcount/templates/pcount.tpl');
if (!isset($_GET['path'])) {
    $phptemp->assign("header", $phptemp->getConf('sourceviewer'));
    $content->assign("form", "true");
} elseif (!isset($dirs[$_GET['path']])) {
    $phptemp->assign("header", $phptemp->getConf('sourceviewer'));
    $content->assign("error", $phptemp->getConf('sourceviewer'));
    $content->assign("form", "true");
} else {
    $pathname = $dirs[$_GET['path']];
    $phptemp->assign("header", $phptemp->getConf('viewingsource', $pathname));
    $content->assign("source", str_replace('<?php', '', highlight_file($pathname, true)));
}
$phptemp->assign("content", $content->display(true));
$phptemp->assign("curlang", $lang);
$phptemp->assign("langlinks", $langlinks);
Exemplo n.º 4
0
$surl = "//tools.wmflabs.org" . $_SERVER['REQUEST_URI'];
if (isset($_GET['name'])) {
    if (isset($_SERVER['HTTP_REFERER'])) {
        $refer = $_SERVER['HTTP_REFERER'];
    } else {
        $refer = "none";
    }
    addStat($tool, $surl, $refer, $_SERVER['HTTP_USER_AGENT']);
    //Stat checking
}
unset($tool, $surl);
require_once '/data/project/xtools/public_html/phptemp/PHPtemp.php';
require_once '/data/project/xtools/public_html/phptemp/Language.php';
require_once '/data/project/xtools/public_html/sitenotice.php';
$phptemp = new PHPtemp('/data/project/xtools/public_html/templates/main.tpl');
$content = new PHPtemp('/data/project/xtools/public_html/rangecontribs/templates/rangecontribs.tpl');
$language = new Language(array("en"));
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->load_config('/data/project/xtools/public_html/configs/' . $lang . '.conf', 'main');
$phptemp->load_config('/data/project/xtools/public_html/rangecontribs/configs/' . $lang . '.conf', 'rangecontribs');
$content->load_config('/data/project/xtools/public_html/rangecontribs/configs/' . $lang . '.conf', 'rangecontribs');
$namespaces = array('0' => '', '1' => 'Talk:', '2' => 'User:'******'3' => 'User talk:', '4' => 'Wikipedia:', '5' => 'Wikipedia talk:', '6' => 'File:', '7' => 'File talk:', '8' => 'MediaWiki:', '9' => 'MediaWiki talk:', '10' => 'Template:', '11' => 'Template talk:', '12' => 'Help:', '13' => 'Help talk:', '14' => 'Category:', '15' => 'Category talk:', '100' => 'Portal:', '101' => 'Portal talk:', '108' => 'Book:', '109' => 'Book talk:', '446' => 'Education Program:', '447' => 'Education Program talk:', '710' => 'TimedText:', '711' => 'TimedText talk:', '828' => 'Module:', '829' => 'Module talk:');
$phptemp->assign("header", $phptemp->getConf('tool'));
if (!isset($_GET['ips'])) {
    $content->assign("form", 'Welcome to X!\'s automated edits counter!<br /><br />
   There are two ways to use this tool. 
   <ol>
   <li>IP range: Enter a CIDR range into the box, in the format 0.0.0.0/0</li>
   <li>IP list: Enter a list of IPs into the box, separated by newlines.</li>
   </ol><br />