<?php
/**
* iLP System Startseite
*
* Autor: Florian "ApoY2k" Peschka
* Projekt: iLP System
* Paket: apoy2k.ilp.wrynn
* Lizenz: CreativeCommons (by-nc-sa)
* Kontakt: hide@address.com
* Version: 2.1.1
*/
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.id, 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_events.date, 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;
}
}
?>