コード例 #1
0
ファイル: index.php プロジェクト: JackPotte/xtools
$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");
$uselang = $lang == "en" ? "" : "&uselang={$lang}";
$phptemp->assign("translate", "//tools.wmflabs.org/xtools/translate/index.php?usetool=Editcounter" . $uselang);
$siteNoticeClass = new siteNotice();
$sitenotice = $siteNoticeClass->checkSiteNoticeRaw();
if ($sitenotice) {
コード例 #2
0
ファイル: index.php プロジェクト: JackPotte/xtools
    }
    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 />
      <form action="//tools.wmflabs.org/xtools/rangecontribs/index.php" method="get">
      <table>
      <tr>
      <td align="center">IP range: <input type="radio" name="type" value="range" /></td> 
      <td align="center">IP list: <input type="radio" name="type" value="list" /></td> 
      </tr>