|
From: Jon O. <jon...@us...> - 2008-07-15 22:22:28
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7784 Modified Files: mx_functions.php Log Message: orys update Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** mx_functions.php 13 Jul 2008 20:24:49 -0000 1.86 --- mx_functions.php 15 Jul 2008 22:22:23 -0000 1.87 *************** *** 1046,1049 **** --- 1046,1092 ---- /** + * For display of custom parsed text on user-facing pages + * Expects $text to be the value directly from the database (stored value) + */ + function mx_generate_text_for_display($text, $uid, $bitfield, $flags) + { + global $bbcode, $mx_bbcode; + + if (!$text) + { + return ''; + } + + $text = phpbb3::censor_text($text); + + // Parse bbcode if bbcode uid stored and bbcode enabled + if ($uid && ($flags & OPTION_FLAG_BBCODE)) + { + if (!class_exists('bbcode')) + { + global $phpbb_root_path, $phpEx; + mx_cache::load_file('bbcode', 'phpbb3'); + } + + if (empty($bbcode)) + { + $bbcode = new bbcode($bitfield); + } + else + { + $bbcode->bbcode($bitfield); + } + + $bbcode->bbcode_second_pass($text, $uid); + } + + $text = str_replace("\n", '<br />', $text); + + $text = $mx_bbcode->smilies_pass($text, !($flags & OPTION_FLAG_SMILIES)); + + return $text; + } + + /** * Return data from table. * |