X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=fedbe24468ab67a4085422375974013e279bd77e;hb=abe31d7e60b2c6640abf799f807b8258bed10ab8;hp=8aef0a263613cd8db9afaadf8cfa34361e9cec3d;hpb=0f0fb2e2f3b9819e4f1b65c3ea1b96e78c008381;p=friendica.git diff --git a/include/event.php b/include/event.php index 8aef0a2636..fedbe24468 100644 --- a/include/event.php +++ b/include/event.php @@ -1,9 +1,11 @@

' . "\r\n"; - if(strlen($ev['location'])) + if(strlen($ev['location'])){ $o .= '

' . t('Location:') . ' ' . bbcode($ev['location']) . '

' . "\r\n"; + + if (strpos($ev['location'], "[map")===False) { + $map = generate_named_map($ev['location']); + if ($map!==$ev['location']) $o.=$map; + } + + } $o .= '' . "\r\n"; return $o; @@ -207,7 +216,7 @@ function event_store($arr) { $arr['created'] = (($arr['created']) ? $arr['created'] : datetime_convert()); $arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert()); - $arr['type'] = (($arr['type']) ? $arr['type'] : 'event' ); + $arr['type'] = (($arr['type']) ? $arr['type'] : 'event' ); $arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0); $arr['uri'] = (x($arr,'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(),$arr['uid'])); $arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0); @@ -263,7 +272,7 @@ function event_store($arr) { `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' - WHERE `id` = %d AND `uid` = %d LIMIT 1", + WHERE `id` = %d AND `uid` = %d", dbesc($arr['edited']), dbesc($arr['start']), @@ -291,7 +300,7 @@ function event_store($arr) { $object .= '' . "\n"; - q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s', `private` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", + q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s', `private` = %d WHERE `id` = %d AND `uid` = %d", dbesc(format_event_bbcode($arr)), dbesc($object), dbesc($arr['allow_cid']), @@ -385,13 +394,18 @@ function event_store($arr) { $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($arr['uid']) ); - if(count($r)) - $plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id; + //if(count($r)) + // $plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id; if($item_id) { - q("UPDATE `item` SET `plink` = '%s', `event-id` = %d WHERE `uid` = %d AND `id` = %d LIMIT 1", - dbesc($plink), + //q("UPDATE `item` SET `plink` = '%s', `event-id` = %d WHERE `uid` = %d AND `id` = %d", + // dbesc($plink), + // intval($event['id']), + // intval($arr['uid']), + // intval($item_id) + //); + q("UPDATE `item` SET `event-id` = %d WHERE `uid` = %d AND `id` = %d", intval($event['id']), intval($arr['uid']), intval($item_id)