diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-11-18 23:50:42 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-11-18 23:50:42 +0100 |
commit | e4145deeb7a72ac321113fde672e1b499ecb0d2d (patch) | |
tree | ce2fb59fd9d2ec1d13ea0960215967600098ca13 /mod | |
parent | 68da4d90dcbda1240ae014768a66a164fd5d2b36 (diff) | |
download | volse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.tar.gz volse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.tar.bz2 volse-hubzilla-e4145deeb7a72ac321113fde672e1b499ecb0d2d.zip |
some events refacturing
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/events.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/mod/events.php b/mod/events.php index d76602a33..230e386ce 100755 --- a/mod/events.php +++ b/mod/events.php @@ -288,14 +288,9 @@ function events_content(&$a) { )); $o =""; - // tabs $channel = $a->get_channel(); - $tabs = profile_tabs($a, True, $channel['channel_address']); - - - $mode = 'view'; $y = 0; $m = 0; @@ -378,10 +373,10 @@ function events_content(&$a) { if (argv(1) === 'json'){ - if (x($_GET,'start')) $start = date("Y-m-d h:i:s", $_GET['start']); - if (x($_GET,'end')) $finish = date("Y-m-d h:i:s", $_GET['end']); + if (x($_GET,'start')) $start = $_GET['start']; + if (x($_GET,'end')) $finish = $_GET['end']; } - + $start = datetime_convert('UTC','UTC',$start); $finish = datetime_convert('UTC','UTC',$finish); @@ -413,18 +408,21 @@ 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 = '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' )) ", + 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()), dbesc($start), dbesc($finish), dbesc($adjust_start), dbesc($adjust_finish) ); + } + + $links = array(); if($r && ! $export) { @@ -500,7 +498,7 @@ function events_content(&$a) { } } - + if($export) { header('Content-type: text/calendar'); header('content-disposition: attachment; filename="' . t('calendar') . '-' . $channel['channel_address'] . '.ics"' ); @@ -522,16 +520,17 @@ function events_content(&$a) { $o = replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), - '$tabs' => $tabs, '$title' => t('Events'), - '$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''), + '$new_event'=> array($a->get_baseurl().'/events/new',t('New Event'),'',''), '$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''), '$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''), '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''), '$calendar' => cal($y,$m,$links, ' eventcal'), '$events' => $events, '$upload' => t('Import'), - '$submit' => t('Submit') + '$submit' => t('Submit'), + '$prev' => t('Previous'), + '$next' => t('Next'), )); if (x($_GET,'id')){ echo $o; killme(); } |