Discuz diy模块内容简介 UBB代码过滤不完整的解决

修改文件source\class\block\forum\block_thread.php

if($messagearr) {
            foreach($messagearr as $tid => $var) {
                $thread = $_G[‘block_thread‘][$tid];
                if($nospecial) {
                    $thread[‘special‘] = 0;
                }
                if($thread[‘special‘] == 1) {
                    $polloptions = array();
                    $multiple = DB::result_first("SELECT multiple FROM ".DB::table(‘forum_poll‘)." WHERE tid=‘$tid‘");
                    $optiontype = $multiple ? ‘checkbox‘ : ‘radio‘;
                    $query = DB::query("SELECT polloptionid, polloption FROM ".DB::table(‘forum_polloption‘)." WHERE tid=‘$tid‘ ORDER BY displayorder");
                    while($polloption = DB::fetch($query)) {
                        $polloption[‘polloption‘] = preg_replace("/\[url=(https?){1}:\/\/([^\[\"‘]+?)\](.+?)\[\/url\]/i",
                            "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $polloption[‘polloption‘]);
                        $polloptions[] = $polloption;
                    }
                } elseif($thread[‘special‘] == 2) {
                    $trade = C::t(‘forum_trade‘)->fetch_first_goods($tid);
                    $trade[‘aid‘] = $trade[‘aid‘] ? getforumimg($trade[‘aid‘]) : ‘‘;
                    $trades[$tid][] = $trade;
                } elseif($thread[‘special‘] == 3) {
                    $extcredits = $_G[‘settings‘][‘extcredits‘];
                    $creditstransextra = $_G[‘settings‘][‘creditstransextra‘];
                    $rewardend = $thread[‘price‘] < 0;
                    $rewardprice = abs($thread[‘price‘]);
                    $message = messagecutstr(preg_replace(‘/\[[^\]]*\]/‘,‘‘,$var), $messagelength, ‘‘);
                } elseif($thread[‘special‘] == 4) {
                    $message = messagecutstr(preg_replace(‘/\[[^\]]*\]/‘,‘‘,$var), $messagelength, ‘‘);
                    $activity = DB::fetch_first("SELECT aid, number, applynumber FROM ".DB::table(‘forum_activity‘)." WHERE tid=‘$tid‘");
                    $activity[‘aid‘] = $activity[‘aid‘] ? getforumimg($activity[‘aid‘]) : ‘‘;
                    $activity[‘aboutmember‘] = $activity[‘number‘] - $activity[‘applynumber‘];
                } elseif($thread[‘special‘] == 5) {
                    $message = messagecutstr(preg_replace(‘/\[[^\]]*\]/‘,‘‘,$var), $messagelength, ‘‘);
                    $debate = C::t(‘forum_debate‘)->fetch($tid);
                    $debate[‘affirmvoteswidth‘] = $debate[‘affirmvotes‘]  ? intval(80 * (($debate[‘affirmvotes‘] + 1) / ($debate[‘affirmvotes‘] + $debate[‘negavotes‘] + 1))) : 1;
                    $debate[‘negavoteswidth‘] = $debate[‘negavotes‘]  ? intval(80 * (($debate[‘negavotes‘] + 1) / ($debate[‘affirmvotes‘] + $debate[‘negavotes‘] + 1))) : 1;
                    $debate[‘affirmpoint‘] = discuzcode($debate[‘affirmpoint‘], 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
                    $debate[‘negapoint‘] = discuzcode($debate[‘negapoint‘], 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
                } else {
                    $message = messagecutstr(preg_replace(‘/\[[^\]]*\]/‘,‘‘,$var), $messagelength, ‘‘);
                }
                include template(‘common/block_thread‘);
                $returnarr[$tid] = $return;
            }
        }

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。