mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:15:13 +00:00
another bbcode addition for the demo, however this one is potentially useful for other purposes
This commit is contained in:
parent
e47035f85a
commit
7c0101899d
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue