addStat(getStat($p, $id, true, true), $winrateC, $ch);
                }
                foreach ($items as $i) {
                    addStat(getStat($p, $i, false), $poprateI, $i);
                    addStat(getStat($p, $i, true), $winrateI, $i);
                    addStat(getStat($p, $i, false, false, $arr["matchDuration"]), $dpsI, $i);
                }
                foreach ($boots as $i) {
                    addStat(getStat($p, $i, false, false, false, 2), $poprateB, $i);
                    addStat(getStat($p, $i, true, false, false, 2), $winrateB, $i);
                    addStat(getStat($p, $i, false, false, $arr["matchDuration"], 2), $dpsB, $i);
                }
                foreach ($mr as $i) {
                    addStat(getStat($p, $i, false, false, false, 3), $poprateMR, $i);
                    addStat(getStat($p, $i, true, false, false, 3), $winrateMR, $i);
                    addStat(getStat($p, $i, false, false, $arr["matchDuration"], 3), $dpsMR, $i);
                }
                getIC($p, $champs, $popArray);
                getIC($p, $champs, $winArray, true);
                getIC($p, $champs, $popArrayB, false, 2);
                getIC($p, $champs, $winArrayB, true, 2);
            }
        }
    }
    closedir($handle);
}
/////////////////////////////////////////////////////////
foreach ($winrateC[1] as $item => $stat) {
    if ($winrateC[2][$item] == 0) {
        $winrateC[0][$item] = 0;
    } else {
Esempio n. 2
0
<?php

$time = microtime(1);
//Calculate time in microseconds to calculate time taken to execut
//error_reporting(E_ALL);
ini_set("display_errors", 1);
include '/data/project/xtools/stats.php';
$tool = 'IPCalc';
$surl = "//tools.wmflabs.org" . $_SERVER['REQUEST_URI'];
if (isset($_GET['name'])) {
    addStat($tool, $surl, $_SERVER['HTTP_REFERER'], $_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/Smarty/languages.class.php";
require_once "/data/project/xtools/public_html/Smarty/Smarty.class.php";
require_once '/data/project/xtools/public_html/sitenotice.php';
require_once '/data/project/xtools/public_html/ipcalc/base.php';
//$phptemp = new PHPtemp( '/data/project/xtools/public_html/templates/main.tpl' );
//$content = new PHPtemp( '/data/project/xtools/public_html/ipcalc/templates/ipcalc.tpl' );
$phptemp = new Smarty();
$content = new Smarty();
$language = new Language(array("en"));
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->config_load('../../configs/' . $lang . '.conf', 'main');
$content->config_load('../../configs/' . $lang . '.conf', 'main');
$phptemp->config_load($lang . '.conf', 'ipcalc');
$content->config_load($lang . '.conf', 'ipcalc');
Esempio n. 3
0
function addStatV2($tool)
{
    $surl = "http://tools.wmflabs.org" . $_SERVER['REQUEST_URI'];
    addStat($tool, $surl, @$_SERVER['HTTP_REFERER'], $_SERVER['HTTP_USER_AGENT']);
}
Esempio n. 4
0
ini_set("display_errors", 1);
$time = microtime(1);
//Calculate time in microseconds to calculate time taken to execute
include '/data/project/xtools/public_html/common/header.php';
include '/data/project/xtools/wikibot.classes.php';
include '/data/project/xtools/stats.php';
include '/data/project/xtools/public_html/common/rfalib2.php';
$tool = 'RFAP';
$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);
//Debugging stuff
//error_reporting(E_ALL);
ini_set("display_errors", 1);
function pre($array)
{
    echo "<pre>";
    print_r($array);
    echo "</pre>";
}
//Output header
echo '<div id="content">
	<table class="cont_table" style="width:100%;">
Esempio n. 5
0
function removeMV($password, $ID)
{
    /*Tar bort ett MV*/
    if ($password === "iklabbe") {
        if ($ID == '1') {
            return '...försökte rubba det fundament på vilket allt vilade?';
        }
        if (empty($ID)) {
            return '...inte förstod?';
        }
        try {
            $db = new PDO('sqlite:zahabe.db');
            $result = $db->query('SELECT * FROM MinnsDu ORDER BY MVOrder asc LIMIT 1 OFFSET ' . $ID . '-1');
            $db->query('delete from MinnsDu 
                        where id = (
                        select id from 
                        (select id from MinnsDu order by MVOrder limit 1 OFFSET ' . $ID . '-1) 
                        as t
                        )');
            $i = 0;
            addStat(-1, $db);
            foreach ($result as $row) {
                return "..tog bort raden: " . $row['Text'] . "<br>";
                $i = 1;
            }
            if ($i == 0) {
                return "Rad nummer " . $ID . " existerar ej";
            }
            $db = NULL;
        } catch (PDOException $e) {
            return 'Exception : ' . $e->getMessage();
        }
    } else {
        return "...glömde nycklarna hemma?";
    }
}