X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=8d47b5fba56838d1f841359f3375739b79e7cd2b;hb=3b2cd854837e5df38f75f323aab24e31098812d4;hp=229aa8cd460f52e9c1373a6518bb248dfbecc661;hpb=2c55d9f3ce47796294a27b3ca342590e38248e60;p=friendica.git diff --git a/include/event.php b/include/event.php index 229aa8cd46..8d47b5fba5 100644 --- a/include/event.php +++ b/include/event.php @@ -5,7 +5,9 @@ */ use Friendica\App; +use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\DBM; require_once 'include/bbcode.php'; require_once 'include/map.php'; @@ -253,7 +255,7 @@ function event_store($arr) { ); } - if (dbm::is_result($c)) { + if (DBM::is_result($c)) { $contact = $c[0]; } @@ -268,7 +270,7 @@ function event_store($arr) { intval($arr['id']), intval($arr['uid']) ); - if ((! dbm::is_result($r)) || ($r[0]['edited'] === $arr['edited'])) { + if ((! DBM::is_result($r)) || ($r[0]['edited'] === $arr['edited'])) { // Nothing has changed. Grab the item id to return. @@ -276,7 +278,7 @@ function event_store($arr) { intval($arr['id']), intval($arr['uid']) ); - return ((dbm::is_result($r)) ? $r[0]['id'] : 0); + return ((DBM::is_result($r)) ? $r[0]['id'] : 0); } // The event changed. Update it. @@ -309,7 +311,7 @@ function event_store($arr) { intval($arr['id']), intval($arr['uid']) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $object = '' . xmlify(ACTIVITY_OBJ_EVENT) . '' . xmlify($arr['uri']) . ''; $object .= '' . xmlify(format_event_bbcode($arr)) . ''; $object .= '' . "\n"; @@ -360,7 +362,7 @@ function event_store($arr) { dbesc($arr['uri']), intval($arr['uid']) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $event = $r[0]; } @@ -403,7 +405,7 @@ function event_store($arr) { $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($arr['uid']) ); - //if (dbm::is_result($r)) + //if (DBM::is_result($r)) // $plink = System::baseUrl() . '/display/' . $r[0]['nickname'] . '/' . $item_id; @@ -435,7 +437,7 @@ function event_store($arr) { function get_event_strings() { // First day of the week (0 = Sunday). - $firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week'); + $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week'); if ($firstDay === false) { $firstDay = 0; } @@ -546,7 +548,7 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') { intval($event_params["event_id"]) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { return event_remove_duplicates($r); } } @@ -590,7 +592,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') { dbesc($event_params["adjust_finish"]) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { return event_remove_duplicates($r); } } @@ -804,7 +806,7 @@ function events_by_uid($uid = 0, $sql_extra = '') { ); } - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { return $r; } } @@ -828,7 +830,7 @@ function event_export($uid, $format = 'ical') { // We are allowed to show events. // Get the timezone the user is in. $r = q("SELECT `timezone` FROM `user` WHERE `uid` = %d LIMIT 1", intval($uid)); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $timezone = $r[0]['timezone']; } @@ -971,6 +973,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']), @@ -989,9 +999,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'),