diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-20 18:43:01 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-20 18:43:01 -0700 |
commit | afbbc9cd72e48a9eb4fb035eb01cd6e742d0088e (patch) | |
tree | 7b059c8ae935238f472fb02aa859a020bd08499f /mod/events.php | |
parent | 05bec13bdc59713c89f0545d3a2955d886969dba (diff) | |
download | volse-hubzilla-afbbc9cd72e48a9eb4fb035eb01cd6e742d0088e.tar.gz volse-hubzilla-afbbc9cd72e48a9eb4fb035eb01cd6e742d0088e.tar.bz2 volse-hubzilla-afbbc9cd72e48a9eb4fb035eb01cd6e742d0088e.zip |
more work on tasks
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/mod/events.php b/mod/events.php index 56c4ece54..15fed9df2 100755 --- a/mod/events.php +++ b/mod/events.php @@ -391,8 +391,18 @@ function events_content(&$a) { intval(local_channel()), intval($_GET['id']) ); - } else { - + } elseif($export) { + $r = q("SELECT * from event where uid = %d + AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) + OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", + intval(local_channel()), + dbesc($start), + dbesc($finish), + dbesc($adjust_start), + dbesc($adjust_finish) + ); + } + else { // fixed an issue with "nofinish" events not showing up in the calendar. // There's still an issue if the finish date crosses the end of month. // Noting this for now - it will need to be fixed here and in Friendica. @@ -400,7 +410,7 @@ function events_content(&$a) { $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type in ( 'event', 'birthday' ) and event.uid = %d $ignored + where resource_type = 'event' and event.uid = %d $ignored AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", intval(local_channel()), @@ -411,14 +421,17 @@ function events_content(&$a) { ); } + $links = array(); - if($r) { + if($r && ! $export) { xchan_query($r); $r = fetch_post_tags($r,true); $r = sort_by_date($r); + } + if($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)) @@ -426,7 +439,6 @@ function events_content(&$a) { } } - $events=array(); $last_date = ''; |