<?php
/**
* iLP System Offiziere Startseite
*
* Autor: Florian "ApoY2k" Peschka
* Projekt: iLP System
* Paket: apoy2k.ilp.wrynn
* Lizenz: CreativeCommons (by-nc-sa)
* Kontakt: hide@address.com
* Version: 2.1.2
*/
if (!isset($tpl['url'][1]))
{
// Zusätzliche Header laden
$tpl['headincludes'][] = 'welcome.detail';
$tpl['headincludes'][] = 'events.list';
// Letzte Beute suchen und speichern
$get_loots = $db->prepare("SELECT ilp_events.date, ilp_loots.event_id, ilp_loots.looter_id, ilp_loots.item_id, ilp_loots.value, ilp_event_types.name, ilp_users.char FROM ilp_loots, ilp_events, ilp_event_types, ilp_users WHERE ilp_loots.event_id = ilp_events.id AND ilp_events.type = ilp_event_types.id AND ilp_loots.looter_id = ilp_users.id ORDER BY ilp_events.date DESC, ilp_loots.id DESC LIMIT 0, ".$_SESSION['config']['last_loots']);
$get_loots->execute();
$loots = $get_loots->fetchAll(PDO::FETCH_ASSOC);
if (1 <= $get_loots->rowCount())
{
foreach($loots as $row)
{
$row['char'] = unserialize($row['char']);
$tpl['loots'][] = $row;
}
}
else
{
$tpl['loots']['error'] = true;
}
// Letzte Ereignisse suchen und speichern
$get_events = $db->prepare("SELECT ilp_event_types.name AS type_name, ilp_event_types.icon AS type_icon, ilp_events.id AS event_id, ilp_events.date AS event_date FROM ilp_event_types, ilp_events WHERE ilp_events.type = ilp_event_types.id ORDER BY ilp_events.date DESC, ilp_events.id DESC LIMIT 0, ".$_SESSION['config']['last_events']);
$get_events->execute();
$events = $get_events->fetchAll(PDO::FETCH_ASSOC);
if (1 <= $get_events->rowCount())
{
foreach($events as $row)
{
$tpl['events'][] = $row;
}
}
else
{
$tpl['events']['error'] = true;
}
}
// Auf neue Version prüfen
if(is_object(simplexml_load_file('http://ilp.apoy2k.de/ilpdata.xml')))
{
$xml = simplexml_load_file('http://ilp.apoy2k.de/ilpdata.xml');
// Versionsdaten abfragen
$ilpdata = $xml->latestversion->attributes();
// Compare the installed version with the newest as stated in the xml-file
if ($ilpdata['releasedate'] > $_SESSION['config']['ilpversion_releasedate'])
{
$tpl['versionupdate'] = true;
$tpl['versionupdatefile'] = 'Patch '.$_SESSION['config']['ilpversion_id'].' to '.$ilpdata['id'].'.zip';
}
}
?>