2Hi.Biz
Trang chủ | TWIG | Xtscript | Templates | Xtgem
NTKQB97: tiax gà vãi =)) function bbcode($st - 2Hi.Biz
* NTKQB97
- Cấp bậc: mem
08-06-2015
tiax gà vãi =))
function bbcode($str){
$str = preg_replace('#\[b\](.*?)\[/b\]#si', '<b></b>',$str);
$str = preg_replace('#\[i\](.*?)\[/i\]#si', '<i></i>',$str);
$str = preg_replace('#\[u\](.*?)\[/u\]#si', '<u></u>',$str);
$str = preg_replace('#\[s\](.*?)\[/s\]#si', '<s></s>',$str);
$str = preg_replace('#\[center\](.*?)\[/center\]#si', '<center></center>',$str);
$str = preg_replace("#\[url\](.+?)\[/url\]#is", "<a href=\"\1\" target=\"_blank\" rel=\"nofollow\">\1</a>",$str);
$str = preg_replace("#\[URL=(.+?)\](.+?)\[/URL\]#is", "<a href=\"\1\" target=\"_blank\" rel=\"nofollow\">\2</a>",$str);
$str = preg_replace("#\[COLOR=(.+?)\](.+?)\[/COLOR\]#is", "<font color=\"\1\">\2</font>",$str);
$str = preg_replace("#\[SIZE=(.+?)\](.+?)\[/SIZE\]#is", "<font size=\"\1\">\2</font>",$str);
$str = preg_replace("#\[FONT=(.+?)\](.+?)\[/FONT\]#is", "<font face=\"\1\">\2</font>",$str);
$str = preg_replace("#\[BG=(.+?)\](.+?)\[/BG\]#is", "<font style=\"background: \1\">\2</font>",$str);
$str = preg_replace("#\[QUOTE=\"(.+?)\"\](.+?)\[/QUOTE\]#is", "<div class=\"quote\"> Nguyên văn bởi \"<b>\1</b>\":<br>\2</div>",$str);
$str = preg_replace("#\[QUOTE\](.+?)\[/QUOTE\]#is", "<div class=\"quote\"> Nguyên văn bởi:<br>\1</div>",$str);
$str = preg_replace_callback("/\[code\](.*?)\[\/code\]/is", '_code', $str);
$str = preg_replace(array ('#\[7mau\](.*?)\[\/7mau\]#se'), array ("''.rainbow('$1').''"), str_replace("]\n", "]", $str));
$str = preg_replace(array ('#\[php\](.*?)\[\/php\]#se'), array ("''.highlight('$1').''"), str_replace("]\n", "]", $str));
$str = preg_replace('#\[download\](.*?)\[/download\]#si', '<div class="tai"><div class="tieude"><img src="/inc/img/down.png" alt="Download" /> Tải về</div><div class="cat"></div></div>',$str);
return $str;
}
2 người thích điều này!
Online: Guests: 1