nic zaradnosci
[php]function bbcode_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);
//
Cytuj:
and
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]","<img src=\"", $text);
$text = str_replace("[/img:$uid]", "\" alt=\"\" border=\"0\" align=\"left\" hspace=\"10\" vspace=\"10\" />", $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);
//
and for bolding text.
$text = str_replace("[b:$uid]","<b>", $text);
$text = str_replace("[/b:$uid]", "</b>", $text);
//
and for underlining text.
$text = str_replace("[u:$uid]", "", $text);
$text = str_replace("[/u:$uid]", "", $text);
//
and for italicizing text.
$text = str_replace("[i:$uid]", "<i>", $text);
$text = str_replace("[/i:$uid]", "</i>", $text);
// [strike] and [/strike] for italicizing text.
$text = str_replace("[strike:$uid]", "", $text);
$text = str_replace("[/strike:$uid]", "", $text);
// [scroll] and [/scroll] for italicizing text.
$text = str_replace("[scroll:$uid]", "", $text);
$text = str_replace("[/scroll:$uid]", "", $text);
// [center] and [/center]
$text = str_replace("[center:$uid]", "\"", $text);
$text = str_replace("[/center:$uid]", "\"", $text);
// Remove our padding from the string..
$text = substr($text, 1);
return $text;
}[/php]
to musisz dac gdzies przed poprzednim kodem i nie, nie musisz instalowac ezportalu
Autor postu otrzymał pochwałę
Pomocy nt. forum lub/i php udzielam tylko na forum.