function wapubb($text) { $p = array('/\\[img\\](.*?)\\[\\/img\\]/ie', '/\\[img link=(.*?)\\](.*?)\\[\\/img\\]/ie', '/\\[video host=(.*?)\\](.*?)\\[\\/video\\]/i', '/\\[music\\](.*?)\\[\\/music\\]/i', '/\\[flash\\](.*?)\\[\\/flash\\]/i', '/\\[desc\\](.*?)\\[\\/desc\\]/i', '/\\[url\\](.*?)\\[\\/url\\]/i', '/\\[url=(.*?)\\](.*?)\\[\\/url\\]/i'); $r = array('wapurlop("<a href=\\"$1\\" target=\\"_blank\\">[打开图片]</a>","d")', 'wapurlop("<a href=\\"$2\\" target=\\"_blank\\">[打开图片]</a>","d")', '分享的视频', '分享的music', '分享的flash', '$1', '$1', '$2'); $text = preg_replace($p, $r, $text); $text = emotionrp($text); return $text; }
function ubb($text) { global $webaddr; $weburl = urlop($webaddr, 'e'); $p = array('/\\[img\\](.*?)\\[\\/img\\]/ie', '/\\[img link=(.*?)\\](.*?)\\[\\/img\\]/ie', '/\\[video host=(.*?) pic=(.*?)\\](.*?)\\[\\/video\\]/ie', '/\\[music\\](.*?)\\[\\/music\\]/ie', '/\\[flash\\](.*?)\\[\\/flash\\]/ie', '/\\[desc\\](.*?)\\[\\/desc\\]/i', '/\\[url\\](.*?)\\[\\/url\\]/i', '/\\[url=(.*?)\\](.*?)\\[\\/url\\]/i'); $rand = randStr(6); $r = array('urlop("<a href=\\"$1\\" target=\\"_blank\\"><img src=\\"$1\\" alt=\\"分享照片\\" height=\\"50px\\" border=\\"0\\" class=\\"h_postimg\\"></a>","d")', 'urlop("<p><a href=\\"$1\\" onclick=\\"return hs.expand(this)\\" target=\\"_blank\\"><img src=\\"$2\\" alt=\\"分享照片\\" class=\\"h_postimg\\"></a></p>","d")', 'urlop("<div class=\\"media\\"><img id=\\"img_' . $rand . '\\" style=\\"background:url($2) no-repeat;width:38px;height:28px;padding:30px 45px 30px 45px;cursor:pointer;\\" src=\\"' . $weburl . '/images/default/shareico.png\\" alt=\\"点击播放\\" onclick=\\"javascript:showFlash(\'$1\',\'$3\',this,\'' . $rand . '\');\\"/></div>","d")', 'urlop("<div class=\\"media\\"><img id=\\"img_' . $rand . '\\" src=\\"' . $weburl . '/images/music.gif\\" alt=\\"点击播放\\" onclick=\\"javascript:showFlash(\'music\',\'$1\',this,\'' . $rand . '\');\\" style=\\"cursor:pointer;\\"/></div>","d")', 'urlop("<div class=\\"media\\"><img id=\\"img_' . $rand . '\\" src=\\"' . $weburl . '/images/flash.gif\\" alt=\\"点击播放\\" onclick=\\"javascript:showFlash(\'flash\',\'$1\',this,\'' . $rand . '\');\\" style=\\"cursor:pointer;\\"/></div>","d")', "<div class=\"quote\"><span id=\"quote\" class=\"q\">\$1</span></div>", "<a class='ubblink' href=\"\$1\" target=\"_blank\">\$1</a>", "<a href=\"\$1\">\$2</a>"); $text = preg_replace($p, $r, $text); $text = emotionrp($text); //表情 $text = preg_replace("/(.*?)#([^#].*?)#(.*?)/i", "\$1<a href='{$webaddr}/keywords/\$2'>#\$2#</a>\$3", $text); //专题 return $text; }
echo 'success'; exit; } else { echo '您没有填写发送的内容,返回重新填写'; exit; } } if ($act == 'getuserinfo') { $uid = $_GET['uid']; $class = $_GET['class']; $userquery = $db->query("SELECT nickname,user_head,lastcontent,lastconttime FROM et_users WHERE user_id='{$uid}'"); $user = $db->fetch_array($userquery); $head = $user['user_head'] ? "{$webaddr}/attachments/head/" . $user['user_head'] : "{$webaddr}/images/noavatar.jpg"; $content = simplecontent($user[lastcontent]); $time = $user[lastconttime] ? timeop($user[lastconttime]) : ""; echo '<div class="' . $class . '"></div><table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td width="53" rowspan="2" align="left" valign="top"><img src="' . $head . '" width="48px" /></td><td><strong>' . $user[nickname] . ':</strong>' . emotionrp($content) . '</td></tr><tr><td class="followtime">' . $time . "</td></tr></table>"; exit; } if ($act == 'getreplycontent') { $contid = $_GET['contid']; $contdata = getReply($contid); if ($contdata) { $contents = ubb($contdata['content_body']); echo '<div class="status_reply_list"> <div class="top"></div> <div class="cont"> <h1 class="line">以下是原文:<a href="' . $webaddr . '/op/view/' . $contid . '">原文回复(' . $contdata['replytimes'] . ')</a></h1> <div class="replyajaxbox"><a href="' . $webaddr . '/' . $contdata['user_name'] . '">' . $contdata['user_nickname'] . '</a>:' . $contents . '</div> </div> <div class="bottom"></div> </div>';