我用的就是他的程式~~
但她的bbcode只有基本的那些...B,I,U,Hide,Code,Quote,Color,Size等的
其他就沒有了!
我是想說,因為我那個BBcode 需要做到判斷是否登入,跟Hide BBcode 有點像!
只不過hide bbcode 是設為 只要該會員有回覆文章,就將隱藏內容顯示!
她的程式碼我看了一下,目前自己找到一部份!
bbcode.php
代碼: 選擇全部
/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/
function hide_in_quote($text)
{
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
return $text;
}
function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;
// 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;
}
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();
if ( $deprotect )
{
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['show'];
}
else
{
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['hide'];
}
$text = preg_replace($patterns, $replacements, $text);
// Remove our padding from the string..
$text = substr($text, 1);
return $text;
}
這邊我就不知道要怎麼樣,去將我的BBCODE跟他一起合併作判斷!
有錯請糾正!