コード例 #1
0
ファイル: viewEvent.php プロジェクト: jamesread/lanlist.org
<?php

require_once 'includes/common.php';
$event = fetchEvent(fromRequestRequireInt('id'));
define('TITLE', 'Event: ' . $event['organizerTitle'] . ' - ' . $event['eventTitle']);
require_once 'includes/widgets/header.php';
$tpl->assign('event', $event);
$marker = jsMapMarker($event['venueLat'], $event['venueLng'], true);
$tpl->assign('markers', array($marker));
$tpl->registerFunction('boolToString', 'tplBoolToString');
$tpl->display('viewEvent.tpl');
/*
Html::h2('Rating');
if (strtotime($event['dateStart']) > time()) {
	echo 'After this event, you will be able to rate it.';
} else {
	$rating = getEventRating($event['id']);
	echo 'Rating: ' . $rating . ' / 5, with X vote(s).';
}
*/
startSidebar();
$logoUrl = getOrganizerLogoUrl($event['organizerId']);
if (strpos($logoUrl, "default") == false) {
    $tpl->assign('organizerId', $event['organizerId']);
    $tpl->assign('logoUrl', $logoUrl);
    $tpl->display('infobox.organizerLogo.tpl');
}
?>

<div class = "infobox">
	<h2>Other events...</h2>
コード例 #2
0
ファイル: viewVenue.php プロジェクト: jamesread/lanlist.org
<?php

require_once 'includes/widgets/header.php';
$id = fromRequestRequireInt('id');
$venue = fetchVenue($id);
$tpl->assign('organizersAtVenue', fetchOrganizersFromVenueId($id));
$tpl->assign('eventsAtVenue', fetchEventsFromVenueId($id));
$tpl->assign('venue', $venue);
$tpl->display('viewVenue.tpl');
startSidebar();
require_once 'includes/widgets/infoboxListFilter.php';
if (Session::isLoggedIn()) {
    $organizer = Session::getUser()->getData('organization');
    if (Session::hasPriv('EDIT_VENUE') || $organizer == $venue['organizer']) {
        $menu = new HtmlLinksCollection('Venue admin');
        $menu->add('formHandler.php?formClazz=FormEditVenue&amp;formEditVenue-id=' . $venue['id'], 'Edit');
        $tpl->assign('linkCollection', $menu);
        $tpl->display('linkCollection.tpl');
    }
}
require_once 'includes/widgets/footer.php';
コード例 #3
0
<?php

require_once 'includes/common.php';
$organizer = fetchOrganizer(fromRequestRequireInt('id'));
define('TITLE', 'Organizer: ' . $organizer['title']);
require_once 'includes/widgets/header.php';
$organizer['logoUrl'] = getOrganizerLogoUrl($organizer['id']);
$tpl->assign('organizer', $organizer);
$events = fetchEventsFromOrganizerId($organizer['id']);
$tpl->assign('events', $events);
if (Session::isLoggedIn() && (Session::getUser()->hasPriv('SUPERUSER') || Session::getUser()->getData('organization') == $organizer['id'])) {
    $sql = 'SELECT u.id, u.username, u.lastLogin FROM users u WHERE u.organization = :organizer';
    $stmt = $db->prepare($sql);
    $stmt->bindValue(':organizer', $organizer['id']);
    $stmt->execute();
    $tpl->assign('associatedUsers', $stmt->fetchAll());
    $sql = 'SELECT v.id, v.title, count(e.id) AS eventCount FROM venues v LEFT JOIN events e ON e.venue = v.id WHERE v.organizer = :organizer GROUP BY v.id';
    $stmt = $db->prepare($sql);
    $stmt->bindValue(':organizer', $organizer['id']);
    $stmt->execute();
    $tpl->assign('associatedVenues', $stmt->fetchAll());
}
$tpl->assign('userlist', Session::hasPriv('USERLIST'));
$tpl->display('viewOrganizer.tpl');
startSidebar();
$nextEvent = getNextEvent($organizer['id']);
echo '<div class = "infobox"><h2>Next event for ' . $organizer['title'] . '</h2>';
if (empty($nextEvent)) {
    echo '<p style = "color:red">To the best of our knowledge, ' . $organizer['title'] . ' has nothing planned... :(</p>';
} else {
    echo '<p>Next event is <a href = "viewEvent.php?id=' . $nextEvent['id'] . '">' . $nextEvent['title'] . '</a></p>';