aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-16 02:01:23 -0800
committerfriendica <info@friendica.com>2013-01-16 02:01:23 -0800
commitf1afe680524cc5b06f1c9bc950db2e32d108fb6c (patch)
treed6f5d21db68c5fb71de83ad4592b52044fe56b60 /mod
parenta9f4a47a35eecad03c9c0da58a3febc99fd87453 (diff)
downloadvolse-hubzilla-f1afe680524cc5b06f1c9bc950db2e32d108fb6c.tar.gz
volse-hubzilla-f1afe680524cc5b06f1c9bc950db2e32d108fb6c.tar.bz2
volse-hubzilla-f1afe680524cc5b06f1c9bc950db2e32d108fb6c.zip
typo
Diffstat (limited to 'mod')
-rw-r--r--mod/ping.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 34de31340..347b26eb3 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -181,6 +181,37 @@ function ping_init(&$a) {
}
+ if(argc() > 1 && (argv(1) === 'all_events')) {
+
+ $result = array();
+
+ $r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash
+ WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0
+ ORDER BY `start` DESC ",
+ intval(local_user()),
+ dbesc(datetime_convert('UTC',date_default_timezone_get(),'now + 7 days')),
+ dbesc(datetime_convert('UTC',date_default_timezone_get(),'now - 1 days'))
+ );
+
+ if($r) {
+ foreach($r as $rr) {
+ $result[] = array(
+ 'notify_link' => $a->get_baseurl() . '/events/' . $rr['event_hash'],
+ 'name' => $rr['xchan_name'],
+ 'url' => $rr['xchan_url'],
+ 'photo' => $rr['xchan_photo_s'],
+ 'when' => relative_date($rr['start']),
+ 'class' => ('notify-unseen'),
+ 'message' => t('posted an event')
+ );
+ }
+ }
+ logger('ping: ' . print_r($result,true));
+ echo json_encode(array('notify' => $result));
+ killme();
+
+ }
+
// Normal ping - just the counts