a kod:
Kod: Zaznacz cały
$bbcode= preg_split('/|/',$config['topic_preview_strip_bbcodes']);
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
foreach($bbcode as $key=>$code){
$bbcode[$key]='#\['.$code.'\](.*?)\[/'.$code.'\]#i';
}
$text=preg_replace($bbcode, '\\2', $text);
$uid = $bitfield = $options = '';
$allowed_bbcode = $allowed_smilies = $allowed_urls = true;
/* to enable bbcode, urls and smilies parsing, be enable it when using
generate_text_for_stoarge function */
generate_text_for_storage($text, $uid, $bitfield, $options, true, true, true);
$text = generate_text_for_display($text, $uid, $bitfield, $options);