Location: PHPKode > projects > Content*Builder > modules/event/eventBox_list.php
<?php
require_once("Date.php");

/*
* Limit für die Anzahl der nächsten Events setzen.
* Kann per 
* setModuleValue("moduleName", "event_result_limit", "5");
* in der modules.php gesetzt werden, Standard ist 5
*/
$eventResultLimit = 5;
if(preg_match("/^([0-9]*)$/", $event_result_limit) && $event_result_limit != "") {
	$eventResultLimit = $event_result_limit;
}

$eventCurrentDate = new Date();

/*
* tage herausfinden, an denen die nächsten Events stattfinden.
*/
$eventQuery = mysql_query("SELECT * FROM ".TABLE."_events WHERE (DATE_FORMAT(eventDate, '%Y%m%d') > DATE_FORMAT(CURDATE(), '%Y%m%d') OR (DATE_FORMAT(eventDate, '%Y%m%d') = DATE_FORMAT(CURDATE(), '%Y%m%d') AND HOUR(eventDate) >= '".$eventCurrentDate->getHour()."')) ORDER BY eventDate ASC LIMIT 0,".$eventResultLimit."");
while($eventRow = mysql_fetch_object($eventQuery)) {
	$eventDate = new Date($eventRow->eventDate);
	$eventListContent[title][]  = $eventRow->title;
	$eventListContent[desc][]   = $eventRow->description;
	$eventListContent[day][]    = $eventDate->getDay();
	$eventListContent[month][]  = $eventDate->getMonth();
	$eventListContent[year][]   = $eventDate->getYear();
	$eventListContent[hour][]   = $eventDate->getHour();
	$eventListContent[minute][] = $eventDate->getMinute();
}

$tpl->assign("eventListContent", $eventListContent);
$tpl->display("eventBox_list.template");
?>
Return current item: Content*Builder