<?php if($page>=2):?>
    <!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta name="format-detection" content="telephone=yes">-->
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="assets/js/h5_3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/style_3.css?hash=<?php echo rand(0,100000);?>">
</head>
<style type="text/css">
    .quote{background-color: #F8F8F8;padding: 6px;font-size: 14px;color: #7D7D7d;border-radius: 4px;margin-right: 11px;margin-bottom: 12px;}
    .quote a{color: #7D7D7D!important;}
</style>
<script type="text/javascript">
    var smiley_search = <?php echo make_smilie_json();?>;
</script>
<body>
<div class='bbs-feed-list'>
    <div class='itm'>
        <?php endif;?>
        <ul class="discuss_ulA">
            <?php
            $view_pids=isset($_GET['view_pid'])?$_GET['view_pid']:0;
            foreach($postlist as $key=>$val){
                if($val['first']) {
                    continue;
                }
                $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'].odz_lang('floor_suffix'));
                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['uid'];?>)" 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 ;
                        }
                        ?>
                        <!--操作菜单_开始-->
                        <div class="post-operation">
                            <span class="post-floor"><?php echo $val['floortitle'];?></span>
                            <img src="assets/images/more.png" class="discuss_more" onclick="topic_manage(<?php echo  $val['pid'];?>,<?php echo  $groudstatus;?>);">
                        </div>
                        <!--操作菜单_结束-->
                        <div class="discuss_content"><?php echo $val['message'];echo ($_G['forum']['ismoderator'])  ? $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>

        <?php if($totalpage==1||$page>=2):?>
    </div>
</div>
<script type="text/javascript">
    var MocuzMobile = {
        Android: function() {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function() {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function() {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function() {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function() {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };

    pid = <?php echo $forum_post['pid']; ?>;
    authorid = <?php echo $forum_post['authorid']; ?>;//发帖者id
    auth = '<?php echo $_GET['auth']; ?>';
    uid = '<?php echo $_G['uid']; ?>';
    get_uid = <?php echo  $_G['uid']; ?>;
    replies_pagecount= '<?php echo $replies_pagecount; ?>';
    view_pids = <?php echo $view_pids; ?>;
    reward_view = '<?php echo $reward_view; ?>';
    siteurl = '<?php echo $_G['siteurl'] ?>';
    jinghua_params = '<?php echo $jinghua_params; ?> ';
    zhiding_params = '<?php echo $zhiding_params; ?>';
    /*checkbox投票*/
    checknum = '<?php echo $maxchoices;?>'; // 最多可选几项
    tid = <?php echo $_G['tid'];?>;
    fid = <?php echo $_G['fid']; ?>;
    baoming_params = '<?php echo $baoming_params; ?>';
    toupiao_params = '<?php echo $toupiao_params; ?>';
    mocuz_type = '<?php echo $_G['mocuz_config']['mocuz_type']; ?>';
    baseurl = '<?php echo $_G['baseurl']; ?>';
    totalpage = "<?php echo $totalpage?>";
    forum_author = "<?php echo $_G['forum_thread']['author']; ?>";
    ucenterurl = '<?php echo $_G['setting']['ucenterurl'];?>';
    // 交互
    client="<?php echo $_GET['client'];?>";
    favid="<?php echo $postarr['favid'];?>";
    sharelink="<?php echo urlencode($sharelink); ?>";
    share_text="<?php echo odz_format_sharetext(odz_lang('biu_sharetext')); ?>";
    subject="<?php echo $_G['forum_thread']['subject']; ?>";
    // var shareIcon=$('.img_detail').attr('src');
    shareIcon="<?php echo $shareicon; ?>";
    xj_params = '<?php echo $xj_params; ?>';
    jxqx_params = '<?php echo $jxqx_params; ?>';
    h5_page = "<?php echo $h5_page ?>";
    android_typedata = '<?php echo $advertstr;?>';
    ios_typedata = '<?php echo urlencode($advertstr);?>';
    homeurl = "<?php echo $_G['baseurl'];?>";
</script>
<script type="text/javascript">
    //微信分享出去后回调的 页面JS方法
    function Share_success()
    {
        $.post(siteurl+"index.php?mod=share_get_score", {auth: '<?php echo $_GET["auth"]?>'}, function(data) {
            /*optional stuff to do after success */
            if(data.code == 1)
            {
                alert(data.msg);
            }
        },'json');
    }

    var doc = $(".discuss_box").find(".img_detail");
    doc.css("max-width","100%");
    doc.removeAttr("width");
    doc.removeAttr("height");
    doc.parent().css({"padding-right":"11px"});


    var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
    if(height<504){
        $('.discuss,.discuss_ulA li,.discuss_ul li').css('border-width','1px');
    }
    var u = navigator.userAgent;
    if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
        $('.discuss,.discuss_ulA li,.discuss_ul li').css('border-width','1px');
    }
</script>
</body>
</html>
<?php endif;?>
