引用塊[/quote] [iframe]插入幀地址[/iframe] [iframe=(插入幀高度)]插入幀地址[/iframe] [swf]flash動畫地址[/swf] [swf=寬度,高度]flash動畫地址[/swf] 代碼塊:
[php][/php] [code 代碼塊名稱][/code] [php 代碼塊名稱][/php] 如需使用php文法高亮請務必在代碼塊兩端加上""標籤 */ class EncodeQ3boy { var $str = ""; var $iconpath = "/image/icon";//表徵圖檔案路徑 var $imagepath = "/upfiles/article";//圖片檔案預設路徑 var $tagfoot = ' border="1" style="cursor: hand" ';//圖片檔案附加屬性 var $url = false; //url自動解析 var $html = true; //HTML編碼 var $image = true; //解析圖象標籤 var $font = true; //字型標籤 var $element = true; //外部元素 var $flash = true; //Flash var $php = true; //文法高亮顯示 function EncodeQ3boy($str='',$imgph='') { if($str) { $str = strtr($str,array("nr"=>"n","rn"=>"n","r"=>"n"," "=>" ")); $this->str = $str; } if($imgph) $this->imagepath = $imgph; } function getImageOpener() { Return ""; } function removeHtml($str='') { if(!$str) $str = $this->str; return strip_tags($str); } function removeUbb($str='') { if(!$str) $str = $this->str; return preg_replace("/[/?w+(s+[^]s]+)*s*]/is","",$str); } function htmlEncode($str='') { if(!$str) $str = $this->str; $ary = array( '<'=>'<', '>'=>'>', " "=>" ", " "=>" " ); $str = preg_replace("/n{2,}/s","nn",strtr($str,$ary)); Return str_replace("n","n ",$str); } function ubbEncode($str='') { if(!$str) $str = $this->str; $rpl_ary = array(); $rpl_ary = array(); if($this->html) $str = $this->htmlEncode($str,true); $tagfoot = $this->tagfoot; $icon = $this->iconpath; $image = $this->imagepath; if($this->php) { preg_match_all('/(n )*[(php|code)s*(.*?)]s*(.+?)s*[/(php|code)](n )*/is',$str,$ary); $str = preg_split('/(n )*[(php|code)s*(.*?)]s*(.+?)s*[/(php|code)](n )*/is',$str); } if($this->url){ $reg_ary = array_merge($reg_ary,array( '/(? '/(? )); $rpl_ary = array_merge($rpl_ary,array( '1', '1', )); } if($this->image) { $reg_ary = array_merge($reg_ary,array( '//i', '/[limg]s*http(s?)://(S+)s*[/limg]/i', '/[rimg]s*http(s?)://(S+)s*[/rimg]/i', '/[cimg]s*http(s?)://(S+)s*[/cimg]/i', '/[img]s*([^/:]+)s*[/img]/i', '/[limg]s*([^/:]+)s*[/limg]/i', '/[rimg]s*([^/:]+)s*[/rimg]/i', '/[cimg]s*([^/:]+)s*[/cimg]/i', '//i', '/[limg]s*(S+)s*[/limg]/i', '/[rimg]s*(S+)s*[/rimg]/i', '/[cimg]s*(S+)s*[/cimg]/i', )); $rpl_ary = array_merge($rpl_ary,array( '', '', '', '', '', '', '', '', '', '', '', '', )); } if($this->font) { $reg_ary = array_merge($reg_ary,array( '/[br]/i', '/s*(.+?)s*/is', '/s*(.+?)s*/is', '/s*(.+?)s*/is', '/[s]s*(.+?)s*[/s]/is', '/[sub]s*(.+?)s*[/sub]/is', '/[sup]s*(.+?)s*[/sup]/is', '/[left]s*(.+?)s*[/left]/is', '/[right]s*(.+?)s*[/right]/is', '/s*(.+?)s*/is', '/[align=s*(left|center|right)]s*(.+?)s*[/align]/is', '/[size=s*([.|d])s*]s*(.*?)s*/is', '/[font=s*(.*?)s*]s*(.*?)s*[/font]/is', '/s*(.*?)s*/is', '/
/is', '/
/is', '/
/is', '/
/is', '/[li]s*(.+?)s*[/li]/is', )); $rpl_ary = array_merge($rpl_ary,array( ' ', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '2', '2', '2', '
', '
2
', '
3
', '
3
', '1', )); } if($this->element){ $reg_ary = array_merge($reg_ary,array( '/s*(.+?)s*/i', '/s*(.+?)s*/i', '/s*(.+?)s*/i', '/s*(.+?)s*/i', '/[quote]s*( )?s*(.+?)s* |
|