Fatal error: Cannot redeclare bbencode_strip() (previously declared in /home/virtual/site78/fst/var/www/html/forum/fetchposts.php:212) in /home/virtual/site78/fst/var/www/html/forum/includes/bbcode.php on line 788
Code: Selecteer alles
#
#-----[ OPEN ]---------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND, at end of file ]---------------------------------------------
#
function smiley_sort($a, $b)
{
if ( strlen($a['code']) == strlen($b['code']) )
{
return 0;
}
return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
}
#
#-----[ AFTER, ADD ]---------------------------------------
#
//
// Function strip all BBcodes (borrowed from Mouse Hover Topic Preview MOD)
//
function bbencode_strip($text, $uid)
{
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;
// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )
{
// Remove padding, return.
$text = substr($text, 1);
return $text;
}
// [code] and [ /CODE ] for posting code (HTML, PHP, C etc etc) in your posts.
$text = str_replace("[code:1:$uid]","", $text);
$text = str_replace("[/code:1:$uid]", "", $text);
$text = str_replace("[code:$uid]", "", $text);
$text = str_replace("[/code:$uid]", "", $text);
// [quote] and [/quote] for posting replies with quote, or just for quoting stuff.
$text = str_replace("[quote:1:$uid]","", $text);
$text = str_replace("[/quote:1:$uid]", "", $text);
$text = str_replace("[quote:$uid]", "", $text);
$text = str_replace("[/quote:$uid]", "", $text);
// New one liner to deal with opening quotes with usernames...
// replaces the two line version that I had here before..
$text = preg_replace("/\[quote:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $text);
$text = preg_replace("/\[quote:1:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $text);
// [list] and [list=x] for (un)ordered lists.
// unordered lists
$text = str_replace("[list:$uid]", "", $text);
// li tags
$text = str_replace("[*:$uid]", "", $text);
// ending tags
$text = str_replace("[/list:u:$uid]", "", $text);
$text = str_replace("[/list:o:$uid]", "", $text);
// Ordered lists
$text = preg_replace("/\[list=([a1]):$uid\]/si", "", $text);
// colours
$text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", "", $text);
$text = str_replace("[/color:$uid]", "", $text);
// url #2
$text = str_replace("[url]","", $text);
$text = str_replace("[/url]", "", $text);
// url /\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\](.*?)\[/url\]/si
$text = preg_replace("/\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\]/si", "", $text);
$text = str_replace("[/url:$uid]", "", $text);
// img
$text = str_replace("[img:$uid]","", $text);
$text = str_replace("[/img:$uid]", "", $text);
// email
$text = str_replace("[email:$uid]","", $text);
$text = str_replace("[/email:$uid]", "", $text);
// size
$text = preg_replace("/\[size=([\-\+]?[1-2]?[0-9]):$uid\]/si", "", $text);
$text = str_replace("[/size:$uid]", "", $text);
// align
$text = preg_replace("/\[align=(left|right|center|justify):$uid\]/si", "", $text);
$text = str_replace("[/align:$uid]", "", $text);
// [b] and [/b] for bolding text.
$text = str_replace("[b:$uid]","", $text);
$text = str_replace("[/b:$uid]", "", $text);
// [u] and [/u] for underlining text.
$text = str_replace("[u:$uid]", "", $text);
$text = str_replace("[/u:$uid]", "", $text);
// [i] and [/i] for italicizing text.
$text = str_replace("[i:$uid]", "", $text);
$text = str_replace("[/i:$uid]", "", $text);
// Remove our padding from the string..
$text = substr($text, 1);
return $text;
}