aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bb2diaspora.php15
-rw-r--r--include/event.php2
-rw-r--r--include/items.php1
3 files changed, 8 insertions, 10 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index c72c78445..bdf278213 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -11,12 +11,7 @@ function diaspora2bb($s) {
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
$s = Markdown($s);
$s = html2bbcode($s);
-
-// $s = preg_replace('/\[url=(.+?)\<em\>(.+?)\]/ism','[url=$1_$2]',$s);
-// $s = preg_replace('/\[url=(.+?)\<\/em\>(.+?)\]/ism','[url=$1_$2]',$s);
-
return $s;
-
}
@@ -185,6 +180,8 @@ function bb2diaspora($Text,$preserve_nl = false) {
function format_event_diaspora($ev) {
+ $a = get_app();
+
if(! ((is_array($ev)) && count($ev)))
return '';
@@ -194,20 +191,20 @@ function format_event_diaspora($ev) {
$o .= '**' . bb2diaspora($ev['desc']) . '**' . "\n";
- $o .= t('Starts:') . ' '
+ $o .= t('Starts:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format)))
- . "\n";
+ . '](' . $a->get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
if(! $ev['nofinish'])
- $o .= t('Finishes:') . ' '
+ $o .= t('Finishes:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format )))
- . "\n";
+ . '](' . $a->get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
if(strlen($ev['location']))
$o .= t('Location:') . bb2diaspora($ev['location'])
diff --git a/include/event.php b/include/event.php
index 99f685d0b..746422a13 100644
--- a/include/event.php
+++ b/include/event.php
@@ -352,7 +352,7 @@ function event_store($arr) {
$item_arr['visible'] = 1;
$item_arr['verb'] = ACTIVITY_POST;
$item_arr['object-type'] = ACTIVITY_OBJ_EVENT;
-
+ $item_arr['origin'] = ((intval($arr['cid']) == 0) ? 1 : 0);
$item_arr['body'] = format_event_bbcode($event);
diff --git a/include/items.php b/include/items.php
index 0c3c8b1d7..136dee90f 100644
--- a/include/items.php
+++ b/include/items.php
@@ -730,6 +730,7 @@ function item_store($arr,$force_parent = false) {
$arr['tag'] = ((x($arr,'tag')) ? notags(trim($arr['tag'])) : '');
$arr['attach'] = ((x($arr,'attach')) ? notags(trim($arr['attach'])) : '');
$arr['app'] = ((x($arr,'app')) ? notags(trim($arr['app'])) : '');
+ $arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 );
$arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid());
if($arr['parent-uri'] === $arr['uri']) {