PHP操作ubb代码类
<OL><LI><CODE><FONT face=新宋体><?PHP</FONT></CODE><LI><CODE><FONT face=新宋体>//ubbcode类</FONT></CODE><LI><CODE><FONT face=新宋体>class ubbcode</FONT></CODE><LI><CODE><FONT face=新宋体>{</FONT></CODE><LI><CODE><FONT face=新宋体> var $nest;// 递归深度,for debug</FONT></CODE><LI><CODE><FONT face=新宋体> //可处理标签及处理函数表</FONT></CODE><LI><CODE><FONT face=新宋体> var $tags = array(</FONT></CODE><LI><CODE><FONT face=新宋体> 'url' => '$this->url',</FONT></CODE><LI><CODE><FONT face=新宋体> 'email' => '$this->email',</FONT></CODE><LI><CODE><FONT face=新宋体> 'mail' => '$this->email',// 为了容错,和等效</FONT></CODE><LI><CODE><FONT face=新宋体> 'img' => '$this->img',</FONT></CODE><LI><CODE><FONT face=新宋体> 'b' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'i' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'u' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'tt' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 's' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'strike' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h1' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h2' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h3' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h4' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h5' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'h6' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'sup' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'sub' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'em' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'strong' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'code' => '$this->simple', </FONT></CODE><LI><CODE><FONT face=新宋体> 'small' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'big' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'blink' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'fly' => '$this->fly',</FONT></CODE><LI><CODE><FONT face=新宋体> 'move' => '$this->move',</FONT></CODE><LI><CODE><FONT face=新宋体> 'glow' => '$this->CSSStyle',</FONT></CODE><LI><CODE><FONT face=新宋体> 'shadow' => '$this->CSSStyle',</FONT></CODE><LI><CODE><FONT face=新宋体> 'blur' => '$this->CSSStyle',</FONT></CODE><LI><CODE><FONT face=新宋体> 'wave' => '$this->CSSStyle',</FONT></CODE><LI><CODE><FONT face=新宋体> 'sub' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'sup' => '$this->simple',</FONT></CODE><LI><CODE><FONT face=新宋体> 'size' => '$this->size',</FONT></CODE><LI><CODE><FONT face=新宋体> 'face' => '$this->face',</FONT></CODE><LI><CODE><FONT face=新宋体> 'font' => '$this->face',// 为了容错,和等效</FONT></CODE><LI><CODE><FONT face=新宋体> 'color' => '$this->color',</FONT></CODE><LI><CODE><FONT face=新宋体> 'html' => '$this->html',</FONT></CODE><LI><CODE><FONT face=新宋体> 'quote' => '$this->quote',</FONT></CODE><LI><CODE><FONT face=新宋体> 'swf' => '$this->swf',</FONT></CODE><LI><CODE><FONT face=新宋体> 'upload' => '$this->upload'</FONT></CODE><LI><CODE><FONT face=新宋体> );</FONT></CODE><LI><CODE><FONT face=新宋体> function ubbcode()</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $this->$nest= 0;</FONT></CODE><LI><CODE><FONT face=新宋体> $this->$sLastModified= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("%s", <A href="http://www.php.net/manual/zh/function.date"><U><FONT color=#0000ff>date</FONT></U></A>("Y-m-j H:i", <A href="http://www.php.net/manual/zh/function.getlastmod"><U><FONT color=#0000ff>getlastmod</FONT></U></A>()));</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><LI><CODE><FONT face=新宋体> /***********************************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> *对使用者输入的 E-Mail 作简单的检查,</FONT></CODE><LI><CODE><FONT face=新宋体> *检查使用者的 E-Mail 字串是否有 @ 字元,</FONT></CODE><LI><CODE><FONT face=新宋体> *在 @ 字元前有英文字母或数字,在之后有数节字串,</FONT></CODE><LI><CODE><FONT face=新宋体> *最后的小数点后只能有二个或三个英文字母。</FONT></CODE><LI><CODE><FONT face=新宋体> *super@mail.wilson.gs 就可以通过检查,super@mail.wilson 就不能通过检查</FONT></CODE><LI><CODE><FONT face=新宋体> ************************************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function emailcheck($str) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("^+@(+\.)+{2,3}$", $str)) </FONT></CODE><LI><CODE><FONT face=新宋体> return true;</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return false;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /***********************************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> *对使用者输入的 URL 作简单的检查,</FONT></CODE><LI><CODE><FONT face=新宋体> *目前只能简单判断,不能自动检查fpt,finger等</FONT></CODE><LI><CODE><FONT face=新宋体> ************************************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function checkURL($str) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $bValidURL= true;</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("(+([\.]+)+)", $str, $er_arr)) </FONT></CODE><LI><CODE><FONT face=新宋体> { </FONT></CODE><LI><CODE><FONT face=新宋体>/*</FONT></CODE><LI><CODE><FONT face=新宋体>printf ("0. %s <br/>\n", $er_arr);</FONT></CODE><LI><CODE><FONT face=新宋体>printf ("1. %s <br/>\n", $er_arr);</FONT></CODE><LI><CODE><FONT face=新宋体>printf ("2. %s <br/>\n", $er_arr);</FONT></CODE><LI><CODE><FONT face=新宋体>printf ("3. %s <br/>\n", $er_arr);</FONT></CODE><LI><CODE><FONT face=新宋体>printf ("4. %s <br/>\n", $er_arr);</FONT></CODE><LI><CODE><FONT face=新宋体>*/</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> $bValidURL= false;</FONT></CODE><LI><CODE><FONT face=新宋体> return $bValidURL;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /***********************************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> *对使用者输入的 图片URL 作简单的检查,</FONT></CODE><LI><CODE><FONT face=新宋体> *目前只能简单判断结尾是否为图片文件</FONT></CODE><LI><CODE><FONT face=新宋体> *不支持由CGI动态生成的图片,比如计数器这类的</FONT></CODE><LI><CODE><FONT face=新宋体> ************************************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function checkImgURL($str) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if ($this->checkURL($str)) {</FONT></CODE><LI><CODE><FONT face=新宋体> if(<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("\.(jpeg|jpg|gif|bmp|png|pcx|tiff|tga|lwf)$", $str)) </FONT></CODE><LI><CODE><FONT face=新宋体> return true;</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return false;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return false;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /***********************************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> *自动补全URL部分,主要是协议前缀,</FONT></CODE><LI><CODE><FONT face=新宋体> *默认是htpp://,支持https://;ftp://;finger://;gopher://等</FONT></CODE><LI><CODE><FONT face=新宋体> *函数并不对URL的合法性作检查</FONT></CODE><LI><CODE><FONT face=新宋体> ************************************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function formatURL($str) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (!<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("^(ftp|http|https|mms|gopher|finger|bbs|telnet):(\/\/|\\\\)", $str))</FONT></CODE><LI><CODE><FONT face=新宋体> $str= 'http://'.$str;</FONT></CODE><LI><CODE><FONT face=新宋体> return $str;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> //对$str进行UBB编码解析</FONT></CODE><LI><CODE><FONT face=新宋体> function parse($str)</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $nest ++;</FONT></CODE><LI><CODE><FONT face=新宋体> $parse = ''.($str);</FONT></CODE><LI><CODE><FONT face=新宋体> $ret = '';</FONT></CODE><LI><CODE><FONT face=新宋体> while(true){</FONT></CODE><LI><CODE><FONT face=新宋体> //查找 或者 , 但不包括</FONT></CODE><LI><CODE><FONT face=新宋体> $eregi_ret=<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("\[({0,7})(=+)?\]", $parse, $eregi_arr); </FONT></CODE><LI><CODE><FONT face=新宋体> if(!$eregi_ret)</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $ret .= $parse;</FONT></CODE><LI><CODE><FONT face=新宋体> break; //如果没有,返回</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体>/*for Debug</FONT></CODE><LI><CODE><FONT face=新宋体> else </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> printf ("$. %s<br/>", $eregi_ret);</FONT></CODE><LI><CODE><FONT face=新宋体> printf ("0. %s<br/>", $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> printf ("1. %s<br/>", $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> printf ("2. %s<br/>", $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> printf ("3. %s<br/>", $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体>*/</FONT></CODE><LI><LI><CODE><FONT face=新宋体> $pos = @<A href="http://www.php.net/manual/zh/function.strpos"><U><FONT color=#0000ff>strpos</FONT></U></A>($parse, $eregi_arr);// 起始位置</FONT></CODE><LI><CODE><FONT face=新宋体> $tag_start= $eregi_arr;</FONT></CODE><LI><CODE><FONT face=新宋体> $tag= <A href="http://www.php.net/manual/zh/function.strtolower"><U><FONT color=#0000ff>strtolower</FONT></U></A>($eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> $tag_param= $eregi_arr;</FONT></CODE><LI><CODE><FONT face=新宋体> $parse2 = <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($parse, 0, $pos);//标记之前</FONT></CODE><LI><CODE><FONT face=新宋体> $parse = <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($parse, $pos + $eregi_ret);//标记之后</FONT></CODE><LI><CODE><FONT face=新宋体> if(!isset($this->tags[$tag]))</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $ret .= $parse2.'['.$tag_start.']';</FONT></CODE><LI><CODE><FONT face=新宋体> continue; //如果是不支持的标记</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> //查找对应的结束标记</FONT></CODE><LI><CODE><FONT face=新宋体> $eregi_ret=<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("\[(/".$tag.")\]", $parse, $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> if(!$eregi_ret)</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $ret .= $parse2.'['.$tag_start.$tag_param.']';</FONT></CODE><LI><CODE><FONT face=新宋体> continue;//没有对应该的结束标记</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> $pos= <A href="http://www.php.net/manual/zh/function.strpos"><U><FONT color=#0000ff>strpos</FONT></U></A>($parse, $eregi_arr);</FONT></CODE><LI><CODE><FONT face=新宋体> $value= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($parse, 0, $pos); //起止标记之间的内容</FONT></CODE><LI><CODE><FONT face=新宋体> $tag_end= $eregi_arr;</FONT></CODE><LI><CODE><FONT face=新宋体> $parse= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($parse, $pos + $eregi_ret);//结束标记之后的内容</FONT></CODE><LI><CODE><FONT face=新宋体> // 允许嵌套标记,递归分析</FONT></CODE><LI><CODE><FONT face=新宋体> if (!(($tag == 'code') or ($tag=="url") or ($tag=="email") or ($tag=="img"))){</FONT></CODE><LI><CODE><FONT face=新宋体> $value= $this->parse($value);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> $ret.= $parse2;</FONT></CODE><LI><CODE><FONT face=新宋体> $parseFun= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>('$ret .= %s($tag_start, $tag_param, $tag_end, $value);', $this->tags[$tag]); </FONT></CODE><LI><CODE><FONT face=新宋体> eval($parseFun);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> $nest --;</FONT></CODE><LI><CODE><FONT face=新宋体> return $ret;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体>/*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 简单替换,类似变为<b></FONT></CODE><LI><CODE><FONT face=新宋体> * 标签内容不便,只是替代括号为<></FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function simple($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para) > 0) </FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<%s>%s<%s>", $start, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 如下认为合法可以没有“http://”;ftp一定要自己加“ftp://”</FONT></CODE><LI><CODE><FONT face=新宋体> * 93611</FONT></CODE><LI><CODE><FONT face=新宋体> * </FONT></CODE><LI><CODE><FONT face=新宋体> * http://www.fogsun.com</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function url($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $sA= $value;</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>(<A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($para), 1);</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($sURL) > 0) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($value) == 0) </FONT></CODE><LI><CODE><FONT face=新宋体> $sA= $sURL;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> else </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($value);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= $this->formatURL($sURL);</FONT></CODE><LI><CODE><FONT face=新宋体> if($this->checkURL($sURL)) </FONT></CODE><LI><CODE><FONT face=新宋体> return "<a href=\"$sURL\" class=\"small\" target=_blank>$sA</a>";</FONT></CODE><LI><CODE><FONT face=新宋体> else {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 如下认为合法可以没有“mailto:”头;</FONT></CODE><LI><CODE><FONT face=新宋体> * pazee</FONT></CODE><LI><CODE><FONT face=新宋体> * </FONT></CODE><LI><CODE><FONT face=新宋体> * pazee@21cn.com</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function email($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $sA= $value;</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>(<A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($para), 1);</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($sURL) > 0) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($value) == 0) </FONT></CODE><LI><CODE><FONT face=新宋体> $sA= $sURL;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> else </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($value);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> //if (strtolower(substr($sURL, 0, 7)) != "mailto:")</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= "mail.php?email=". $sURL;</FONT></CODE><LI><CODE><FONT face=新宋体> if($this->emailcheck(<A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($sURL, 15))) </FONT></CODE><LI><CODE><FONT face=新宋体> return "<a href=\"$sURL\" class=\"small\" target=_blank>$sA</a>";</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 显示图片;如下用法认为合法</FONT></CODE><LI><CODE><FONT face=新宋体> * </FONT></CODE><LI><CODE><FONT face=新宋体> * www.21cn.com/title.jpg</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function img($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>(<A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($para), 1);</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($sURL) <= 0) </FONT></CODE><LI><CODE><FONT face=新宋体> $sURL= <A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>($value);</FONT></CODE><LI><CODE><FONT face=新宋体> //$sURL= $this->formatURL($sURL);</FONT></CODE><LI><CODE><FONT face=新宋体> if ($this->checkImgURL($sURL))</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<a href=\"%s\" target=\"_blank\"><img src=\"%s\" border=0 alt=\"从新窗口中浏览\"></img></a>", $sURL,$sURL);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字符串从右向左循环移动 </FONT></CODE><LI><CODE><FONT face=新宋体> * 无参数</FONT></CODE><LI><CODE><FONT face=新宋体> * 等效与html的<marquee></FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function fly($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para)>0) // 有参数</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return '<marquee behavior=alternate scrolldelay=100>'.$value.'</marquee>';</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字符串来回移动 </FONT></CODE><LI><CODE><FONT face=新宋体> * 无参数</FONT></CODE><LI><CODE><FONT face=新宋体> * 等效与html的<marquee></FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function move($start, $para, $end, $value) {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para)>0) // 有参数</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return '<marqueescrolldelay=100>'.$value.'</marquee>';</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字符晕光效果包括 glow、shadow和blur</FONT></CODE><LI><CODE><FONT face=新宋体> * 字符晕光效果或者</FONT></CODE><LI><CODE><FONT face=新宋体> * 3个参数允许缺省</FONT></CODE><LI><CODE><FONT face=新宋体> * 实现文字阴影特效,</FONT></CODE><LI><CODE><FONT face=新宋体> * glow, shadow,blur 属性依次为颜色、宽度和边界大小</FONT></CODE><LI><CODE><FONT face=新宋体> * wave 属性依次为变形频率、宽度和边界大小</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function CSSStyle(&$start, &$para, &$end, &$value){</FONT></CODE><LI><CODE><FONT face=新宋体> $rets= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para)==0) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $para="=,,";</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("^=([#]?[[:xdigit:]]{6}|*),(*),(*)", $para, $er_arr))</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> $color=($er_arr != "") ? $er_arr : red; // Default Color</FONT></CODE><LI><CODE><FONT face=新宋体> $width=($er_arr != "") ? $er_arr : 400; // Default Width</FONT></CODE><LI><CODE><FONT face=新宋体> $border= ($er_arr != "") ? $er_arr : 5; // Default Border</FONT></CODE><LI><CODE><FONT face=新宋体> switch ($start) </FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> case "glow":</FONT></CODE><LI><CODE><FONT face=新宋体> case "shadow":</FONT></CODE><LI><CODE><FONT face=新宋体> $rets= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font style=\"FILTER: %s(Color =%s,Strength=%s); width:%s\">%s</font>", $start, $color, $border, $width, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "blur";</FONT></CODE><LI><CODE><FONT face=新宋体> $rets= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font style=\"FILTER: %s(Strength=%s);color:%s; width:%s\">%s</font>", $start, $border, $color, $width, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "wave":</FONT></CODE><LI><CODE><FONT face=新宋体> $color=($er_arr != "") ? $er_arr : 4; // Default Color</FONT></CODE><LI><CODE><FONT face=新宋体> $border= ($er_arr != "") ? $er_arr : 2; // Default Border</FONT></CODE><LI><CODE><FONT face=新宋体> $rets= <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font style=\"FILTER: %s(Freq=%s, Strength=%s); width:%s\">%s</font>", $start, $color, $border, $width, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> return$rets;</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字体颜色 xxx </FONT></CODE><LI><CODE><FONT face=新宋体> * n 可以是 #xxxxxx 或者 xxxxxx (6位16进制数)</FONT></CODE><LI><CODE><FONT face=新宋体> * red,greed,blue,black等颜色保留字也有效</FONT></CODE><LI><CODE><FONT face=新宋体> * 等效与html的<font color=n>xxx</font></FONT></CODE><LI><CODE><FONT face=新宋体> * xxxx等效于 </FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function color($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $cl= <A href="http://www.php.net/manual/zh/function.strtolower"><U><FONT color=#0000ff>strtolower</FONT></U></A>(<A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($para, 1));</FONT></CODE><LI><CODE><FONT face=新宋体> if ($cl == "")</FONT></CODE><LI><CODE><FONT face=新宋体> $cl= "red";</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("(^[#]?[[:xdigit:]]{6})|red|green|blue|yellow|blue|white|gray|brown|silver|purple|orange" ,$cl)) </FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font color=%s>%s</font>",$cl, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字体大小 xxx 1<= n <= 7;</FONT></CODE><LI><CODE><FONT face=新宋体> * 等效与html的<font size=n>xxx</font></FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function size($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $size= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($para, 1);</FONT></CODE><LI><CODE><FONT face=新宋体> if ($size >=1 && $size <=7 && (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para) > 1))</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font size=%s>%s</font>",$size, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 字体名字 n字体名称,不需要引号</FONT></CODE><LI><CODE><FONT face=新宋体> * 等效与html的<font face=n>xxx</font></FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function face($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($para, 1);</FONT></CODE><LI><CODE><FONT face=新宋体> if (!<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("[[:punct:]]", $fn) && <A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para) > 1) {</FONT></CODE><LI><CODE><FONT face=新宋体> switch (<A href="http://www.php.net/manual/zh/function.strtoupper"><U><FONT color=#0000ff>strtoupper</FONT></U></A>($fn))</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> case "ST":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "宋体";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "HT":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "黑体";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "KT":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "楷体_GB2312";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "FT":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "仿宋_GB2312";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "YY":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "幼圆";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "LS":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "隶书";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> case "XST":</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= "新宋体";</FONT></CODE><LI><CODE><FONT face=新宋体> break;</FONT></CODE><LI><CODE><FONT face=新宋体> default:</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= <A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($para, 1);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<font face=\"%s\">%s</font>",$fn, $value);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> else</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 文件上传</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function upload($start, $para, $end, $value){</FONT></CODE><LI><CODE><FONT face=新宋体> $fn= <A href="http://www.php.net/manual/zh/function.trim"><U><FONT color=#0000ff>trim</FONT></U></A>(<A href="http://www.php.net/manual/zh/function.substr"><U><FONT color=#0000ff>substr</FONT></U></A>($para, 1));</FONT></CODE><LI><CODE><FONT face=新宋体> if (!<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("[[:punct:]]", $fn) && <A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($para) > 1) {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("jpg|jpeg|bmp|gif|png", $fn)) {</FONT></CODE><LI><CODE><FONT face=新宋体> if ($this->checkImgURL($value))</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<img src=\"images/%s.gif\" align=\"absmiddle\"> 此主题相关图片如下:<br><br><a href=\"%s\" target=\"_blank\"><img src=\"%s\" border=0 alt=\"从新窗口中浏览\"></img></a><br>",$fn,$value,$value);</FONT></CODE><LI><CODE><FONT face=新宋体> else </FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end); </FONT></CODE><LI><CODE><FONT face=新宋体> } elseif ($fn == "swf") {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<center><img src=\"images/%s.gif\" align=\"absmiddle\"> 此主题相关Flash:<br><br><PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><embed src=\"%s\" quality=high width=\"500\" height=\"300\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\"></embed><br><a href=\"%s\" class=\"small\" target=_blank>全屏欣赏</a> (点右键->另存为可将动画下载)</center>",$fn,$value,$value);</FONT></CODE><LI><CODE><FONT face=新宋体> } elseif (<A href="http://www.php.net/manual/zh/function.eregi"><U><FONT color=#0000ff>eregi</FONT></U></A>("rar|zip|doc", $fn)) {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<img src=\"images/%s.gif\" align=\"absmiddle\"> <a href=\"%s\" class=\"small\" target=_blank>点击下载此主题相关附件</a><br>",$fn,$value);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> } else </FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s%s]%s[%s]", $start, $para, $value, $end); </FONT></CODE><LI><CODE><FONT face=新宋体> } </FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 调试代码标签</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function html($start, $para, $end, $value)</FONT></CODE><LI><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($value) > 0) {</FONT></CODE><LI><CODE><FONT face=新宋体> $value = <A href="http://www.php.net/manual/zh/function.eregi_replace"><U><FONT color=#0000ff>eregi_replace</FONT></U></A>('<br[[:space:]]*/?[[:space:]]*>', "", $value);</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<br><span><textarea cols=70 rows=10 class=\"code\">%s</textarea><br><input type=button value=\" 运行代码 \" onclick='runCode()' class=\"special\"> <b></b></span><br>",$value);</FONT></CODE><LI><CODE><FONT face=新宋体> } else {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s]%s[%s]", $start, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * 引用标签</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function quote($start, $para, $end, $value)</FONT></CODE><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($value) > 0) {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("<table width=\"100%%\" align=center border=1 bordercolor=\"#AAAAAA\"><tr bgcolor=\"#EAEAEA\"><td class=view><font color=\"#000099\"><b>以下为引用内容:</b></font><br><font color=\"#000066\">%s</font></td></tr></table><br>",$value);</FONT></CODE><LI><CODE><FONT face=新宋体> } else {</FONT></CODE><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s]%s[%s]", $start, $value, $end);</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><CODE><FONT face=新宋体> /*****************************************************</FONT></CODE><LI><CODE><FONT face=新宋体> * FLASH</FONT></CODE><LI><CODE><FONT face=新宋体> *****************************************************/</FONT></CODE><LI><CODE><FONT face=新宋体> function swf($start, $para, $end, $value)</FONT></CODE><LI><LI><CODE><FONT face=新宋体> {</FONT></CODE><LI><LI><CODE><FONT face=新宋体> if (<A href="http://www.php.net/manual/zh/function.strlen"><U><FONT color=#0000ff>strlen</FONT></U></A>($value) > 0) {</FONT></CODE><LI><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A> ("<br><center><PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><embed src=\"%s\" quality=high width=\"500\" height=\"300\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\"></embed><br><a href=\"%s\" class=\"small\" target=_blank>全屏欣赏</a> (点右键->另存为可将动画下载)</center>",$value,$value);</FONT></CODE><LI><LI><CODE><FONT face=新宋体> } else {</FONT></CODE><LI><LI><CODE><FONT face=新宋体> return <A href="http://www.php.net/manual/zh/function.sprintf"><U><FONT color=#0000ff>sprintf</FONT></U></A>("[%s]%s[%s]", $start, $value, $end);</FONT></CODE><LI><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><LI><CODE><FONT face=新宋体> }</FONT></CODE><LI><LI><CODE><FONT face=新宋体>}</FONT></CODE><LI><CODE><FONT face=新宋体>?></FONT></CODE></LI></OL>
页:
[1]