diff options
author | friendica <info@friendica.com> | 2013-01-07 15:12:16 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-07 15:12:16 -0800 |
commit | da188214c304cefaa6fe0a36e1f60932da2f3bfb (patch) | |
tree | 9d4cf84f1fad3af4f7da3adeaf9ede4d04885bf2 /mod/events.php | |
parent | 31ce6a3876fc0a3c37be1474a627ec0cea0e3622 (diff) | |
download | volse-hubzilla-da188214c304cefaa6fe0a36e1f60932da2f3bfb.tar.gz volse-hubzilla-da188214c304cefaa6fe0a36e1f60932da2f3bfb.tar.bz2 volse-hubzilla-da188214c304cefaa6fe0a36e1f60932da2f3bfb.zip |
events are still buggered and aren't anywhere close to working, but not buggered quite as much as before.
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mod/events.php b/mod/events.php index 7886f27c0..0002bf11c 100755 --- a/mod/events.php +++ b/mod/events.php @@ -238,16 +238,13 @@ function events_content(&$a) { if (x($_GET,'id')){ - $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, - `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` - WHERE `event`.`uid` = %d AND `event`.`id` = %d", + $r = q("SELECT event.*, item.* from event left join item on event.id = item.resource_id where resource_type = 'event' and event.uid = %d and event.id = %d limit 1", intval(local_user()), intval($_GET['id']) ); } else { - $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, - `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` - WHERE `event`.`uid` = %d and ignore = %d + $r = q("SELECT event.*, item.* from event left join item on event.id = item.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' )) ", intval(local_user()), @@ -262,7 +259,11 @@ function events_content(&$a) { $links = array(); if($r) { + xchan_query($r); + $r = fetch_post_tags($r); + $r = sort_by_date($r); + foreach($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if(! x($links,$j)) @@ -277,10 +278,9 @@ function events_content(&$a) { $fmt = t('l, F j'); if($r) { - $r = sort_by_date($r); + foreach($r as $rr) { - $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); $d = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], $fmt) : datetime_convert('UTC','UTC',$rr['start'],$fmt)); $d = day_translate($d); @@ -296,6 +296,7 @@ function events_content(&$a) { $is_first = ($d !== $last_date); $last_date = $d; +// FIXME $edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null); $title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8')); if(! $title) { |