0) { foreach ($groups[$i+1] as $code) { if ($tpl_codes[$code]) $separator = true; } } if ($separator) { $tpl_groups[$i] = true; $count = 0; } } $template->assign(array( 'BBC' => $tpl_codes, 'SEP' => $tpl_groups, 'BBCODE_PATH' => BBcode_PATH, 'BBCODE_ID' => $textarea_id, )); $template->set_prefilter($prefilter, 'set_bbcode_bar_prefilter'); // smilies support > 2.3 ## must be parsed after bbcode_bar, because the javascript must be after bbc's one if (isset($pwg_loaded_plugins['SmiliesSupport'])) { set_smiliessupport($prefilter, $textarea_id); } } function set_bbcode_bar_prefilter($content, &$smarty) { $search = '#(
\\1
\\1
\\1'; //Quotes with "user" $patterns[] = "#\[quote="(.*?)"\](.*?)\[/quote\]#is"; $replacements[] = '
\\1 :'; //Quotes with user $patterns[] = "#\[quote=(.*?)\](.*?)\[/quote\]#is"; $replacements[] = '
\\2
\\1 :'; } if ($conf_bbcode_bar['img']) { //Images $patterns[] = "#\[img\](.*?)\[/img\]#is"; $replacements[] = ''; } if ($conf_bbcode_bar['url']) { //[url]xxxx://www.zzzz.yyy[/url] $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is"; $replacements[] = '\\1'; //[url]www.zzzzz.yyy[/url] $patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is"; $replacements[] = '\\1'; //[url=xxxx://www.zzzzz.yyy]ZzZzZ[/url] $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is"; $replacements[] = '\\2'; //[url=www.zzzzz.yyy]zZzZz[/url] $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is"; $replacements[] = '\\2'; //[url="www.zzzzz.yyy"]zZzZz[/url] $patterns[] = "#\[url="((www|ftp)\.[^ \n\r\t<]*?)"\](.*?)\[/url\]#is"; $replacements[] = '\\3'; //[url="http://www.zzzzz.yyy"]zZzZz[/url] $patterns[] = "#\[url="([\w]+?://[^ \n\r\t<]*?)"\](.*?)\[/url\]#is"; $replacements[] = '\\2'; } if ($conf_bbcode_bar['email']) { //[email]samvure@gmail.com[/email] $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#is"; $replacements[] = '\\1'; } if ($conf_bbcode_bar['size']) { //Size $patterns[] = "#\[size=([1-2]?[0-9])\](.*?)\[/size\]#is"; $replacements[] = '\\2'; } if ($conf_bbcode_bar['color']) { //Colours $patterns[] = "#\[color=(\#[0-9A-F]{6}|\#[0-9A-F]{3}|[a-z]+)\](.*?)\[/color\]#is"; $replacements[] = '\\2'; } return preg_replace($patterns, $replacements, $str); } ?>
\\2