- <?php
- /*
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: [DISCUZ!] Crossday Discuz! Board ::
- :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com) ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Author: Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
- :: Version: 2.5F 2004/10/01 05:15 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- */
- //fix: BY pk0909
- /*
- 1 多出来的空格
- 2 bbcode 解析问题
- 3 img code 对特殊符号的js未转义
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- $searcharray=$replacearray= array();
- $post_codecount = $post_phpcodecount = -1;
- $codecount = 0 ;
- function censor($message) {
- global $_DCACHE;
- require_once(DISCUZ_ROOT.'/forumdata/cache/cache_censor.php');
- return empty($_DCACHE['censor']) ? $message : @preg_replace($_DCACHE['censor']['find'], $_DCACHE['censor']['replace'], $message);
- }
- function credithide($creditsrequire, $message) {
- if($GLOBALS['credit'] < $creditsrequire && !$GLOBALS['ismoderator']) {
- return "<b>**** Hidden to Credits Lower Than $creditsrequire ****</b>";
- } else {
- return '<b>Below Message for Credits Higher Than '.$creditsrequire.'</b><br>'.
- '==============================<br><br>'.
- str_replace('\"', '"', $message).'<br><br>'.
- '==============================';
- }
- }
- function codedisp($code) {
- global $thisbg, $codecount, $post_codecount, $codehtml;
- $post_codecount++;
- $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
- $codehtml[$post_codecount] = "<blockquote class="code"><b class="smalltxt">CODE:</b> <a href="###" class="smalltxt" onclick="copycode(findobj('code$codecount'));">[Copy to clipboard]</a><hr size=1 color="".BORDERCOLOR.""><div style="padding:5px; font-family:Courier New;" id="code$codecount">$code</div></blockquote>";
- $codecount++;
- return "[\tDISCUZ_CODE_$post_codecount\t]";
- }
- //[HACK]自动解析图片URL By Bob Gao
- function parseurl($message) {
- return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
- preg_replace( array(
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)(.jpg|.png|.gif)/i",
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
- "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
- ), array(
- "[img]\\0[/img]",
- "[url]\\1\\3[/url]",
- "[email]\\0[/email]"
- ), ' '.$message);
- }
- //[HACK]自动解析图片URL By Bob Gao
- function postify($message, $smileyoff, $bbcodeoff, $allowsmilies = 1, $allowhtml = 0, $allowbbcode = 1, $allowimgcode = 1) {
- global $credit, $tid, $discuz_uid, $codehtml, $post_codecount, $thisbg, $highlight, $table_posts, $db, $searcharray, $replacearray, $ismoderator, $post,$phpcodehtml,$post_phpcodecount;
- if(!$bbcodeoff && $allowbbcode) {
- $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
- $message = preg_replace("/\s*\[php\](.+?)\[\/php\]\s*/ies", "phpcodedisp('\\1')", $message);
- }
- if ( !strstr($message,'[watermarkoff]') && !$bbcodeoff && $allowbbcode){
- $message = preg_replace("/\s*\[watermark\](.+?)\[\/watermark\]\s*/ies", "watermark('\\1')", $message);
- $watermarkon=true;
- }else{
- $message = preg_replace("/\[watermarkoff\]/i", '', $message);
- $watermarkon=false;
- }
- if(!$allowhtml) {
- $message = dhtmlspecialchars($message);
- }
- if(!$smileyoff && $allowsmilies) {
- if(is_array($GLOBALS['_DCACHE']['smilies'])) {
- foreach($GLOBALS['_DCACHE']['smilies'] as $smiliey) {
- $message = str_replace($smiliey['code'], "<img src="".SMDIR."/$smiliey[url]" align="absmiddle" border="0">",$message);
- }
- }
- }
- if(!$bbcodeoff && $allowbbcode) {
- if(empty($searcharray['bbcode_regexp']) || empty($replacearray['bbcode_regexp']) || empty($searcharray['bbcode_str']) || empty($replacearray['bbcode_str'])) {
- $searcharray['bbcode_regexp'] = array(
- "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is",
- "/(\[box=(#[0-9A-F]{6}|[a-z]+)\])[\n\r]*(.+?)[\n\r]*(\[\/box\])/is",
- "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/){1}([^\["']+?)\s*\[\/url\]/ie",
- "/\[url=www.([^\["']+?)\](.+?)\[\/url\]/is",
- "/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms){1}:\/\/([^\["']+?)\](.+?)\[\/url\]/is",
- "/\[email\]\s*([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*\[\/email\]/i",
- "/\[email=([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\](.+?)\[\/email\]/is",
- "/\[color=([#0-9a-zA-Z]{3,10})\]/i",
- "/\[size=([\-0-9]{1,2})\]/i",
- "/\[font=([^\[]+?)\]/i",
- "/\[align=(left|right|center)\]/i",
- "/\[center\]/i"
- );
- $replacearray['bbcode_regexp'] = array(
- "<br><br><center><table border="0" width="90%" cellspacing="0" cellpadding="0"><tr><td> Quote:</td></tr><tr><td><table border="0" width="100%" cellspacing="1" cellpadding="10" bgcolor="".BORDERCOLOR.""><tr><td width="100%" bgcolor="".ALTBG2."" style="word-break:break-all">\\1</td></tr></table></td></tr></table></center><br>",
- "<blockquote style="background-color: \\2 ;"><span class="bold">$title</span>\\3</blockquote>",
- "cuturl('\\1\\2')",
- "<a href="http://www.\\1" target="_blank">\\2</a>",
- "<a href="\\1://\\2" target="_blank">\\3</a>",
- "<a href="mailto:\\1@\\2">\\1@\\2</a>",
- "<a href="mailto:\\1@\\2">\\3</a>",
- "<font color="\\1">",
- "<font size="\\1">",
- "<font face="\\1">",
- "<p align="\\1">",
- "<p align="center">"
- );
- if($GLOBALS['_DCACHE']['bbcodes']) {
- $searcharray['bbcode_regexp'] = array_merge($searcharray['bbcode_regexp'], $searcharray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['searcharray']);
- $replacearray['bbcode_regexp'] = array_merge($replacearray['bbcode_regexp'], $replacearray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['replacearray']);
- unset($GLOBALS['_DCACHE']['bbcodes']);
- }
- $searcharray['bbcode_str'] = array(
- '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]',
- '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]',
- '[list=A]', '[*]', '[/list]','[/center]', '[/watermark]','[watermark]'
- );
- $replacearray['bbcode_str'] = array(
- '</font>', '</font>', '</font>', '</p>', '<b>', '</b>', '<i>',
- '</i>', '<u>', '</u>', '<ul>', '<ol type=1>', '<ol type=a>',
- '<ol type=A>', '<li>', '</ul></ol>','</p>','</watermark>','<watermark>'
- );
- }
- @$message = str_replace($searcharray['bbcode_str'], $replacearray['bbcode_str'],
- preg_replace($searcharray['bbcode_regexp'], $replacearray['bbcode_regexp'], $message));
- if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
- if(stristr($message, '[hide]')) {
- $query = $db->query("SELECT pid FROM $table_posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
- if($ismoderator || $db->result($query, 0)) {
- $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", "<span class="bold">Below Message for Repliers</span><br>==============================<br><br>\\1<br><br>==============================", $message);
- } else {
- $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", "<b>**** Hidden to Non-Reply Visitors *****</b>", $message);
- }
- }
- $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "credithide(\\1,'\\2')", $message);
- }
- }
- if(!$bbcodeoff && $allowimgcode) {
- if(empty($searcharray['imgcode']) || empty($replacearray['imgcode'])) {
- $searcharray['imgcode'] = array(
- "/\[swf\]\s*([^\[]+?)\s*\[\/swf\]/ies","/\[swf=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/swf\]/ies",
- "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
- "/\[wmv\]\s*(.+?)\s*\[\/wmv\]/ies",
- "/\[rm\]\s*(.+?)\s*\[\/rm\]/ies",
- "/\[wmv=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/wmv\]/ies",
- "/\[rm=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/rm\]/ies",
- );
- $replacearray['imgcode'] = array(
- "bbcodeurl('\\1', '<a href="%s" target="_blank">[在新窗口中打开]</a><br><embed width="550" height="375" src="%s" type="application/x-shockwave-flash"></embed>')",
- "bbcodeurl('\\3', '<a href="%s" target="_blank">[在新窗口中打开]</a><br><embed width="\\1" height="\\2" src="%s" type="application/x-shockwave-flash"></embed>')",
- "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\';}" onmouseover="if(this.resized) this.style.cursor=\'hand\';" onclick="if(this.resized) {window.open(this.src);}">')",
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="480" height="360" ><PARAM NAME="AutoStart" VALUE="0" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="%s" width="480" height="360"></embed></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="Player" width="480" height="360" viewastext><param name="Autostart" value="0"><param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width=480 VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="0"><param name="LOOP" value="0"><param name="CENTER" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="\\1"></object>')",
- "bbcodeurl('\\3', '<object width="\\1" height="\\2" align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer"><param name="Autostart" VALUE="\\3"><param name="ShowStatusBar" VALUE="\\3"><param name="Filename" value="\\4"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="\\4"></embed></object>')",
- "bbcodeurl('\\3', '<object width="\\1" height="\\2" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="Player" viewastext><param name="Autostart" value="\\3"><param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width="\\1" VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="\\3"><param name="LOOP" value="0"><param name="CENTER" value="0"><param name="SRC" value="\\4"></object>')",
- "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
- );
- }
- $message = preg_replace($searcharray['imgcode'], $replacearray['imgcode'], $message);
- }
- for($i = 0; $i <= $post_codecount; $i++) {
- if ($watermarkon){
- $codehtml[$i] = preg_replace("/\s*\[watermark\](.+?)\[\/watermark\]\s*/ies", "watermarkbbcode('\\1')", $codehtml[$i]);
- }
- $message = str_replace("[\tDISCUZ_CODE_$i\t]", $codehtml[$i], $message);
- }
- if($highlight) {
- foreach(explode('+', $highlight) as $ret) {
- if($ret) {
- $message = preg_replace("/(?<=[\s"\]>()]|^)(".preg_quote($ret, '/').")(([\.,;-?!()]+)?([\s"<\[]|$))/siU", "<u><b><font color="#FF0000">\\1</font></b></u>\\2", $message);
- }
- }
- }
- for($i = 0; $i <= $post_phpcodecount; $i++) {
- $message = str_replace("|\tDISCUZ_PHPCODE_$i\t|", $phpcodehtml[$i], $message);
- }
- $message = nl2br(str_replace(
- array("\t", ' ', ' '),
- array(' ', ' ', ' ')
- , $message)
- );
- //文章动作 by younc start
- $str ="<br><font color=red>【动作】</font>";
- $uue ="<font color=blue>$post[author]</font>";
- $message=str_replace("^招呼","$str $uue 逢人就打招呼:大家好,今天是我大喜的日子!请吃糖! 请吃糖!<img src=images/act/05.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^欢迎","$str $uue 高兴的叫道:欢迎、欢迎、热烈欢迎~~<img src=images/act/085.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^灌水","$str $uue 嚷道:“新来的,别乱欺负哦,灌水先”<img src=images/act/034.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^无聊","$str $uue 拿出一张钞票:“好无聊啊,谁要陪我灌水?”<img src=images/act/01.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^负责","$str $uue 哭著说:“你可要对我负责呀!”呜~~<img src=images/act/02.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^生气","$str $uue 撅了撅嘴说:“气死我了呀!呀!呀!”<img src=images/act/03.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^高兴","$str $uue 高兴地跳了起来。<img src=images/act/046.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^鼓掌","$str $uue 鼓掌喝采<img src=images/act/06.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^等待","$str $uue 悲伤的唱到:“你知不知道,你知不知道?我等到花儿也谢了...”<img src=images/act/07.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^反对","$str $uue 认真地摇了摇头“那怎么可以呢,不可以的,不可能的啦。”<img src=images/act/083.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^浪漫","$str $uue 罗密欧与朱丽叶式的吹起曲子来“我悄悄地蒙上你的眼睛,让你猜猜我是谁?”<img src=images/act/019.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^不要","$str $uue 摆了摆手,说:“不要呀!”<img src=images/act/010.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^找死","$str $uue 说:跟我斗,你还嫩著哩;刚练成的无筋腿,拿你试试先!<img src=images/act/023.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^去死","$str $uue 嘿嘿,你去死吧!<img src=images/act/011.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^狂笑","$str $uue 仰天狂笑:“普天之下,竟然没有我的对手...”<img src=images/act/012.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^傻笑","$str $uue 西西、禾禾~~$username 突然笑了起来..<img src=images/act/031.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^OK","$str $uue 怪腔怪调地说:“OK啦!~”<img src=images/act/084.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^痛哭","$str $uue 鼻子一酸,开始叭嗒叭嗒掉眼泪了 <img src=images/act/013.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^道别","$str $uue 向在场的所有人道:“小生先行告退,后会有期。”<img src=images/act/015.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^跳舞","$str $uue 乐地手足蹈舞!<img src=images/act/017.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^唱歌","$str $uue 清清嗓子唱起歌来:东方红,太阳升 <img src=images/act/09.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^害羞","$str $uue 害羞地脸都红了,恨没有地洞,好钻进去躲起来~~ <img src=images/act/020.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^比酷","$str $uue 摆了个POSE道:“你、你、你没我酷..”<img src=images/act/021.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^救命","$str $uue 大叫:狼来了!狼来了!救命啊!救命啊!<img src=images/act/022.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^狂妄","$str $uue 剑眉一轩,冷冷的瞥了一眼,背转身淡淡说道:你,不是我的,对手!<img src=images/act/025.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^拳击","$str $uue 叫道:你的身材好有型哦!给我练拳不?<img src=images/act/026.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^我踢","$str $uue 说:我踢、我踢、我踢死你<img src=images/act/029.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^我踩","$str $uue 大叫:我踩、我踩、踩死楼上的,踩扁楼下的!<img src=images/act/027.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^饶命","$str $uue 大喊:老婆!你就饶了我吧!<img src=images/act/028.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^眨眼","$str $uue 天真地眨了眨眼睛!一对会说话的眼睛闪闪动人^)^<img src=images/act/032.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^臭美","$str $uue 嚷道:“你当你是谁呀,你以为你是张学友呀?”<img src=images/act/033.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^变态","$str $uue 对偻上的说:“你真的好变态哦”<img src=images/act/037.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^拼酒","$str $uue 说:“什么时候咋俩拼拼酒啊。”<img src=images/act/038.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^深情","$str $uue 深情地唱道:我早已为你种下,九百九十九朵玫瑰..<img src=images/act/042.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^恶心","$str $uue 觉得一阵恶心,哇啦哇啦地吐了一地 <img src=images/act/043.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^惊讶","$str $uue 惊讶得两眼瞪得贼大!<img src=images/act/044.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^抽烟","$str $uue 从烟缸中拣出个烟屁股,用两根手指夹著点著了,眯起眼睛狂嘬几口。<img src=images/act/045.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^怀疑","$str $uue 抓了抓头皮,问道:“有这回事吗?”<img src=images/act/047.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^拉勾","$str $uue 对楼上的说:我们拉拉勾就不许反悔了。<img src=images/act/050.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^经典","$str $uue 呢喃道:“好久没见过这么经典的东东了。”<img src=images/act/051.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^同意","$str $uue 说:“你们都对,行了吧!?”<img src=images/act/052.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^kiss","$str $uue 说:“来吧,我们亲亲!”<img src=images/act/053.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^生日","$str $uue 猪你生日快乐!<img src=images/act/055.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^晕倒","$str $uue 突然觉得天昏地暗,一声“我要晕了”后就倒下了!<img src=images/act/056.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^气你","$str $uue 对楼上的说:“哈哈,我气死你。”<img src=images/act/058.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^错啦","$str $uue 说:“又搞错啦!”<img src=images/act/059.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^加油","$str $uue 内心在默默地喊著加油。<img src=images/act/060.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^恭喜","$str $uue 恭喜、贺喜什么时候请吃酒啊?<img src=images/act/061.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^简单","$str $uue 抓了抓脑袋道:喔,原来这么简单呀?!<img src=images/act/063.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^鼓励","$str $uue 挥著手说道:同志们辛苦了!<img src=images/act/064.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^过奖","$str $uue 拱了拱手道:<img src=images/act/065.gif border=0 align=absmiddle> 过奖,过奖!<br>",$message);
- $message=str_replace("^原谅","$str $uue 连哭带喊跪在地上叫道:你们大家再原谅我一次吧!<img src=images/act/066.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^大笑","$str $uue 快要把我笑死了!<img src=images/act/067.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^考虑","$str $uue 来回地踱著方步陷入沉思中。<img src=images/act/068.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^感动","$str $uue 感动极了,一行热泪夺眶而出。<img src=images/act/069.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^叹气","$str $uue 长叹了一口气那神情仿佛是在说:“我都是要进棺材的人了,还在乎些什么??!”<img src=images/act/070.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^道谢","$str $uue 对在场的所有人鞠躬道谢!<img src=images/act/075.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^摇头","$str $uue 拼命地摇摇头, 一副很无辜的样子。<img src=images/act/077.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^拥抱","$str $uue 张开双臂来吧,小宝贝儿!让叔叔抱!<img src=images/act/080.gif border=0 align=absmiddle><br>",$message);
- $message=str_replace("^无奈","$str $uue 两手一摊无奈地耸耸肩。<img src=images/act/081.gif border=0 align=absmiddle><br>",$message);
-
- //文章动作 by younc end
- return $message;
- }
- function cuturl($url) {
- $length = 65;
- $urllink = "<a href="".(substr(strtolower($url), 0, 4) == 'www.' ? "http://$url" : $url).'" target="_blank">';
- if(strlen($url) > $length) {
- $url = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
- }
- $urllink .= $url.'</a>';
- return $urllink;
- }
- function bbcodeurl($url, $tags) {
- if(!preg_match("/<.+?>/s",$url)) {
- if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) {
- $url = 'http://'.$url;
- }
- return str_replace('submit', '', sprintf($tags, $url, $url));
- } else {
- return ' '.$url;
- }
- }
- function phpcodedisp($code) {
- global $thisbg, $codecount, $post_phpcodecount, $phpcodehtml,$post;
- $post_phpcodecount++;
- $phpcode = phphighlite(str_replace("\\"", """, $code));
- $phpcodeid ="pcode_$post[pid]_$post_phpcodecount";
- $phpcodehtml[$post_phpcodecount] = "<blockquote class="code"><b class="smalltxt">PHP:</b> <a href="###" class="smalltxt" onclick="copycode(findobj('$phpcodeid'));">[Copy to clipboard]</a><hr size=1 color="".BORDERCOLOR.""><div style="padding:5px; font-family:Courier New;" id="$phpcodeid">$phpcode</div></blockquote>";
- $phpcodecount++;
- return "|\tDISCUZ_PHPCODE_$post_phpcodecount\t|";
- }
- function phphighlite($code) {
- if(!strpos($code,"<?\n") && !strpos($code,'<?') && substr($code,0,2)!='<?'){
- $code='<'.'?'.trim($code).' ?'.'>';
- $addedtags=1;
- }
- ob_start();
- $oldlevel=error_reporting(0);
- highlight_string($code);
- error_reporting($oldlevel);
- $buffer = ob_get_contents();
- ob_end_clean();
- if ($addedtags) {
- $openingpos = strpos($buffer,'<?');
- $closingpos = strrpos($buffer, '?');
- $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
- }
- $buffer = str_replace(""", """, $buffer);
- $buffer = str_replace("<br />", '', $buffer);
- return $buffer;
- }
- function clear_bbcode($code){
- $rep = array('[', ']', ':', '(', ')');
- for ($x = 0; $x < count($rep); $x++) {
- $code = str_replace($rep[$x], '&#'.ord($rep[$x]).';', $code);
- }
- return $code;
- }
- function watermark($code) {
- global $postcolor,$sitename;
- $code = str_replace("\\"", """, preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code));
- if(!$postcolor) $postcolor= ALTBG2;
- $pieces = explode('<br />', nl2br($code));
- unset ($code);
- foreach ($pieces as $key => $value) {
- $newmessage .=$value."[color=$postcolor]◎发布于 $sitename 论坛(http://breath.wo2j.com/)◎".random(10).'[/color]';
- }
- return $newmessage;
- }
- function watermarkbbcode($code) {
- global $sitename;
- $code = str_replace("\\"", """, preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code));
- $pieces = explode('<br />', nl2br($code));
- unset ($code);
- foreach ($pieces as $key => $value) {
- $newmessage .=$value."<font color='".ALTBG2."'>◎发布于 $sitename 论坛(http://breath.wo2j.com/)◎".random(10)."</font>";
- }
- return $newmessage;
- }
- ?>
复制代码 |