aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-12 13:45:11 -0800
committerfriendica <info@friendica.com>2014-02-12 13:45:11 -0800
commit7c0101899da879dc52008bd9c0445d4a24ab9fcb (patch)
tree4dc11ae497c6e226b89ad5147feb124d17095dc1
parente47035f85a680344f2d5f58971ca2629c70c7838 (diff)
downloadvolse-hubzilla-7c0101899da879dc52008bd9c0445d4a24ab9fcb.tar.gz
volse-hubzilla-7c0101899da879dc52008bd9c0445d4a24ab9fcb.tar.bz2
volse-hubzilla-7c0101899da879dc52008bd9c0445d4a24ab9fcb.zip
another bbcode addition for the demo, however this one is potentially useful for other purposes
-rw-r--r--include/bbcode.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index c6ec060af..630be0b89 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -373,6 +373,20 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
}
}
+ $channel = $a->get_channel();
+ if (strpos($Text,'[/channel]') !== false) {
+ if ($channel) {
+ $Text = preg_replace("/\[channel\=1\](.*?)\[\/channel\]/ism", '$1', $Text);
+ $Text = preg_replace("/\[channel\=0\].*?\[\/channel\]/ism", '', $Text);
+ } else {
+ $Text = preg_replace("/\[channel\=1\].*?\[\/channel\]/ism", '', $Text);
+ $Text = preg_replace("/\[channel\=0\](.*?)\[\/channel\]/ism", '$1', $Text);
+ }
+ }
+
+
+
+
$Text = str_replace(array('[baseurl]','[sitename]','[sitepath]'),array(z_root(),get_config('system','sitename'),$_SESSION['return_url']),$Text);