|
6 | 6 |
|
7 | 7 |
|
8 | 8 | // meetups |
9 | | - $meetups = RemoteSystems\Meetup::getEvents(); |
10 | | - $nextMeetup = array_shift($meetups); |
| 9 | + try { |
| 10 | + $meetups = RemoteSystems\Meetup::getEvents(); |
11 | 11 |
|
12 | | - // detect if meetup is happening right now |
13 | | - if($nextMeetup && $nextMeetup['time'] < $now) { |
14 | | - $currentMeetup = $nextMeetup; |
15 | 12 | $nextMeetup = array_shift($meetups); |
| 13 | + |
| 14 | + // detect if meetup is happening right now |
| 15 | + if($nextMeetup && $nextMeetup['time'] < $now) { |
| 16 | + $currentMeetup = $nextMeetup; |
| 17 | + $nextMeetup = array_shift($meetups); |
| 18 | + } |
| 19 | + |
| 20 | + // TODO: delete this! |
| 21 | + elseif(!empty($_GET['force_current'])) { |
| 22 | + $currentMeetup = $nextMeetup; |
| 23 | + } |
| 24 | + |
| 25 | + if($currentMeetup) { |
| 26 | + $currentMeetup['checkins'] = Laddr\MemberCheckin::getAllForMeetupByProject($currentMeetup['id']); |
| 27 | + } |
| 28 | + |
| 29 | + $pageData['currentMeetup'] = $currentMeetup; |
| 30 | + $pageData['nextMeetup'] = $nextMeetup; |
| 31 | + $pageData['futureMeetups'] = $meetups; |
| 32 | + } catch (Exception $e) { |
| 33 | + // just omit meetup data |
16 | 34 | } |
17 | 35 |
|
18 | | - // TODO: delete this! |
19 | | - elseif(!empty($_GET['force_current'])) { |
20 | | - $currentMeetup = $nextMeetup; |
21 | | - } |
22 | | - |
23 | | - if($currentMeetup) { |
24 | | - $currentMeetup['checkins'] = Laddr\MemberCheckin::getAllForMeetupByProject($currentMeetup['id']); |
25 | | - } |
26 | | - |
27 | | - $pageData['currentMeetup'] = $currentMeetup; |
28 | | - $pageData['nextMeetup'] = $nextMeetup; |
29 | | - $pageData['futureMeetups'] = $meetups; |
30 | | - |
31 | | - |
32 | | -// projects |
33 | | - $pageData['projectsTotal'] = Laddr\Project::getCount(); |
34 | | - $pageData['projectsTags']['byTech'] = TagItem::getTagsSummary(array( |
35 | | - 'tagConditions' => array( |
36 | | - 'Handle LIKE "tech.%"' |
37 | | - ) |
38 | | - ,'itemConditions' => array( |
39 | | - 'ContextClass' => Laddr\Project::getStaticRootClass() |
40 | | - ) |
41 | | - ,'limit' => 10 |
42 | | - )); |
43 | | - $pageData['projectsTags']['byTopic'] = TagItem::getTagsSummary(array( |
44 | | - 'tagConditions' => array( |
45 | | - 'Handle LIKE "topic.%"' |
46 | | - ) |
47 | | - ,'itemConditions' => array( |
48 | | - 'ContextClass' => Laddr\Project::getStaticRootClass() |
49 | | - ) |
50 | | - ,'limit' => 10 |
51 | | - )); |
52 | | - $pageData['projectsTags']['byEvent'] = TagItem::getTagsSummary(array( |
53 | | - 'tagConditions' => array( |
54 | | - 'Handle LIKE "event.%"' |
55 | | - ) |
56 | | - ,'itemConditions' => array( |
57 | | - 'ContextClass' => Laddr\Project::getStaticRootClass() |
58 | | - ) |
59 | | - )); |
60 | | - $pageData['projectsStages'] = Laddr\Project::getStagesSummary(); |
61 | | - |
62 | | - |
63 | | -// members |
64 | | - $pageData['membersTotal'] = Emergence\People\Person::getCount(); |
65 | | - $pageData['membersTags']['byTech'] = TagItem::getTagsSummary(array( |
66 | | - 'tagConditions' => array( |
67 | | - 'Handle LIKE "tech.%"' |
68 | | - ) |
69 | | - ,'itemConditions' => array( |
70 | | - 'ContextClass' => Emergence\People\Person::getStaticRootClass() |
71 | | - ) |
72 | | - ,'limit' => 10 |
73 | | - )); |
74 | | - $pageData['membersTags']['byTopic'] = TagItem::getTagsSummary(array( |
75 | | - 'tagConditions' => array( |
76 | | - 'Handle LIKE "topic.%"' |
77 | | - ) |
78 | | - ,'itemConditions' => array( |
79 | | - 'ContextClass' => Emergence\People\Person::getStaticRootClass() |
80 | | - ) |
81 | | - ,'limit' => 10 |
82 | | - )); |
83 | | - |
84 | 36 |
|
85 | 37 | // build activity stream |
86 | 38 | if (!$pageData['activity'] = Cache::fetch('home-activity')) { |
|
0 commit comments