]> git.mxchange.org Git - friendica.git/commitdiff
event communication basics
authorFriendika <info@friendika.com>
Thu, 9 Jun 2011 23:24:29 +0000 (16:24 -0700)
committerFriendika <info@friendika.com>
Thu, 9 Jun 2011 23:24:29 +0000 (16:24 -0700)
boot.php
include/bbcode.php
include/event.php

index 1c7a1570526cfb88f5c4b19012d30ae31fed0f2b..8e8a2bc210a2a346f141d3905500d464a7a1789a 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,7 +4,7 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1005' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1006' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1063      );
 
@@ -150,6 +150,7 @@ define ( 'ACTIVITY_OBJ_PERSON',  NAMESPACE_ACTIVITY_SCHEMA . 'person' );
 define ( 'ACTIVITY_OBJ_PHOTO',   NAMESPACE_ACTIVITY_SCHEMA . 'photo' );
 define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
 define ( 'ACTIVITY_OBJ_ALBUM',   NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
+define ( 'ACTIVITY_OBJ_EVENT',   NAMESPACE_ACTIVITY_SCHEMA . 'event' );
 
 /**
  * item weight for query ordering
index c1576fbcf0bebe9023ee2e1ba979c6f05adb0cf2..6ab67ffdcfee516b4eccc048c813bb3ce25b7b9f 100644 (file)
@@ -37,7 +37,7 @@ function bbcode($Text,$preserve_nl = false) {
        $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
          
        // Check for bold text
-       $Text = preg_replace("(\[b\](.*?)\[\/b])is",'<strong>$1</strong>',$Text);
+       $Text = preg_replace("(\[b\](.*?)\[\/b\])is",'<strong>$1</strong>',$Text);
 
        // Check for Italics text
        $Text = preg_replace("(\[i\](.*?)\[\/i\])is",'<em>$1</em>',$Text);
index 6962a2f1b8f94e5b973c49229941576301e88843..31cf536ffd4853f55cffc9b6d5b304bb27ff7342 100644 (file)
@@ -105,16 +105,63 @@ function parse_event($h) {
 }
 
 
+function format_event_bbcode($ev) {
 
+       $o = '';
 
+       if($ev['desc'])
+               $o .= '[event-description]' . $ev['desc'] . '[/event-description]';
 
+       if($ev['start'])
+               $o .= '[event-start]' . $ev['start'] . '[/event-start]';
 
+       if($ev['start'])
+               $o .= '[event-finish]' . $ev['finish'] . '[/event-finish]';
+       if($ev['location'])
+               $o .= '[event-location]' . $ev['location'] . '[/event-location]';
 
+       if($ev['adjust'])
+               $o .= '[event-adjust]' . $ev['adjust'] . '[/event-adjust]';
 
 
+       return $o;
+
+}
+
+function bbtovcal($s) {
+       $o = '';
+       $ev = bbtoevent($s);
+       if($ev['desc'])
+               $o = format_event_html($ev);
+       return $o;
+}
+
+
+function bbtoevent($s) {
 
+       $ev = array();
 
+       $match = '';
+       if(preg_match("/\[event\-description\](.*?)\[\/event\-description\]/is",$s,$match))
+               $ev['desc'] = $match[1];
+       $match = '';
+       if(preg_match("/\[event\-start\](.*?)\[\/event\-start\]/is",$s,$match))
+               $ev['start'] = $match[1];
+       $match = '';
+       if(preg_match("/\[event\-finish\](.*?)\[\/event\-finish\]/is",$s,$match))
+               $ev['finish'] = $match[1];
+       $match = '';
+       if(preg_match("/\[event\-location\](.*?)\[\/event\-location\]/is",$s,$match))
+               $ev['location'] = $match[1];
+       $match = '';
+       if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
+               $ev['adjust'] = $match[1];
+       $match = '';
 
+       return $ev;
+
+}
 
 
 function sort_by_date($a) {