日期:2013-04-16  浏览次数:20633 次

<?PHP
//ubbcode类  
class ubbcode
{  
    var $nest;  // 递归深度,for debug
    //可处理标签及处理函数表  
    var $tags = array(
        'url' => '$this->url',  
        'email' => '$this->email',  
        'mail' => '$this->email',  // 为了容错,[mail]和等效
        'img' => '$this->img',  
        'b' => '$this->simple',  
        'i' => '$this->simple',  
        'u' => '$this->simple',  
        'tt' => '$this->simple',  
        's' => '$this->simple',  
        'strike' => '$this->simple',  
        'h1' => '$this->simple',  
        'h2' => '$this->simple',  
        'h3' => '$this->simple',  
        'h4' => '$this->simple',  
        'h5' => '$this->simple',  
        'h6' => '$this->simple',  
        'sup' => '$this->simple',  
        'sub' => '$this->simple',  
        'em' => '$this->simple',  
        'strong' => '$this->simple',  
        'code' => '$this->simple',    
        'small' => '$this->simple',  
        'big' => '$this->simple',  
        'blink' => '$this->simple',
        'fly' => '$this->fly',
        'move' => '$this->move',
        'glow' => '$this->CSSStyle',
        'shadow' => '$this->CSSStyle',
        'blur' => '$this->CSSStyle',
        'wave' => '$this->CSSStyle',
        'sub' => '$this->simple',
        'sup' => '$this->simple',
        'size' => '$this->size',
        'face' => '$this->face',
        'font' => '$this->face',  // 为了容错,[font]和[face]等效
        'color' => '$this->color',
        'html' => '$this->html',
        'quote' => '$this->quote',
        'swf' => '$this->swf',
        'upload' => '$this->upload'
        );  
    function ubbcode()
    {  
      $this->$nest= 0;