X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fevent.php;h=a9f054fc2ed2bf530e9c6c0d9fbadf7570313c6d;hb=146dc5c8cd75dd34b5d0e0f1f214927cdd10ea4b;hp=d474d084d94706304ce6110b7fec013ceb1fd556;hpb=29092ace4428aeb796b31856aafa14cef1632bac;p=friendica.git
diff --git a/include/event.php b/include/event.php
index d474d084d9..a9f054fc2e 100644
--- a/include/event.php
+++ b/include/event.php
@@ -1,15 +1,43 @@
".bbcode($ev['summary'])."";
+
+ $o .= "
' . "\r\n";
@@ -19,28 +47,27 @@ function format_event_html($ev) {
$o .= '
' . t('Starts:') . ' '
- . (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
- $ev['start'] , $bd_format ))
- : day_translate(datetime_convert('UTC', 'UTC',
- $ev['start'] , $bd_format)))
+ . '" >'.$event_start
. '
' . "\r\n";
if(! $ev['nofinish'])
$o .= '
' . t('Finishes:') . ' '
- . (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
- $ev['finish'] , $bd_format ))
- : day_translate(datetime_convert('UTC', 'UTC',
- $ev['finish'] , $bd_format )))
+ . '" >'.$event_end
. '
' . "\r\n";
- if(strlen($ev['location']))
- $o .= '
' . t('Location:') . ' '
- . bbcode($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;
}
@@ -49,7 +76,6 @@ function format_event_html($ev) {
function parse_event($h) {
require_once('include/Scrape.php');
- require_once('library/HTMLPurifier.auto.php');
require_once('include/html2bbcode');
$h = '' . $h . '';
@@ -128,7 +154,7 @@ function format_event_bbcode($ev) {
if(($ev['finish']) && (! $ev['nofinish']))
$o .= '[event-finish]' . $ev['finish'] . '[/event-finish]';
-
+
if($ev['location'])
$o .= '[event-location]' . $ev['location'] . '[/event-location]';
@@ -191,11 +217,17 @@ function ev_compare($a,$b) {
if($date_a === $date_b)
return strcasecmp($a['desc'],$b['desc']);
-
+
return strcmp($date_a,$date_b);
}
+function event_delete($event_id) {
+ if ($event_id == 0)
+ return;
+ q("DELETE FROM `event` WHERE `id` = %d", intval($event_id));
+ logger("Deleted event ".$event_id, LOGGER_DEBUG);
+}
function event_store($arr) {
@@ -315,7 +347,7 @@ function event_store($arr) {
}
else {
- // New event. Store it.
+ // New event. Store it.
$r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`,
`adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`)
@@ -353,6 +385,7 @@ function event_store($arr) {
$item_arr['contact-id'] = $arr['cid'];
$item_arr['uri'] = $arr['uri'];
$item_arr['parent-uri'] = $arr['uri'];
+ $item_arr['guid'] = $arr['guid'];
$item_arr['type'] = 'activity';
$item_arr['wall'] = (($arr['cid']) ? 0 : 1);
$item_arr['contact-id'] = $contact['id'];
@@ -385,13 +418,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",
- 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)