Skip to content

Commit 96fd6a3

Browse files
feat(bigscreen): use new meetups feed
1 parent 3c2f51d commit 96fd6a3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

site-root/bigscreen.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
<?php
22

3-
$meetups = RemoteSystems\Meetup::getEvents();
3+
$now = new DateTime();
4+
$meetups = Emergence\Meetup\Connector::getUpcomingEvents();
45
$nextMeetup = array_shift($meetups);
56

7+
68
// detect if meetup is happening right now
7-
if($nextMeetup && $nextMeetup['time'] < time() * 1000) {
9+
// - use ?next_meetup_now=1 to test feature before any event
10+
if(
11+
($nextMeetup && $nextMeetup['time_start'] < $now)
12+
|| !empty($_GET['next_meetup_now'])
13+
) {
814
$currentMeetup = $nextMeetup;
9-
$checkins = Laddr\MemberCheckin::getAllByField('MeetupID', $currentMeetup['id'], array('order' => 'ID DESC'));
1015
$nextMeetup = array_shift($meetups);
16+
$checkins = Laddr\MemberCheckin::getAllByField('MeetupID', $currentMeetup['id'], array('order' => 'ID DESC'));
1117
}
12-
18+
19+
1320
RequestHandler::respond('bigscreen', array(
1421
'currentMeetup' => $currentMeetup
1522
,'checkins' => $checkins
1623
,'nextMeetup' => $nextMeetup
17-
));
24+
));

0 commit comments

Comments
 (0)