"; $this->messagecodes['pcodecount']++; $code = htmlspecialchars(str_replace('\\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code))); $code = str_replace("\n", "
", $code); $this->messagecodes['codehtml'][$this->messagecodes['pcodecount']] = $this->tpl_codedisp($this->messagecodes, $code); $this->messagecodes['codecount']++; return "[\t_6K_CODE_{$this->messagecodes[pcodecount]}\t]"; } function tpl_codedisp($messagecodes, $code) { $codesid = 'code' . $messagecodes['codecount']; $str = '
- '.$code.'
'; //$str .= '复制'; $str .= '
'; return $str; } function tpl_quote() { return '
\\1
'; } function ubb2html($message) { $msglower = strtolower($message); if(strpos($msglower, '[/code]') !== false) { $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "\$this->codedisp('\\1')", $message); } $message = $this->h($message); if(strpos($msglower, '[/hide]') !== false) { $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/ies", "\$this->parsehide('0','\\1')", $message); if(strpos($msglower, '[hide=') !== false) { $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "\$this->parsehide('\\1','\\2')", $message); } } if(strpos($msglower, '[/opento]') !== false) { $message = preg_replace("/\[opento=(.+?)\]\s*(.+?)\s*\[\/opento\]/ies", "\$this->parseopento('\\1','\\2')", $message); } if(strpos($msglower, '[/url]') !== false) { $message = preg_replace("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)([^\[\"']+?))?\](.+?)\[\/url\]/ies", "\$this->parseurl('\\1', '\\5')", $message); } if(strpos($msglower, '[/email]') !== false) { $message = preg_replace("/\[email(=([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+))?\](.+?)\[\/email\]/ies", "\$this->parseemail('\\1', '\\4')", $message); } $message = str_replace(array( '', '', '', '', '', '', '', '', '', '', '', '
- ', '
- ', '
- ', '
- ', '
- ', '
', '', '' ), array( '', '', '', '
', '', '', '', '', '', '', '', '