Ejemplo n.º 1
0
 private function execQuery()
 {
     $this->qry = DBFactory::getDBQuery();
     $query = "SELECT * FROM kb3_navigation WHERE nav_type = '{$this->type}'";
     if (Killboard::hasCampaigns() == false) {
         $query .= " AND url NOT LIKE '?a=campaigns'";
     }
     if (config::get('public_losses')) {
         $query .= " AND url NOT LIKE '?a=losses'";
     }
     if (!config::get('show_standings')) {
         $query .= " AND url NOT LIKE '?a=standings'";
     }
     if (config::get('public_stats') == 'remove') {
         $query .= " AND url NOT LIKE '?a=self_detail'";
     }
     $query .= " AND (page = '" . $this->page . "' OR page = 'ALL_PAGES') AND hidden = 0";
     $query .= " AND KBSITE = '" . $this->site . "' ORDER BY posnr";
     $this->qry->execute($query);
     // If no navigation table was found then make one.
     if (!$this->qry->recordCount()) {
         $this->check_navigationtable();
         $this->qry->execute($query);
     }
 }
 function campaigns()
 {
     // Display campaigns, if any.
     if (Killboard::hasCampaigns(true)) {
         $html = '';
         $html .= "<div class=\"kb-campaigns-header\">Active campaigns</div>";
         $list = new ContractList();
         $list->setActive("yes");
         $list->setCampaigns(true);
         $table = new ContractListTable($list);
         $html .= $table->generate();
         return $html;
     }
 }
Ejemplo n.º 3
0
            }
        } else {
            // Killboard was invalid, probably a problem querying evekill
            printf('<p class="fatalerror">Unable to query Eve-Kill data at this time - please try again later.</p>');
        }
        printf("</div>");
    }
    // ========================================================================
} elseif ($action == "intel_evekill_analysis") {
    // ========================================================================
    $n_LocusID = strtoupper(trim(mysql_real_escape_string($_REQUEST["lid"])));
    $aTempWH = new Wormhole($n_LocusID);
    if ($aTempWH->isValidLocus()) {
        $sDate = strtotime(sprintf("%d-%d-01", date("Y"), date("m")));
        printf('<div class="iHdr" rel="%s">Intel</div><span class="h4">&mdash;</span><div class="iData">', $n_LocusID);
        $aKillboard = new Killboard($n_LocusID, "analysis", EVEKILL_CACHE_LIFETIME_ANALYSIS, sprintf(ZKB_ANALYSIS_URL, getSystemID(urlencode($n_LocusID)), EVEKILL_KILL_COUNT_FOR_INTEL, sprintf("%s2359", date("Ymd")), sprintf("%s0000", date("Ymd", $sDate))), CACHE_USE_CACHE_UPDATE_NEW_DATA, true);
        if ($aKillboard->isValidKB()) {
            if ($aTempWH->isWHLocus()) {
                if (false && ($_SERVER["REMOTE_ADDR"] == "94.169.97.53" || ($_SERVER["REMOTE_ADDR"] = "80.45.72.211"))) {
                    printf('<p><span style="font-weight: bold; font-size: 14px;">DEBUG TABLE:</span><br/><table style="border-collapse: separate; border-spacing: 2px; font-size: 10px;">');
                    printf('<tr style="font-weight: bold;"><td>CORP</td><td>ALLIANCE</td><td>KILLS</td><td>LOSSES</td><td>BATTLES</td><td>SCORE</td><td>timeEarliestKill</td><td>timeLatestKill</td><td>timeEarliestLoss</td><td>timeLatestLoss</td><td>involvedCount</td></tr>');
                    foreach ($aKillboard->corp as $aCorp) {
                        printf('<tr%s><td><strong>%s</strong></td><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td><strong>%0.2f</strong> (a: %0.1f%%) (t: %0.1f%%) (h: %0.1f%%) (as: %0.1f%%) (p: %f%%)</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td></tr>', !is_null($aCorp->residency["evicted"]) ? ' style="color: #FF3030;"' : (sizeof($aCorp->residency["posactvy"]) > 0 ? ' style="color: #30FF30"' : (sizeof($aCorp->residency["caplcuse"]) > 0 ? ' style="color: #FFFF30"' : "")), $aCorp->corporationName . " (" . $aCorp->corporationID . ")", $aCorp->allianceName . " (" . $aCorp->allianceID . ")", $aCorp->killCount, $aCorp->lossCount, sizeof($aCorp->battle), $aCorp->residency["score"], $aKillboard->totalAllianceResidencyScore($aCorp->allianceID) != 0 ? $aCorp->residency["score"] / $aKillboard->totalAllianceResidencyScore($aCorp->allianceID) * 100 : 0, $aKillboard->res_metrics["totalScore"] != 0 ? $aCorp->residency["score"] / $aKillboard->res_metrics["totalScore"] * 100 : 0, $aCorp->residency["score"] / $aKillboard->res_metrics["maxScore"] * 100, $aKillboard->totalAllianceResidencyScore($aCorp->allianceID) != 0 ? $aKillboard->totalAllianceResidencyScore($aCorp->allianceID) / $aKillboard->res_metrics["totalScore"] * 100 : 0, $aCorp->residency["z-perc"], !is_null($aCorp->timeEarliestKill) ? date("Y-m-d H:i:s", $aCorp->timeEarliestKill) : '-', !is_null($aCorp->timeLatestKill) ? date("Y-m-d H:i:s", $aCorp->timeLatestKill) : '-', !is_null($aCorp->timeEarliestLoss) ? date("Y-m-d H:i:s", $aCorp->timeEarliestLoss) : '-', !is_null($aCorp->timeLatestLoss) ? date("Y-m-d H:i:s", $aCorp->timeLatestLoss) : '-', $aCorp->involvedCount);
                    }
                    printf('</table>');
                    printf('</p>');
                }
                $aryResident = array();
                $aryEvictee = array();
                $residentCorps = array();
                $residentCorpsInAlliance = 0;
Ejemplo n.º 4
0
 public function get_game_killboard(\Trouble\Game $game)
 {
     $killboard = new Killboard();
     $killboard->attach_game($game);
     return $killboard;
 }
Ejemplo n.º 5
0
 /**
  * Returns HTML string for campaigns, if any.
  * @return string HTML string for campaigns, if any
  */
 function campaigns()
 {
     // Display campaigns, if any.
     if (Killboard::hasCampaigns(true) && $this->isCurrentPeriod()) {
         $html = "<div class='kb-campaigns-header'>Active campaigns</div>";
         $list = new ContractList();
         $list->setActive("yes");
         $table = new ContractListTable($list);
         $html .= $table->generate();
         return $html;
     }
 }