コード例 #1
0
ファイル: parser.php プロジェクト: Covert-Inferno/fortissimo
 function get_ids()
 {
     $sys = new EVESystem(EVESystem::getId($this->system));
     $this->system_id = $sys->getId();
     $this->region_id = $sys->getRegionId();
     $this->constellation_id = $sys->getConstellationId();
     if ($this->victim) {
         $this->victim->get_ids();
     }
     if ($this->killer) {
         $this->killer->get_ids();
     }
     foreach (array_keys($this->destroyed) as $k) {
         $this->destroyed[$k]->get_ids();
     }
     foreach (array_keys($this->attackers) as $k) {
         $this->attackers[$k]->get_ids();
     }
 }
コード例 #2
0
<?php

require_once 'lib/fortissimo.php';
require_once 'lib/EVESystem.php';
$test = new EVESystem(30003808);
echo "got {$test} - " . $test->getName() . " - " . $test->getConstellationName() . " - " . $test->getRegionName() . " <br />";
echo "okay new test - " . EVESystem::getName(30003808) . "<br />";
echo "if those are both Grispire, you're golden <tt>:)</tt><br />";
echo "test again - " . $test->getId() . " should be 30003808<br />";
echo "this should be too - " . EVESystem::getId('Grispire') . "<br />";
コード例 #3
0
ファイル: show.php プロジェクト: Covert-Inferno/fortissimo
$groupid = $_GET['groupid'];
$allianceid = $_GET['allianceid'];
$weaponid = $_GET['weaponid'];
if (!$weaponid) {
    $weaponid = $_GET['itemid'];
}
# now, let's build this up
$criteria = array();
$bind = array();
$args = array();
$message = array();
if (is_numeric($systemid) && $systemid > 0) {
    array_push($criteria, 'systemid = ?');
    array_push($bind, $systemid);
    array_push($args, "systemid={$systemid}");
    array_push($message, "in <strong>" . EVESystem::getName($systemid) . "</strong>");
}
if (is_numeric($weaponid) && $weaponid > 0) {
    array_push($criteria, 'weaponid = ?');
    array_push($bind, $weaponid);
    array_push($args, "weaponid={$weaponid}");
    array_push($message, "with a <strong>" . get_item_name($weaponid) . "</strong>");
}
if (is_numeric($regionid) && $regionid > 0) {
    array_push($criteria, 'regionid = ?');
    array_push($bind, $regionid);
    array_push($args, "regionid={$regionid}");
    array_push($message, "in <strong>" . EVERegion::getName($regionid) . "</strong>");
}
if (is_numeric($groupid) && $groupid > 0) {
    array_push($criteria, '(v_groupid = ? OR k_groupid = ?)');
コード例 #4
0
function get_top10($which, $whichwhat, $what)
{
    global $ft;
    $t10 = $ft->dbh->_select_rows_as_objects('SELECT * FROM tbl:favorites WHERE type = ? ' . 'AND var1 = ? AND ftype = ? ORDER BY var3 DESC LIMIT 10', array($which, $whichwhat, $what));
    $out = array();
    foreach ($t10 as $row) {
        $val = "value undefined";
        if ($what == 'weapon') {
            $val = get_item_name($row->var2);
        } elseif ($what == 'pilot') {
            $val = get_pilot_name($row->var2) . ' [' . get_corp_ticker(get_pilot_corpid($row->var2)) . ']';
        } elseif ($what == 'system') {
            $val = EVESystem::getName($row->var2);
        } elseif ($what == 'ship_killed' || $what == 'ship_lost' || $what == 'ship_flown') {
            $val = get_item_name($row->var2);
        }
        array_push($out, array($val, $row->var3));
    }
    return $out;
}
コード例 #5
0
# now do the select
$results = array();
$maxct = 0;
$v = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
foreach (array_keys($v) as $when) {
    $data = $ft->dbh->_select_rows_as_objects("SELECT var1, {$by} AS 'val' FROM tbl:stats WHERE type = ? AND dtype = ? AND var2 = ? " . "AND {$by} > 0 ORDER BY {$by} DESC LIMIT 25", array($which, $when, $v[$when]));
    if ($data) {
        # now convert the data to something useful
        $out = array();
        $ct = 0;
        foreach ($data as $row) {
            $ct++;
            if ($which == 'pilot') {
                array_push($out, array(get_pilot_link($row->var1), $row->val));
            } elseif ($which == 'system') {
                $sys = new EVESystem($row->var1);
                array_push($out, array($sys->getLink() . ' (<span style="color: ' . security_color($sys->getSecurity()) . ';">' . security($sys->getSecurity()) . '</span>)', $row->val));
            } elseif ($which == 'corp') {
                array_push($out, array(get_corp_link($row->var1), $row->val));
            } elseif ($which == 'alliance') {
                array_push($out, array(get_alliance_link($row->var1), $row->val));
            } elseif ($which == 'region') {
                array_push($out, array(EVERegion::getLink($row->var1), $row->val));
            } elseif ($which == 'group') {
                array_push($out, array(get_group_link($row->var1), $row->val));
            } elseif ($which == 'ship') {
                array_push($out, array(get_ship_link($row->var1), $row->val));
            } elseif ($which == 'weapon') {
                array_push($out, array(get_item_link($row->var1), $row->val));
            }
        }
コード例 #6
0
if (!isset($okwhen[$when])) {
    return $ft->errorpage('Invalid ranking criteria.');
}
# now do the select
$v = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
$data = $ft->dbh->_select_rows_as_objects("SELECT var1, {$by} AS 'val' FROM tbl:stats WHERE type = ? AND dtype = ? AND var2 = ? " . "AND {$by} > 0 ORDER BY {$by} DESC LIMIT 25", array($which, $when, $v[$when]));
if (!$data) {
    $data = array();
}
# now convert the data to something useful
$out = array();
foreach ($data as $row) {
    if ($which == 'pilot') {
        array_push($out, array(get_pilot_link($row->var1), $row->val));
    } elseif ($which == 'system') {
        array_push($out, array(EVESystem::getLink($row->var1), $row->val));
    } elseif ($which == 'corp') {
        array_push($out, array(get_corp_link($row->var1), $row->val));
    } elseif ($which == 'alliance') {
        array_push($out, array(get_alliance_link($row->var1), $row->val));
    } elseif ($which == 'region') {
        array_push($out, array(EVERegion::getLink($row->var1), $row->val));
    } elseif ($which == 'group') {
        array_push($out, array(get_group_link($row->var1), $row->val));
    } elseif ($which == 'ship') {
        array_push($out, array(get_ship_link($row->var1), $row->val));
    } elseif ($which == 'weapon') {
        array_push($out, array(get_item_link($row->var1), $row->val));
    }
}
# now prepare the page