예제 #1
0
<?php

$meetups = RemoteSystems\Meetup::getEvents();
$nextMeetup = array_shift($meetups);
// detect if meetup is happening right now
if ($nextMeetup && $nextMeetup['time'] < time() * 1000) {
    $currentMeetup = $nextMeetup;
    $checkins = Laddr\MemberCheckin::getAllByField('MeetupID', $currentMeetup['id'], array('order' => 'ID DESC'));
    $nextMeetup = array_shift($meetups);
}
RequestHandler::respond('bigscreen', array('currentMeetup' => $currentMeetup, 'checkins' => $checkins, 'nextMeetup' => $nextMeetup));
예제 #2
0
파일: home.php 프로젝트: Sun-Wukong/laddr
// compile home page data
$now = time() * 1000;
$pageData = array();
// meetups
$meetups = RemoteSystems\Meetup::getEvents();
$nextMeetup = array_shift($meetups);
// detect if meetup is happening right now
if ($nextMeetup && $nextMeetup['time'] < $now) {
    $currentMeetup = $nextMeetup;
    $nextMeetup = array_shift($meetups);
} elseif (!empty($_GET['force_current'])) {
    $currentMeetup = $nextMeetup;
}
if ($currentMeetup) {
    $currentMeetup['checkins'] = Laddr\MemberCheckin::getAllForMeetupByProject($currentMeetup['id']);
}
$pageData['currentMeetup'] = $currentMeetup;
$pageData['nextMeetup'] = $nextMeetup;
$pageData['futureMeetups'] = $meetups;
// projects
$pageData['projectsTotal'] = Laddr\Project::getCount();
$pageData['projectsTags']['byTech'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "tech.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsTags']['byTopic'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "topic.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsTags']['byEvent'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "event.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsStages'] = Laddr\Project::getStagesSummary();
// members
$pageData['membersTotal'] = Emergence\People\Person::getCount();
$pageData['membersTags']['byTech'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "tech.%"'), 'itemConditions' => array('ContextClass' => Emergence\People\Person::getStaticRootClass())));
$pageData['membersTags']['byTopic'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "topic.%"'), 'itemConditions' => array('ContextClass' => Emergence\People\Person::getStaticRootClass())));
// build activity stream