<ul class="discuss_ul">
<?php
    foreach($hot_replylist as $key=>$val){
        $p = '/<img\b.*?src="(static\/image\/common\/back\.gif)".*?>/i';
        if(empty($val['message'])){
            continue;
        }
        $val['message'] = preg_replace($p, '', $val['message']);
        $val['message'] = str_replace('!post_quote!:', '', $val['message']);
        $val['message'] = preg_replace("/(<a .+?>)|(<\/a>)/", '', $val['message']);
        $val['floortitle'] = (!empty($postno[$val['number']]) ? $postno[$val['number']] : $val['number'].'#');
        if(array_key_exists('videolist', $val) && $val['videolist']) {
            foreach($val['videolist'] as $videourl) {
                if(!preg_match('/http:\/\/v\.youku\.com\/v_show\/id_(\S+)\.html/i', $videourl, $match)){
                    continue;
                }
                $val['message'] .= '<div class="videoCon"><iframe src="http://player.youku.com/embed/'.$match[1].'" width="240" height="136" frameborder="0"></iframe></div>';
            }
        }
        //处理禁言用户组
        if(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($val['authorid'] && !$val['username']) || ($_G['thread']['digest'] == 0 && ($val['groupid'] == 4 || $val['groupid'] == 5 || $val['memberstatus'] == '-1')))) {
                $message1 = lang('forum/template', 'message_banned');
        } elseif(!$_G['forum']['ismoderator'] && $val['status'] & 1) {
                $message1 = lang('forum/template', 'message_single_banned');
        } elseif($hiddenreplies) {
                $message1 = lang('forum/template', 'message_ishidden_hiddenreplies');
        } elseif($val['first'] && $_G['forum_threadpay']) {
                $message1 = lang('forum/template', 'pay_threads').' '.$GLOBALS['thread']['price'].' '.$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['unit'].$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'];
        } elseif($_G['forum_discuzcode']['passwordlock']) {
                $message1 = lang('forum/template', 'message_password_exists');
        } else {
                $message1 = '';
        }
        if($message1){
            $oldmessage = $val['message'];
            $val['message']='<div style="color:gray;background:#F2F2F2;margin-bottom:5px;">'.$message1.'</div>';
        }
    ?>
    <li pid="<?php echo $val['pid'];?>" class="item-view">
        <div class="discuss_box">
             <?php if(empty($val['authorid']) || $val['anonymous'] == 1):?>
                    <a class="user-hd"  href="javascript:void(0);"><?php echo $default_avatar;?></a>
            <?php else:?>
                    <a  onclick="lbsPerson(<?php echo $val['authorid'];?>)" href="javascript:void(0);"><?php echo $val['avatar']?></a>
            <?php endif;?>
            <div class="discuss_user">
                 <?php if(empty($val['authorid']) || $val['anonymous'] == 1):?>
                    <p class="user_name "  href="javascript:void(0);"><?php echo odz_lang('anonymous');?></p>
                <?php else:?>
                   <p class="user_name" onclick="lbsPerson(<?php echo $val['uid'];?>)" href="javascript:void(0);"><?php echo $val['author'];?><?php echo usergruop_level($val['authorid'],1);?></p>
                <?php endif;?>
                    <span class="discuss_span span_date"><?php echo $val['dateline'];?></span>
            </div>
            <?php
            // FIXME 目前的判断机制只有当用户同时拥有编辑和删除权限时，才会显示管理菜单
            $operation_edit = ($_G['forum']['ismoderator'] && $_G['group']['alloweditpost'] && (!in_array($val['adminid'], array(1, 2, 3)) || $_G['adminid'] <= $val['adminid'])) || ($_G['forum']['alloweditpost'] && $_G['uid'] && ($val['authorid'] == $_G['uid'] && $_G['forum_thread']
            ['closed'] == 0) && !(!$alloweditpost_status && $edittimelimit && TIMESTAMP - $val['dbdateline'] > $edittimelimit)) ? true : false;
            $operation_other = $_G['group']['allowdelpost'] && !$rushreply ? true : false;
            if($operation_edit && $operation_other){
                $groudstatus=1;//1是管理员2是普通用户
            }else{
                $groudstatus=2 ;
            }
            ?>
            <img src="assets/images/more.png" class="discuss_more" onclick="topic_manage(<?php echo  $val['pid'];?>,<?php echo  $groudstatus;?>);">
            <div class="discuss_content"><?php echo $val['message'];echo ($_G['forum']['ismoderator'] || $_G['uid'] == $val['authorid'])  ? $oldmessage : '';?></div>
            <div class="discuss_bottom">
                <div class="praise_reply pid_praise<?php echo  $val['pid'];?>">
                         <?php if($val['praid']!=''){ ?>
                                <img src="assets/images/praise.png" alt="" onclick="test_pid_Praise(<?php echo  $val['pid'];?>,'pid','delete',<?php echo  $_G['uid'];?>);">
                        <?php }else{?>
                                <img src="assets/images/zan.png" alt="" onclick="test_pid_Praise(<?php echo  $val['pid'];?>,'pid','click',<?php echo  $_G['uid'];?>);">
                        <?php }?>
                         <span class="discuss_zan"><?php echo $val['praisenum']?$val['praisenum']:"0" ;?></span>
                 </div>
                 <div class="praise_reply" commentid="<?php echo $val['tid'];?>"  onclick="testClick('changePage',<?php echo $val['pid'];?>, '<?php echo $val['author'];?>',<?php echo $val['authorid'];?>)">
                     <img  src="assets/images/reply.png" >
                     <span class="discuss_zan"><?php echo odz_lang('reply'); ?></span>
                 </div>
            </div>
        </div>
    </li>
<?php } ?>
</ul>
