diff options
author | friendica <info@friendica.com> | 2013-01-16 03:18:32 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-16 03:18:32 -0800 |
commit | af066d7383edfc9c47ceb64076ec38efd6f39edb (patch) | |
tree | b97da0065416bdabf5f8948652f6d5757f2f197b /mod/ping.php | |
parent | 4fd833b9530c93b71dcb2b1587a4b3c5869915ce (diff) | |
download | volse-hubzilla-af066d7383edfc9c47ceb64076ec38efd6f39edb.tar.gz volse-hubzilla-af066d7383edfc9c47ceb64076ec38efd6f39edb.tar.bz2 volse-hubzilla-af066d7383edfc9c47ceb64076ec38efd6f39edb.zip |
mopping up the events issues so I can move on to other stuff
Diffstat (limited to 'mod/ping.php')
-rw-r--r-- | mod/ping.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/ping.php b/mod/ping.php index 347b26eb3..477b9ff0d 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -183,6 +183,8 @@ function ping_init(&$a) { if(argc() > 1 && (argv(1) === 'all_events')) { + $bd_format = t('g A l F d') ; // 8 AM Friday January 18 + $result = array(); $r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash @@ -195,12 +197,23 @@ function ping_init(&$a) { if($r) { foreach($r as $rr) { + if($rr['adjust']) + $md = datetime_convert('UTC',date_default_timezone_get(),$rr['start'],'Y/m'); + else + $md = datetime_convert('UTC','UTC',$rr['start'],'Y/m'); + + $strt = datetime_convert('UTC',$rr['convert'] ? date_default_timezone_get() : 'UTC',$rr['start']); + $today = ((substr($strt,0,10) === datetime_convert('UTC',date_default_timezone_get(),'now','Y-m-d')) ? true : false); + + $when = day_translate(datetime_convert('UTC', $rr['adjust'] ? date_default_timezone_get() : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : ''); + + $result[] = array( - 'notify_link' => $a->get_baseurl() . '/events/' . $rr['event_hash'], + 'notify_link' => $a->get_baseurl() . '/events/event/' . $rr['event_hash'], 'name' => $rr['xchan_name'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], - 'when' => relative_date($rr['start']), + 'when' => $when, 'class' => ('notify-unseen'), 'message' => t('posted an event') ); |