diff options
author | Friendika <info@friendika.com> | 2011-06-09 16:24:29 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-09 16:24:29 -0700 |
commit | 67021c132a4cc6de1fe76aa8faab7bfc37e58423 (patch) | |
tree | 940ae2da796c7dcae8174313b54cb33950fa5c22 /include | |
parent | 9203b48527050b0b4a17120a95b2b3202842d56d (diff) | |
download | volse-hubzilla-67021c132a4cc6de1fe76aa8faab7bfc37e58423.tar.gz volse-hubzilla-67021c132a4cc6de1fe76aa8faab7bfc37e58423.tar.bz2 volse-hubzilla-67021c132a4cc6de1fe76aa8faab7bfc37e58423.zip |
event communication basics
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 2 | ||||
-rw-r--r-- | include/event.php | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index c1576fbcf..6ab67ffdc 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -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); diff --git a/include/event.php b/include/event.php index 6962a2f1b..31cf536ff 100644 --- a/include/event.php +++ b/include/event.php @@ -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) { |