if ($fbcmdCommand == 'EVENTS') { ValidateParamCount(0, 1); SetDefaultParam(1, time()); $eventAttend = ProcessEventMask($fbcmdPrefs['events_attend_mask']); $fqlEventMember = "SELECT eid,rsvp_status FROM event_member WHERE uid={$fbUser} AND rsvp_status IN ({$eventAttend})"; $keyEventMember = 'eid'; $fqlEvent = "SELECT eid,name,start_time FROM event WHERE eid IN (SELECT eid FROM #fqlEventMember) AND start_time > {$fbcmdParams[1]} ORDER BY start_time"; MultiFQL(array('EventMember', 'Event')); if (!empty($dataEvent)) { PrintHeader(PrintIfPref('event_save', '[#]'), 'START_TIME', 'RSVP', 'EVENT'); $eventNum = 0; foreach ($dataEvent as $event) { $eventNum++; PrintRow(PrintIfPref('event_save', '[' . $eventNum . ']'), date($fbcmdPrefs['event_dateformat'], $event['start_time']), $indexEventMember[$event['eid']]['rsvp_status'], $event['name']); } SaveEventData($dataEvent); } } //////////////////////////////////////////////////////////////////////////////// if ($fbcmdCommand == 'FEED1') { ValidateParamCount(1); SetDefaultParam(1, $fbcmdPrefs['default_feed1_text']); try { $fbReturn = $fbObject->api_client->feed_publishUserAction($fbcmdPrefs['feed_template'], array('title-text' => $fbcmdParams[1], 'body-text' => ''), '', '', FacebookRestClient::STORY_SIZE_ONE_LINE); TraceReturn($fbReturn); } catch (Exception $e) { FbcmdException($e); } } //////////////////////////////////////////////////////////////////////////////// if ($fbcmdCommand == 'FEED2') {
$eventAttend = ProcessEventMask($fbcmdPrefs['events_attend_mask']); $fql = "SELECT eid,name,start_time FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid={$fbUser} AND rsvp_status IN ({$eventAttend})) AND start_time > {$fbcmdParams[1]} ORDER BY start_time"; try { $fbReturn = $fbObject->api_client->fql_query($fql); TraceReturn($fbReturn); } catch (Exception $e) { FbcmdException($e); } if (!empty($fbReturn)) { PrintHeader(PrintIfPref('event_save', '[#]'), 'START_TIME', 'EVENT'); $eventNum = 0; foreach ($fbReturn as $event) { $eventNum++; PrintRow(PrintIfPref('event_save', '[' . $eventNum . ']'), date($fbcmdPrefs['event_dateformat'], $event['start_time']), $event['name']); } SaveEventData($fbReturn); } } //////////////////////////////////////////////////////////////////////////////// if ($fbcmdCommand == 'FEED1') { ValidateParamCount(1); SetDefaultParam(1, $fbcmdPrefs['default_feed1_text']); try { $fbReturn = $fbObject->api_client->feed_publishUserAction($fbcmdPrefs['feed_template'], array('title-text' => $fbcmdParams[1], 'body-text' => ''), '', '', FacebookRestClient::STORY_SIZE_ONE_LINE); TraceReturn($fbReturn); } catch (Exception $e) { FbcmdException($e); } } //////////////////////////////////////////////////////////////////////////////// if ($fbcmdCommand == 'FEED2') {