Ejemplo n.º 1
0
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
/** @require functions */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
/** @require config */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/config.inc.php";
/** @require MySQL */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/MySQL.php";
/** @require curSys */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/curSys.php";
use EDTB\source\System;
/**
 * System Info
 */
if (isset($_GET["sys"])) {
    $num_visits = System::num_visits($curSys["name"]);
    $esc_sysname = $mysqli->real_escape_string($curSys["name"]);
    $va_text .= "No system data.";
    if (!empty($curSys["name"])) {
        $va_system = str_replace(".", "", $curSys["name"]);
        $va_text = "The " . tts_override($va_system) . " system.\n\r";
        $va_allegiance = $curSys["allegiance"] == "None" ? "No additional data available. " : $curSys["allegiance"];
        $va_allegiance = $va_allegiance == "" ? "No additional data available. " : $va_allegiance;
        /**
         * Marvin goes on a bit of a rant
         */
        $rant = "";
        if ($settings["angry_droid"] == "true") {
            /**
             * fetch allegiance rants
             */
Ejemplo n.º 2
0
    }
    $rare_result->close();
} else {
    $c_rares_data .= "No rares nearby";
}
$c_rares_data .= "</div>";
/**
 * provide crosslinks to screenshot gallery, log page, etc
 */
$si_crosslinks = System::crosslinks($si_system_name);
if (!System::is_mapped($si_system_name)) {
    $si_crosslinks .= '<a href="/SystemMap/?system=' . urlencode($si_system_name) . '" style="color:inherit" title="Map this system">';
    $si_crosslinks .= '<img src="/style/img/grid_g.png" class="icon" style="margin-left:5px;margin-right:0" />';
    $si_crosslinks .= '</a>';
}
$num_visits = System::num_visits($si_system_name);
if ($actual_num_res > 0 && valid_coordinates($curSys["x"], $curSys["y"], $curSys["z"])) {
    $rare_text = '&nbsp;&nbsp;<span onclick="$(\'#rares\').fadeToggle(\'fast\')">';
    $rare_text .= '<a href="javascript:void(0)" title="Click for more info">[ Rares within ' . $settings["rare_range"] . ' ly: ' . $actual_num_res . ' ]</a>';
    $rare_text .= $c_rares_data . '</span>';
}
$data["si_name"] .= $si_system_display_name . $si_crosslinks;
$data["si_name"] .= '&nbsp;&nbsp;<span style="font-size:11px;text-transform:uppercase;vertical-align:middle">';
$data["si_name"] .= '[ State: ' . $si_system_state . ' - Security: ' . $si_system_security . ' - Visits: ' . $num_visits . ' ]';
$data["si_name"] .= $rare_text . $user_dists . '</span>';
/**
 * station info for System.php
 */
$query = "  SELECT SQL_CACHE *\n            FROM edtb_stations\n            WHERE system_id = '{$si_system_id}'\n            ORDER BY -ls_from_star DESC, name";
$station_result = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__);
$station_exists = $station_result->num_rows;
Ejemplo n.º 3
0
Archivo: PoiBm.php Proyecto: DBnR1/EDTB
 /**
  * Make items
  *
  * @param object $obj
  * @param string $type
  * @param int $i
  * @return string
  * @author Mauri Kujala <*****@*****.**>
  */
 private function make_item($obj, $type, &$i)
 {
     $item_id = $obj->id;
     $item_text = $obj->text;
     $item_name = $obj->item_name;
     $item_system_name = $obj->system_name;
     $item_system_id = $obj->system_id;
     $item_cat_name = $obj->catname;
     $item_added_on = $obj->added_on;
     $item_added_ago = "";
     if (!empty($item_added_on)) {
         $item_added_ago = get_timeago($item_added_on, false);
         $item_added_on = new \DateTime(date("Y-m-d\\TH:i:s\\Z", $item_added_on + $this->time_difference * 60 * 60));
         $item_added_on = date_modify($item_added_on, "+1286 years");
         $item_added_on = $item_added_on->format("j M Y, H:i");
     }
     $item_coordx = $obj->item_coordx;
     $item_coordy = $obj->item_coordy;
     $item_coordz = $obj->item_coordz;
     $distance = "n/a";
     if (valid_coordinates($item_coordx, $item_coordy, $item_coordz)) {
         $distance = number_format(sqrt(pow($item_coordx - $this->usex, 2) + pow($item_coordy - $this->usey, 2) + pow($item_coordz - $this->usez, 2)), 1) . " ly";
     }
     /**
      * if visited, change border color
      */
     $visited = System::num_visits($item_system_name);
     $style_override = $visited ? ' style="border-left: 3px solid #3da822"' : "";
     $tdclass = $i % 2 ? "dark" : "light";
     /**
      * provide crosslinks to screenshot gallery, log page, etc
      */
     $item_crosslinks = System::crosslinks($item_system_name);
     echo '<tr>';
     echo '<td class="' . $tdclass . ' poi_minmax">';
     echo '<div class="poi"' . $style_override . '>';
     echo '<a href="javascript:void(0)" onclick="update_values(\'/Bookmarks/get' . $type . 'EditData.php?' . $type . '_id=' . $item_id . '\', \'' . $item_id . '\');tofront(\'add' . $type . '\')" style="color:inherit" title="Click to edit entry">';
     echo $distance . ' &ndash;';
     if (!empty($item_system_id)) {
         echo '</a>&nbsp;<a title="System information" href="/System?system_id=' . $item_system_id . '" style="color:inherit">';
     } elseif ($item_system_name != "") {
         echo '</a>&nbsp;<a title="System information" href="/System?system_name=' . urlencode($item_system_name) . '" style="color:inherit">';
     } else {
         echo '</a>&nbsp;<a href="#" style="color:inherit">';
     }
     if (empty($item_name)) {
         echo $item_system_name;
     } else {
         echo $item_name;
     }
     echo '</a>' . $item_crosslinks . '<span class="right" style="margin-left:5px">' . $item_cat_name . '</span><br />';
     if (!empty($item_added_on)) {
         echo 'Added: ' . $item_added_on . ' (' . $item_added_ago . ')<br /><br />';
     }
     echo nl2br($item_text);
     echo '</div>';
     echo '</td>';
     echo '</tr>';
     $i++;
 }