Code: Selecteer alles
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']);
$bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']);
$bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_tpl['mod_open'] = str_replace('{L_MOD}', $lang['Mod'], $bbcode_tpl['mod_open']);
$bbcode_tpl['mod_username_open'] = str_replace('{L_MOD}', $lang['Mod'], $bbcode_tpl['mod_username_open']);
$bbcode_tpl['mod_username_open'] = str_replace('{L_BY}', $lang['By'], $bbcode_tpl['mod_username_open']);
$bbcode_tpl['mod_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['mod_username_open']);
#
#-----[ FIND ]------------------------------------------
#
// [i] and [/i] for italicizing text.
$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD Mod quote
$text = str_replace("[mod:$uid]", $bbcode_tpl['mod_open'], $text);
$text = str_replace("[/mod:$uid]", $bbcode_tpl['mod_close'], $text);
$text = preg_replace("/\[mod:$uid=(?:\"?([^\"]*)\"?)\]/si", $bbcode_tpl['mod_username_open'], $text);
#
#-----[ FIND ]------------------------------------------
#
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\"[^"]*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD Mod Quote
$text = bbencode_first_pass_pda($text, $uid, '[mod]', '[/mod]', '', false, '');
$text = bbencode_first_pass_pda($text, $uid, '/\[mod=(\\\\"[^"]*?\\\\")\]/is', '[/mod]', '', false, '', "[mod:$uid=\\1]");
#
#-----[ FIND ]------------------------------------------
#
//
// We're going to try and catch usernames with "[' characters.
//
if( preg_match('/\[quote\=\\\\"/si', $possible_start) && !preg_match('/\[quote=\\\\"[^"]*\\\\"\]/si', $possible_start) )
{
//
// OK we are in a quote tag that probably contains a ] bracket.
// Grab a bit more of the string to hopefully get all of it..
//
$possible_start = substr($text, $curr_pos, strpos($text, "\"]", $curr_pos + 1) - $curr_pos + 2);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// MOD Mod Quote
//
if( preg_match('/\[mod\=\\\\"/si', $possible_start) && !preg_match('/\[mod=\\\\"[^"]*\\\\"\]/si', $possible_start) )
{
//
// OK we are in a quote tag that probably contains a ] bracket.
// Grab a bit more of the string to hopefully get all of it..
//
$possible_start = substr($text, $curr_pos, strpos($text, "\"]", $curr_pos + 1) - $curr_pos + 2);
}