X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fevent.php;h=b9988badfa1aaddbc110b03bfc8c43770ad5c9b8;hb=57f114d7e1955eb22167b12a9d2453ab096531cc;hp=ca957d0482d4a78d497b44a1c396160d797e3348;hpb=dcbf4d6d11b7128d2410fe3778417f7fa05c403c;p=friendica.git diff --git a/include/event.php b/include/event.php index ca957d0482..b9988badfa 100644 --- a/include/event.php +++ b/include/event.php @@ -627,6 +627,7 @@ function process_events($arr) { // is a real event (no bithdays). if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') { $edit = ((! $rr['cid']) ? array(System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', '') : null); + $copy = ((! $rr['cid']) ? array(System::baseUrl() . '/events/copy/' . $rr['id'], t('Duplicate event'), '', '') : null); $drop = array(System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', ''); } @@ -650,6 +651,7 @@ function process_events($arr) { 'd' => $d, 'edit' => $edit, 'drop' => $drop, + 'copy' => $copy, 'is_first' => $is_first, 'item' => $rr, 'html' => $html, @@ -957,9 +959,11 @@ function format_event_item($item) { // Format the event location. $evloc = event_location2array($item['event-location']); - $location = array( - 'name' => prepare_text($evloc['name']) - ); + $location = array(); + + if (isset($evloc['name'])) { + $location['name'] = prepare_text($evloc['name']); + } // Construct the map HTML. if (isset($evloc['address'])) { $location['map'] = '
' . generate_named_map($evloc['address']) . '
'; @@ -967,6 +971,14 @@ function format_event_item($item) { $location['map'] = '
' . generate_map(str_replace('/', ' ', $evloc['coordinates'])) . '
'; } + // Construct the profile link (magic-auth). + $sp = false; + $profile_link = best_link_url($item, $sp); + + if (!$sp) { + $profile_link = zrl($profile_link); + } + $event = replace_macros(get_markup_template('event_stream_item.tpl'), array( '$id' => $item['event-id'], '$title' => prepare_text($item['event-summary']), @@ -985,9 +997,9 @@ function format_event_item($item) { '$end_time' => $end_time, '$end_short' => $end_short, '$author_name' => $item['author-name'], - '$author_link' => $item['author-link'], + '$author_link' => $profile_link, '$author_avatar' => $item['author-avatar'], - '$description' => prepare_text($item['event-desc']), + '$description' => prepare_text($item['event-desc']), '$location_label' => t('Location:'), '$show_map_label' => t('Show map'), '$hide_map_label' => t('Hide map'),