Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
 $linkdt = base64_encode(serialize($linkdata));
 if ($type) {
     if ($describe) {
         $describe = "[desc]" . $describe . "[/desc]";
     }
     if ($videotitle) {
         $describe = $videotitle . $describe;
     }
     if ($type == 'video') {
         $content = $describe . "[video host=" . urlop($hosts[1], 'e') . " pic=" . urlop($videopic, 'e') . "]{$flashvar}[/video]";
     } else {
         if ($type == 'music') {
             $content = "<p>我分享了音乐</p>" . $describe . "[music]" . urlop($link, 'e') . "[/music]";
         } else {
             if ($type == 'flash') {
                 $content = "<p>我分享了Flash</p>" . $describe . "[flash]" . urlop($link, 'e') . "[/flash]";
             } else {
                 if ($type == 'website') {
                     $content = "<p>我分享了网址</p>" . $describe . "{$link}";
                 }
             }
         }
     }
     $content = replace($content);
     //词语过滤
     $content = daddslashes($content);
     $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,conttype) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$content}','{$addtime}','media')");
     updatemsgnum('++', $my[user_id]);
     //更新消息数
     dsetcookie('setok', 'home6');
     header("location: {$webaddr}/{$my['user_name']}/profile");