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 | |
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')
-rwxr-xr-x | mod/events.php | 6 | ||||
-rw-r--r-- | mod/ping.php | 17 |
2 files changed, 19 insertions, 4 deletions
diff --git a/mod/events.php b/mod/events.php index 9bcad1f87..975278618 100755 --- a/mod/events.php +++ b/mod/events.php @@ -236,10 +236,11 @@ function events_content(&$a) { intval($_GET['id']) ); } else { + $r = q("SELECT * from event left join item on event_hash = resource_id where resource_type = 'event' and event.uid = %d and event.ignore = %d - AND (( `adjust` = 0 AND `finish` >= '%s' AND `start` <= '%s' ) - OR ( `adjust` = 1 AND `finish` >= '%s' AND `start` <= '%s' )) ", + AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' ) + OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )) ", intval(local_user()), intval($ignored), dbesc($start), @@ -247,6 +248,7 @@ function events_content(&$a) { dbesc($adjust_start), dbesc($adjust_finish) ); + } $links = array(); 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') ); |