<?php
require_once 'includes/Mcrypt3Des.php';
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$weixin=strpos($user_agent, 'MicroMessenger');
$view_pids=isset($_GET['view_pid'])?$_GET['view_pid']:0;
$h5_page=$_G['ppp']-1;
$postarr = array();
// 过滤帖子标题中的换行符
$_G['forum_thread']['subject'] = str_replace("\n", "", $_G['forum_thread']['subject']);

foreach($postlist as $key => $post) {
    if($post['first']) {
        $shareicon = getshareicon($post['message']);
        $shareicon = urlencode(str_replace('&amp;','&',$shareicon));
        $post['message'] = odz_format_message($post['message']);
        $post['message'] = str_replace('!post_hide!', '<h4>本帖隐藏的内容</h4>', $post['message']);
        $message = str_replace('size=', '', $post['message']);
        $postarr = $post;
        unset($postlist[$key]);
        break;
    }
}
//默认头像
if(strpos($_G['setting']['ucenterurl'],'http') !== false){
    $baseurl = $_G['setting']['ucenterurl'];
}else{
    $baseurl = $_G['baseurl'].$_G['setting']['ucenterurl'];
}
$default_avatar = "<img src=".$baseurl."/images/noavatar_small.gif>";
$advertstr = ''; // Advert data to client
if(!empty($odz_advert)){
    $odz_advert['typedata'] = json_decode($odz_advert['typedata'], true);
    $advertstr = array(
        'typedata' => $odz_advert['typedata'],
        'typename' => $odz_advert['typename'],
        'title' => $odz_advert['ad_name'],
        'ad_name' => $odz_advert['ad_name'],
        'ad_id' => $odz_advert['ad_id']
    );
    if(defined('CHARSET') && CHARSET != 'utf-8') {
        $advertstr['title'] = $advertstr['ad_name'] = iconv(CHARSET, 'utf-8', $odz_advert['ad_name']);
    }
    $advertstr = json_encode($advertstr);
}
$maingroup = $_G['group'];
?>
<!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="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title><?php echo $_G['forum_thread']['subject']; ?></title>
    <link rel="stylesheet" type="text/css" href="assets/css/mods.css?hash=<?php echo date('YmdHi',time());?>">
    <link rel="stylesheet" type="text/css" href="assets/css/style_3.css?hash=<?php echo date('YmdHi',time());?>">
    <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="assets/js/fastclick.js"></script>
    <script type="text/javascript" src="assets/js/commondz.js?hash=<?php echo date('YmdHi',time());?>"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/activity.css?hash=<?php echo date('YmdHi',time());?>">
    <style type="text/css">
        /*视频播放器*/
        .videowrap { margin: 10px 0; }
        .videocontainer { font-size: 12px; color:#666666; margin: 0 auto; width:300px; line-height: 0!important;}
        .video_menu { height:24px; line-height:24px; padding-left: 5px; }
        .video_menu a { color: #666666; text-decoration:none; }
        .video_text { padding-top: 90px; text-align: center; }
        .video_error { color: #ff0000; }
        .downapp {position: fixed;bottom:0px;}
        .downapp span {width: 50px;height: 50px;display: block;position: absolute;right:0px;top:0px;}
        .dh-option-table{table-layout: auto;width: 100%;border-collapse:collapse;margin:10px 2px;}
        .dh-option-table thead{background-color: #F0F0F0;font-weight: bold;line-height: 28px;font-size: 14px}
        .dh-option-table td{border:1px solid #eee;border-collapse:collapse;table-layout:fixed;padding: 5px}
        .dh-option-table .option-label{width: 80px}
        .bbs-feed-list .desc{ font-size: 16px; line-height: 1.6; padding-left: 20px;}
        #report-btn{display:inline-block;padding:1px;color:#fff;font-size:16px;padding:0px 6px;color: #4a4a4a;margin-top: 20px;}
        .html-data img { height: auto; }
        .bbs-feed-count a.replypost { color: #ff6600; }
        .videoCon {text-align: center;}
        .quote{background-color: #F8F8F8;padding: 6px 10px 6px 12px;font-size: 15px;color: #7D7D7d;border-radius: 4px;margin-top: 8px;margin-bottom:8px;}
        .quote a{color: #7D7D7D!important;}
        .quote blockquote { margin: 0px 5px 0px 5px; font-size: 14px;}
        .itm_height{width: 100%;height:230px;}
        .report{z-index:1000;position:fixed; bottom:0px;left:0px;}
        .hd-s img {max-width:100%;height:auto;}
        /*表格信息*/
        .photo_size{width:300px;}
        .html-data table{width: 100%;font-size: 13px;}
        .html-data table tr td{padding: 6px 5px 6px 5px !important;}
        .html-data table caption{background: #FAFAFA;padding: 6px 5px 6px 5px !important;text-align: left;border:0.8px solid #EEEEEE; color: #B0B0B0;text-indent: 5px; font-size: 14px!important;}
        .html-data table tr td{border-bottom:0.8px solid #C2D5E3;padding: 4px 0px !important;}
        .html-data table tr td.textname{border-bottom:0.8px solid #EEEEEE;border-left:0.8px solid #EEEEEE;border-right:0.8px solid #EEEEEE;color:#B0B0B0;width: 24%;text-align: center;}
        .html-data table tr td.textvalue{border-bottom:0.8px solid #EEEEEE;border-right:0.8px solid #EEEEEE;color:#6F6F6F;padding: 0px 12px!important;}
        .join_show{width: 90%;margin: 0px auto;position: absolute;background-color: #fff;border-radius: 5px;z-index: 2000;left: 0px;top: 0px;display: none;}
        .join_show h4{padding: 8px 0px 8px 15px;}
        .join_pop{ border-top: solid 1px #E4E4E4;}
        .join_pop .ipt{background-color: #fff; margin-bottom: 15px;}
        .join_pop .ipt > div{margin-left: 10px; border-bottom: solid 1px #EEEEEE;padding: 15px 0px 15px 5px;}
        .join_pop .ipt p{margin-left: 10px; border-bottom: solid 1px #EEEEEE;padding: 15px 0px 15px 5px;}
        .join_pop .ipt .sn{color: #959595; width: 65px;display: block;float: left;}
        /*输入框*/
        .join_pop .ipt input{ margin-left: 10px;font-size: 14px; width:60%;border:1px solid #979797;}
        /*提交*/
        .join_pop  .sub{width: 30%;border-radius: 5px;background-color: #42A8EC; color: #fff;font-size: 20px;text-align: center;padding: 10px 0px 10px 0px;display: block;-webkit-appearance: none; float: left;}
        .jremarks{border: 1px solid #979797;}
        .jabolish{background-color: #42A8EC;color: #fff;font-size: 15px;text-align: center;padding: 5px 17px 5px 17px;border-radius: 5px;display: block;float: left;margin-right: 15px;}
        .jit{margin-left: 10px;}
        .join_b{overflow: hidden;float: right;margin-bottom: 15px;}
        .disabled{background: #B9B4B4;border-color:#908E8E;color: #7E7E7E}
        /*活动贴样式下沉修订*/
        .change_active_content{
            margin-left: 0px !important;
            width: auto !important;
            border-bottom: 0px !important;
            border-left: 1px solid #D5D5D5;
            padding-left: 10px;
        }
        .inline_block{display:inline-block}
    </style>
    <script type="text/javascript">
        $(function(){
            new FastClick(document.body);
        })
    </script>
    <script type="text/javascript">
        var smiley_search = <?php echo make_smilie_json();?>;
        <?php if(!empty($reward_view)){?>
        var reward_socre = {"socre_name":"<?php  echo $reward_view['socre_name']; ?>","credits":"<?php echo $reward_view['credits']; ?>","score_list":<?php echo json_encode($reward_view['score_list']); ?>}
        <?php }else{?>
        var reward_socre = {"socre_name":"","credits":"","score_list":''}
        <?php }?>
    </script>
</head>
<body >
<div class="shade"></div>
<div class="subshade"></div>
<div class="mobile-wrap">
<div class="bbs-cv-info">
    <?php if($postarr['anonymous'] == 1 ||$_G['forum_thread']['authorid'] == 0):?>
        <a href="javascript:void(0);"   class="user-hd">
            <?php echo $default_avatar;?>
        </a>
    <?php else:?>
        <a href="javascript:void(0);"   onclick="lbsPerson(<?php echo $_G['forum_thread']['authorid']; ?>)"   class="user-hd">
            <?php echo $postarr['avatar'];?>
        </a>
    <?php endif;?>
    <div class="user-txt">
        <?php if($postarr['anonymous'] == 1 ||$_G['forum_thread']['authorid'] == 0):?>
            <a href="javascript:void(0);"   class="user-txt-name namecolor"><?php echo odz_lang('anonymous'); ?></a>
        <?php else:?>
            <a href="javascript:void(0);"   onclick="lbsPerson(<?php echo $_G['forum_thread']['authorid']; ?>)"  class="user-txt-name namecolor"><?php echo $_G['forum_thread']['author']; ?><?php echo usergruop_level($_G['forum_thread']['authorid'],1)?></a>
        <?php endif;?>

        <p><?php echo $postarr['dateline']; ?>
            <span class="discuss_span inline_block"><?php if($postarr['devicetype']){ ?><?php echo '&nbsp;&nbsp;来自'; }?><span class="discuss_span inline_block"><?php if($postarr['devicetype']){ ?><?php echo $postarr['devicetype'].'客户端'; }?></span></span></p>
    </div>
    <div class="attention_view"></div>
    <?php if($postarr['anonymous'] == 1 || $_G['forum_thread']['authorid'] == 0):?>

    <?php else:?>
        <?php if($follow_friend<1):?>
            <?php if($_G['forum_thread']['authorid']!=$_G['uid']):?>
                <?php if(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))):?>
                <?php else:?>
                    <p class="attention attention_n" onclick="follow_friend1(<?php echo $_G['forum_thread']['authorid']; ?>,'<?php echo $_G['forum_thread']['author'];?>','add_friend')">+ 关注</p>
                <?php endif;?>
            <?php endif;?>
        <?php else:?>
            <p class="attention attention_y" onclick="follow_friend1(<?php echo $_G['forum_thread']['authorid']; ?>,'<?php echo $_G['forum_thread']['author'];?>','delete_friend')">已关注</p>
        <?php endif;?>
    <?php endif;?>
</div>
<div class="bbs-cv-main">
<div class="bbs-cv-hd">
    <p class="head_title"><?php echo $_G['forum_thread']['subject']; ?></p>
    <div class="btm">
        <span class="head_from">来自</span>
        <span class="head_type" onclick="toSection(<?php echo $_G['fid']?>);" ><?php echo $_G['forum']['name']?></span>
        <!-- <span class="head_from">/ 浏览 <?php echo $_G['thread']['views'];?></span> -->
        <span class="head_from">/ 回复 <?php echo $_G['thread']['replies'];?></span>
    </div>
</div>

<!-- 新增编辑信息 -->

<!-- xj_event插件活动表格STSRT -->
<?php if(in_array('xj_event', $_G['setting']['plugins']['available'])) { ?>
    <?php if($items['postclass'] == 1) {?>
        <div class="html-data hd-s">
            <?php if($imgurl) {?>
                <div><img src="<?php echo $_G['baseurl'].$imgurl;?>"></div><br>
            <?php } ?>
            <table cellspacing="0" style="margin-bottom: 15px;">
                <tbody>
                <tr>
                    <td class="textname" style="border-top:1px solid #EEEEEE;">活动方式</td>
                    <td class="textvalue" style="border-top:1px solid #EEEEEE;"><?php echo $postclass; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动类型</td>
                    <td class="textvalue"><?php echo $eventclass[1]; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动地区</td>
                    <td class="textvalue"><?php echo $citys; ?></td>
                </tr>
                <tr>
                    <td class="textname">开始时间</td>
                    <td class="textvalue"><?php echo $starttime; ?></td>
                </tr>
                <tr>
                    <td class="textname">结束时间</td>
                    <td class="textvalue"><?php echo $endtime; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动地点</td>
                    <td class="textvalue"><?php echo $items['event_address']; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动管理</td>
                    <td class="textvalue"><?php echo $event_adminlist; ?></td>
                </tr>
                <?php if($items['use_extcredits_num']>0) {?>
                    <tr>
                        <td class="textname">活动方式</td>
                        <td class="textvalue"><?php echo $postclass; ?></td>
                    </tr>
                <?php } ?>
                <tr>
                    <td class="textname">参加名额</td>
                    <td class="textvalue"><?php if($items['event_number']==0) {echo $postclass;} else {echo $items['event_number'].'人';} ?></td>
                </tr>
                <tr>
                    <td class="textname">报名人数</td>
                    <td class="textvalue"><?php echo $applycountnumber.'人 待审核'.' '.$applycountnumberd.'人'; ?></td>
                </tr>
                <tr>
                    <td class="textname">参加费用</td>
                    <td class="textvalue">
                        <?php
                        if($setting['eventaa']) {
                            echo 'AA ';
                            if($items['use_cost']>0) {
                                echo $items['use_cost'].'元左右';
                            }
                        } else {
                            echo $items['use_cost'].'元';
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td class="textname">报名截止</td>
                    <td class="textvalue"><?php echo $activityexpiration; ?></td>
                </tr>
                </tbody>
            </table>
        </div>
    <?php } elseif ($items['postclass'] == 2) {?>
        <div class="html-data hd-s">
            <?php if($imgurl) {?>
                <div><img src="<?php echo $_G['baseurl'].$imgurl;?>"></div><br>
            <?php } ?>
            <table cellspacing="0" style="margin-bottom: 15px;">
                <tbody>
                <tr>
                    <td class="textname" style="border-top:1px solid #EEEEEE;">活动方式</td>
                    <td class="textvalue" style="border-top:1px solid #EEEEEE;"><?php echo $postclass; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动类型</td>
                    <td class="textvalue"><?php echo $eventclass[1]; ?></td>
                </tr>
                <tr>
                    <td class="textname">开始时间</td>
                    <td class="textvalue"><?php echo $starttime; ?></td>
                </tr>
                <tr>
                    <td class="textname">结束时间</td>
                    <td class="textvalue"><?php echo $endtime; ?></td>
                </tr>
                <tr>
                    <td class="textname">活动地区</td>
                    <td class="textvalue"><?php echo $citys; ?></td>
                </tr>
                <tr>
                    <td class="textname">参与积分</td>
                    <td class="textvalue"><?php echo $items['use_extcredits_num'].' '.$extcredit_title; ?></td>
                </tr>
                <tr>
                    <td class="textname">参加人数</td>
                    <td class="textvalue">
                        <?php
                        if($items['event_number']==0) {
                            echo '不限';
                        } else {
                            echo $items['event_number'].' 人';
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td class="textname">报名人数</td>
                    <td class="textvalue"><?php echo $applycountnumber.' 人 待审核 '.$applycountnumberd.' 人'; ?></td>
                </tr>
                <tr>
                    <td class="textname">参加费用</td>
                    <td class="textvalue"><?php echo $items['use_cost'].'元';?></td>
                </tr>
                <tr>
                    <td class="textname">报名截止</td>
                    <td class="textvalue"><?php echo $activityexpiration;?></td>
                </tr>
                </tbody>
            </table>
        </div>
    <?php } ?>
    <?php
    if($timestamp<($items['endtime']+2592000)) {
        if($items['activityexpiration']<=$timestamp and $verify==null) {
            echo '<a href="javascript:void(0);" class="sign-up disabled">报名截止</a>';
        } else {
            if(!$_G['uid']){
                echo '<a href="javascript:void(0);" class="sign-up disabled">我要参加(请登录)</a>';
            } else {
                if($items['activitybegin']<$timestamp and $items['activityexpiration']>$timestamp and $verify==null) {
                    if(!$setting['invitation']['open'] || ($setting['invitation']['open'] && $setting['invitation']['code'] == $_GET['icode'])) {
                        echo '<a href="javascript:void(0);" class="sign-up event-go">我要参加</a>';
                    }
                } elseif($items['activitybegin']>$timestamp and $verify==null) {
                    echo '<p>报名还未开始</p>';
                } else {
                    if($setting['noverify']==0 && $items['activityexpiration']>$timestamp) {
                        echo '<a href="javascript:void(0);" class="sign-up quxiao">取消报名</a>';
                    }
                }
            }
        }
    }
    ?>
<?php } ?>
<!-- xj_event插件活动表格END -->
<!-- 表格信息START -->
<?php if ($threadsort && $threadsortshow && $threadsortshow['optionlist'] && $threadsortshow['optionlist'] != 'expire') {?>
    <div class="html-data hd-s">
        <div style="padding:11px;background-color:#fff;">
            <table cellspacing="0">
                <caption><?php echo  $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]?></caption>
                <tbody>
                <?php foreach($threadsortshow['optionlist'] as $option) { ?>
                    <?php if ($option['type'] != 'info') { ?>
                        <tr>
                            <td class="textname"><?php echo $option['title'];?></td>
                            <td class="textvalue">
                                <?php if(preg_match('/^http:\/\/.*?[\.jpg|\.png|\.jpeg|\.gif]$/i',$option['value'])):?>
                                    <?php echo "<img class='photo_size' src=".$option['value'].">";?>
                                <?php else:?>
                                    <?php echo $option['value'] !== '' ? $option['value'].' '.$option['unit'] : '-'; ?>
                                <?php endif;?>
                            </td>
                        </tr>
                    <?php } ?>
                <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
<?php } ?>
<!-- 表格信息END -->
<div class="html-data hd-s ">
<div class="bbs-cv-nr">
<?php echo $postarr['message'];?>
<!-- 活动 START -->
<?php if($_G['forum_thread']['special'] == 4) { ?>
    <?php if($activity['thumb']) {?>
        <div><img src="<?php echo $_G['baseurl'].$activity['thumb'];?>"></div>
    <?php } ?>
    <div class="regmain">
        <ul class="activity-list">
            <li>
                <span class="ac-adress"><?php echo lang('forum/template', 'activity_space'); ?></span>
                <span class="content change_active_content"><?php echo $activity['place']; ?></span>
            </li>
            <li>
                <span class="ac-adress"><?php echo lang('forum/template', 'activity_starttime'); ?></span>
                                <span class="content change_active_content">
                                    <?php if($activity['starttimeto']) {
                                        echo odz_lang('activity_start_between', array('starttimefrom'=>$activity['starttimefrom'], 'starttimeto'=>$activity['starttimeto']));
                                    } else {
                                        echo $activity[starttimefrom];
                                    } ?>
                                </span>
            </li>
            <li>
                <span class="ac-adress"><?php echo lang('forum/template', 'activity_type'); ?> </span>
                <span class="content change_active_content"><?php echo $activity['class']; ?></span>
            </li>
            <?php  if(!$_G['forum_thread']['is_archived']) {?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_already'); ?></span>
                    <span class="content change_active_content"><?php echo $allapplynum.lang('forum/template', 'activity_member_unit');?></span>
                </li>
            <?php } ?>
            <li>
                <span class="ac-adress"><?php echo lang('forum/template', 'gender');?></span>
                                <span class="content change_active_content">
                                    <?php if($activity['gender'] == 1) {
                                        echo lang('forum/template', 'male');
                                    } elseif ($activity['gender'] == 2) {
                                        echo lang('forum/template', 'female');
                                    } else{
                                        echo lang('forum/template', 'unlimited');
                                    }?>
                                </span>
            </li>
            <?php if($activity['cost']) { ?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_payment'); ?></span>
                    <span class="content change_active_content"><?php echo $activity[cost].lang('forum/template', 'payment_unit');?></span>
                </li>
            <?php } ?>
            <?php if($activity['number']) { ?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_about_member'); ?></span>
                    <span class="content change_active_content"><?php echo $aboutmembers.lang('forum/template', 'activity_member_unit');?></span>
                </li>
            <?php } ?>
            <?php if($activity['expiration']) { ?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'post_closing'); ?></span>
                    <span class="content change_active_content"><?php echo $activity[expiration];?></span>
                </li>
            <?php } ?>
        </ul>
        <?php if(!$activityclose && (!$applied || $isverified == 2)) {?>
            <a href="javascript:void(0);" class="sign-up baoming">我要报名</a>
        <?php } elseif($_G['uid'] && !$activityclose && $applied) {?>
            <a href="javascript:void(0);" class="sign-up baoming">取消报名</a>
        <?php } ?>
    </div>
<?php } ?>
<!-- 活动 END -->
<!-- 投票 START -->
<?php if ($_G['forum_thread']['special'] == 1) { ?>
    <p class="take-number">
        <?php
        if($multiple) {
            echo lang('forum/template', 'poll_multiple').lang('forum/template', 'thread_poll');
            if($maxchoices) {
                echo "（ ".odz_lang('poll_more_than', array('maxchoices'=>$maxchoices))."）";
            }
        } else {
            echo lang('forum/template', 'poll_single').lang('forum/template', 'thread_poll');
        }
        if($visiblepoll && $_G['group']['allowvote']) {
            echo ' , '.lang('forum/template', 'poll_after_result');
        }
        echo ' , '.odz_lang('poll_voterscount', array('voterscount'=>'<span class="allVote">'.$voterscount.'</span>'));
        if(!$visiblepoll && ($overt || $_G['adminid'] == 1 || $thread['authorid'] == $_G['uid']) && $post['invisible'] == 0) {
            echo '<a href="javascript:void(0)" id="showpoll">'.lang('forum/template', 'poll_view_voters').'</a>';
        }
        ?>
    </p>
    <?php if($_G['forum_thread']['remaintime']) { ?>
        <p>
            <?php
            echo lang('forum/template', 'poll_count_down');
            if($_G['forum_thread']['remaintime'][0]) {
                echo $_G['forum_thread']['remaintime'][0].lang('forum/template', 'days');
            }
            if($_G['forum_thread']['remaintime'][1]) {
                echo $_G['forum_thread']['remaintime'][1].lang('forum/template', 'poll_hour');
            }
            echo $_G['forum_thread']['remaintime'][2].lang('forum/template', 'poll_minute');
            ?>
        </p>
    <?php } elseif ($expiration && $expirations < TIMESTAMP) { ?>
        <p><?php echo lang('forum/template', 'poll_end'); ?></p>
    <?php }?>
    <?php if($isimagepoll) { //图片投票?>
        <div class="regmain">
            <ul class="poll-list">
                <?php foreach ($polloptions as $key => $row) { ?>
                    <li>
                        <img src="<?php
                        $parse = parse_url($row['imginfo']['big']);
                        echo empty($parse['scheme'])? $_G['baseurl'].$row['imginfo']['big']:$row['imginfo']['big']
                        ?>" alt="" class="textimg">
                                    <span class="poll-bot">
                                      <span class="progress">
                                          <span class="v-sp1"><?php echo $row['votes']; ?></span>
                                          <span class="v-sp2">(<?php echo $row[
                                              'percent']; ?>%)</span>
                                          <div class="bc" style="width:<?php echo $row['width']; ?>"></div>
                                      </span>
                                    </span>
                        <p data="<?php echo $row['polloptionid']; ?>">
                            <?php if($_G['group']['allowvote']) { ?>
                                <?php if($maxchoices) {?>
                                    <input type="checkbox" value="<?php echo $row['polloptionid'];?>" class="vote-check" >
                                <?php } else {?>
                                    <a href="javascript:void(0);" class="v-hide"><img src="<?php echo $_G['siteurl'] ?>assets/images/noselect.png" alt=""></a>
                                <?php } ?>
                            <?php } ?>
                            <?php echo $row['polloption']; ?>
                        </p>
                    </li>
                <?php } ?>
            </ul>
            <?php if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
                <a href="javascript:void(0);" class="sign-up v-hide signimg">投票</a>
            <?php } ?>
        </div>
    <?php } else { // 文字投票?>
        <div class="vPage">
            <ul class="v-list">
                <?php foreach ($polloptions as $key => $row) { ?>
                    <li>
                        <?php if($_G['group']['allowvote']) { ?>
                            <?php if(!$maxchoices) { ?>
                                <a href="javascript:void(0)" class="them toupiao v-hide" data="<?php echo $row['polloptionid']; ?>"><img src="<?php echo $_G['siteurl'] ?>assets/images/noselect.png" alt="" ></a>
                            <?php } else { ?>
                                <input type="checkbox" value="<?php echo $row['polloptionid']; ?>" class="vote-check vote-margin" >
                            <?php } ?>
                        <?php } ?>
                        <div class="v-list-left">
                            <span class="v-list-left-title"><?php echo $row['polloption'] ?></span>
                            <div class="bc" style="width:<?php echo $row['width']; ?>"></div>
                            <div class="v-sp">
                                <span class="poll"><?php echo $row['votes']; ?></span>
                                (<?php echo $row['percent']; ?>%)
                            </div>
                        </div>
                    </li>
                <?php } ?>
            </ul>
            <?php if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
                <a href="javascript:void(0)" class="sign-up v-hide signtext" >投票</a>
            <?php } ?>
        </div>
    <?php } ?>
    <?php
    if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
        <?php if($overt) { echo lang('forum/template', 'poll_msg_overt');}?>
    <?php } elseif(!$allwvoteusergroup) {
        echo lang('forum/template', 'poll_msg_allwvoteusergroup');
    } elseif(!$allowvotepolled) {
        echo lang('forum/template', 'poll_msg_allowvotepolled');
    } elseif(!$allowvotethread) {
        echo lang('forum/template', 'poll_msg_allowvotethread');
    }
    ?>
<?php } ?>
<!-- 投票 END -->
<?php
$operation_edit = ($_G['forum']['ismoderator'] && $_G['group']['alloweditpost'] && (!in_array($post['adminid'], array(1, 2, 3)) || $_G['adminid'] <= $post['adminid'])) || ($_G['forum']['alloweditpost'] && $_G['uid'] && ($post['authorid'] == $_G['uid'] && $_G['forum_thread']['closed'] == 0) && !(!$alloweditpost_status && $edittimelimit && TIMESTAMP - $post['dbdateline'] > $edittimelimit)) ? true : false;
$operation_other = $modmenu['thread'] && $_G['forum']['ismoderator'] ? true : false;
if($operation_edit || $operation_other){
    ?>
    <div class="operate_box">
        <div class="operate">
            <ul>
                <?php if ($operation_edit) {?>
                    <li><a href="javascript:editpost(<?php echo $postarr[pid]; ?>);"><img src="assets/images/bj.png" alt=""><p>编辑</p></a></li>
                <?php } ?>
                <?php if($operation_other) { ?>
                    <?php if($_G['group']['allowdelpost']) { ?>
                        <li><a href="javascript:deletepost('topic', <?php echo $postarr[pid]; ?>);" class="del_op"><img src="assets/images/sc.png" alt=""><p>删除</p></a></li>
                    <?php } ?>
                    <?php if($_G['group']['allowmovethread'] && !$_G['forum_thread']['is_archived'] && $_G['forum']['status'] != 3) { ?>
                        <li><a href="javascript:void(0);" class="move_op"><img src="assets/images/yd.png" alt=""><p>移动</p></a></li>
                    <?php } ?>
                    <?php if($_G['group']['allowdigestthread'] && !$_G['forum_thread']['is_archived']) { ?>
                        <li><a href="javascript:void(0);" class="essence"><img src="assets/images/jh.png" alt=""><p>精华</p></a></li>
                    <?php } ?>
                    <?php if($_G['group']['allowstickthread'] && ($_G['forum_thread']['displayorder'] <= 3 || $_G['adminid'] == 1) && !$_G['forum_thread']['is_archived']) { ?>
                        <li><a href="javascript:void(0);" class="puttop"><img src="assets/images/zd.png" alt=""><p>置顶</p></a></li>
                    <?php } ?>
                <?php } ?>
            </ul>
        </div>
    </div>
<?php } ?>
<!-- 置顶精华 -->
<?php if($modmenu['thread'] && $_G['forum']['ismoderator']) {
    // to do 指定精华
}?>
<?php if($postarr['attachment']>0){  ?>
    <?php foreach($postarr['annexlist']['thumb'] as $val){  ?>
        <img src="<?php echo $val?>" alt="">
    <?php }?>
<?php }?>
<?php if($postarr['annexlist']['sound']){ ?>
    <audio src="<?php echo  $postarr['annexlist']['sound'];?>" preload="auto" />
<?php }?>
<!--            <span style="float:right">
                      <a id="report-btn" href="javascript:void(0);" onclick="report();" >&nbsp;举报&nbsp;</a>
                </span>-->
<!--            <div class="toshare">
                <span class="tosharet">分享到</span>
                <ul>
                    <li><a href="javascript:void(0);" onclick="shareWeiCof()"><img src="assets/images/firend.png?hash=123" alt=""><p>微信朋友圈</p></a></li>
                    <li><a href="javascript:void(0);" onclick="shareWeixin()"><img src="assets/images/wechat.png?hash=123" alt=""><p>微信好友</p></a></li>
                    <li><a href="javascript:void(0);" onclick="shareSina()"><img src="assets/images/blog.png?hash=123" alt=""><p>新浪微博</p></a></li>
                    <li><a href="javascript:void(0);" onclick="shareMore()"><img src="assets/images/mores.png?hash=123" alt=""><p>更多</p></a></li>
                </ul>
                <?php if(!empty($odz_advert)):?>
                <div class="advertising">
                    <a href="javascript:void(0);"><img src="<?php echo $odz_advert['image'];?>" onclick="showadvert()" alt=""></a>
                    <div></div>
                    <span>推广</span>
                </div>
                <?php endif;?>
            </div>-->
<!--<div class='hrtalk'></div>-->
</div>
<?php if(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))):?>
<?php else:?>
    <div class="content_zan ">
        <div class="likea">
            <?php if($postarr['praid']!=''){ ?>
                <img src="assets/images/good_b.png" alt=""onclick="test_tid_Praise(<?php echo  $postarr['tid'];?>,'tid','delete',<?php echo $_G['uid'];?>);">
            <?php }else{?>
                <img src="assets/images/good.png" alt=""  onclick="test_tid_Praise(<?php echo  $postarr['tid'];?>,'tid','click',<?php echo $_G['uid'];?>);">
            <?php }?>
            <p><?php echo $postarr['praisenum']?$postarr['praisenum']:0 ;?></p>
        </div>
    </div>
<?php endif;?>
<div class="award">
    <?php if(!empty($reward_totals['avatar_list'])){ ?>
        <div class="award_box">
            <a  onclick="tonextweb('<?php echo  $_G['siteurl']."index.php?mod=rewardlist&tid=".$_G['forum_thread']['tid']?>','打赏列表');" >
                <div class="award_font" >
                    <p class="award_num">共有<span><?php echo $reward_totals['user_nums']; ?></span>人次打赏<?php echo $reward_totals['scorename']; ?> <span><?php echo $reward_totals['sum_score'] ?></span></p>
                    <ul>
                        <?php foreach ($reward_totals['avatar_list'] as $user_avatar) {?>
                            <li><img src="<?php echo $user_avatar; ?>" alt=""></li>
                        <?php }?>
                    </ul>
                </div>
            </a>
            <img src="assets/images/jty.png" alt="" class="jt_you">
            <?php if(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))):?>
                <img src="assets/images/award_disable.png" alt="" class="award_do do_img">
            <?php else:?>
                <img src="assets/images/award.png" alt="" id="dashang"  class="award_do do_img">
            <?php endif;?>
        </div>
    <?php }else{?>
        <div class="award_hezi">
            <div class="award_fontA">好帖就要任性打赏~</div>
            <?php if(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))):?>
                <img src="assets/images/award_disable.png" alt="" class="award_do do_img">
            <?php else:?>
                <img src="assets/images/award.png" alt="" id="dashang"  class="award_do do_img">
            <?php endif;?>
        </div>
    <?php }?>
</div>
<!--        <div class="bbs-feed-count">
                  <img src="assets/images/icon-comment.png?hash=123" width="18" height="18">
                  <span><?php echo $_G['forum_thread']['replies']; ?>条评论</span>
            </div>-->

<!-- 新增广告位 -->
<script type="text/javascript" src="http://common.api.mocuz.com/android/1.0/getAdvert?cid=<?php echo ODZ_CHANNELID;?>&pid=11"></script>

</div>

<!--<div class='linezyc'></div>-->
<!--bbs-cv-main-->
<div class="bbs-feed-list discuss">
    <?php if(!empty($hot_replylist)){ ?>
        <div class="ground" >
            <p class="discuss_type">热门评论</p>
            <?php include './template/viewthread_hot_reply.php';?>
        </div>
    <?php }?>
    <div class="ground" >
        <p class="discuss_type">最新评论</p>
        <div class="itm">
            <?php include './template/viewthread_reply.php';?>
        </div>
    </div>
</div>
<div class="frame-box">
    <form>
        <h3>选择了一篇帖子</h3>
        <div class="frame-main">
            <div>
                <span class="seltext">目标版块</span>
                        <span class="selbg">
                            <span class="selhid">
                                <select name="moveto" class="test" onchange="getthreadtypes(this.value);">
                                    <?php echo $forumselect; ?>
                                </select>
                            </span>
                        </span>
            </div>
        </div>
        <div class="frame-main frame-main1">
            <div><span class="seltext">目标分类</span>
                        <span class="selbg">
                            <span class="selhid">
                                <div id="threadtypeid">
                                    <select name="threadtypeid" class="test"></select>
                                </div>
                            </span>
                        </span>
            </div>
        </div>
        <div class="select-them">
            <div class="them1"><a href="javascript:;" class="them"><img src="assets/images/select.png" alt="" data="true">移动主题</a></div>
            <div class="them2"><a href="javascript:;" class="them"><img src="assets/images/nselect.png" alt="" data="false">保留转向</a></div>
        </div>
        <div class="commd">
            <a href="javascript:;" class="them1 clance">取消</a>
            <a href="javascript:;" class="them2 confirm">确定</a>
        </div>
    </form>
</div>
</div>
<!-- 报名活动框 START-->
<div class="eroll-show">
    <?php if($_G['uid'] && !$activityclose && (!$applied || $isverified == 2)) { ?>
        <p class="careful">
            <?php if($_G['setting']['activitycredit'] && $activity['credit'] && !$applied) {
                echo lang('forum/template', 'activity_need_credit').$activity[credit].$_G['setting']['extcredits'][$_G['setting']['activitycredit']][title];
            }?>
        </p>
        <?php if($activity['cost']) { //支付方式?>
            <div class="paybg">
                <p class="method"><?php echo lang('forum/template', 'activity_paytype'); ?></p>
                <p class="payable"><a href="javascript:void(0);" ><img src="<?php echo $_G['siteurl'] ?>assets/images/select.png" alt="" ><?php echo lang('forum/template', 'activity_pay_myself'); ?></a></p>
                <p class="payable"><a href="javascript:void(0);" ><img src="<?php echo $_G['siteurl'] ?>assets/images/noselect.png" class="payImg" alt="" ><?php echo lang('forum/template', 'activity_would_payment'); ?>
                        <span><input type="text" class="pay must"><?php echo lang('forum/template', 'payment_unit'); ?></span></a></p>
            </div>
        <?php } ?>
        <form id="myactive">
            <?php if(!empty($activity['ufield']['userfield'])) {?>
                <div class="eMassage"><div class="ipt">
                        <?php if($settings[$fieldid][available]) { ?>
                            <?php foreach ($activity['ufield']['userfield'] as $fieldid) {?>
                                <?php if(!$settings[$fieldid][title]) {continue;} ?>
                                <p><span class="sn"><strong style="color:red;">*</strong><?php echo $settings[$fieldid][title] ?></span>
                                    <?php if($settings[$fieldid][formtype] == 'select' && $settings[$fieldid][choices] || $fieldid == 'gender') {
                                        $choices = explode("\n", $settings[$fieldid][choices]);
                                        if ($fieldid == 'gender') {
                                            $choices = array('保密', '男', '女');
                                        }
                                        ?>
                                        <select name="<?php echo $fieldid; ?>" class="it must">
                                            <?php foreach($choices as $row) { ?>
                                                <option value="<?php echo $row ?>"><?php echo $row; ?></option>
                                            <?php } ?>
                                        </select>
                                    <?php }elseif($settings[$fieldid][formtype] =='textarea'){ ?>
                                        <textarea name="<?php echo $fieldid; ?>" class="it must"></textarea>
                                    <?php } else { ?>
                                        <input type="text" name="<?php echo $fieldid; ?>" placeholder="请输入<?php echo $settings[$fieldid][title];?>" autocomplete="on" class="it must">
                                    <?php } ?>
                                </p>
                            <?php } ?>
                        <?php } ?>
                    </div></div>
            <?php } ?>
        </form>
        <div class="eMassage">
            <div class="ipt">
                <p><span class="sn"><?php echo lang('forum/template', 'leaveword'); ?></span><textarea name="" id="" cols="30" rows="3" autocomplete="on" class="it remarks"><?php echo $applyinfo[message]; ?></textarea></p>
            </div>
            <div class="opera">
                <input type="submit" value="提交" class="sub" data='go'>
                <a href="javascript:void(0);">取消</a>
            </div>
        </div>
    <?php } elseif($_G['uid'] && !$activityclose && $applied) {?>
        <div class="eMassage">
            <div class="ipt">
                <p ><span class="sn"><?php echo lang('forum/template', 'leaveword'); ?></span><textarea name="" id="" cols="30" rows="3" autocomplete="on" class="it remarks"><?php echo $applyinfo[message]; ?></textarea></p>
            </div>
            <div class="opera">
                <input type="submit" value="提交" class="sub" data='back'>
                <a href="javascript:void(0);">取消</a>
            </div>
        </div>
    <?php } ?>
</div>
<!-- 报名活动 END -->
<div class="vdialog">
    <p class="dTop"><span></span></p>
    <a href="javascript:v_dBottom();"><p class="dBottom">好</p></a>
</div>
<div class="subdialog">
    <p class="subdTop"><span></span></p>
    <a href="javascript:sub_dBottom();"><p class="subBottom">好</p></a>
</div>
<!-- 插件活动报名 -->
<div class="join_show">
    <h4>我要参加</h4>
    <form id='xjactive'>
        <div class="join_pop">
            <div class="ipt">
                <?php if (!empty($selectuserfield)): ?>
                    <?php foreach ($selectuserfield as $key => $fieldid): ?>
                        <?php if ($settings[$fieldid][available]): ?>
                            <div>
                                <span class="sn"><?php echo $settings[$fieldid][title]; ?><strong style="color:red;">*</strong></span>
                                <?php if ($settings[$fieldid][formtype] != 'file'){?>
                                    <?php echo $htmls[$fieldid]; ?>
                                <?php } ?>
                            </div>
                        <?php endif ?>
                    <?php endforeach ?>
                <?php endif ?>
                <p><span class="sn">报名人数</span>
                    <select name="applynumber" id="applynumber" class="jit">
                        <?php foreach ($applynumber as $value): ?>
                            <option value="<?php echo $value; ?>"><?php echo $value; ?>人</option>
                        <?php endforeach ?>
                    </select>
                </p>
                <?php if (in_array('bmmessage',$userfield)): ?>
                    <p><span class="sn">留言</span>
                        <textarea name="message" id="message" cols="30" rows="3" autocomplete="on" class="it jremarks"></textarea>
                    </p>
                <?php endif ?>
            </div>
            <div class="join_b">
                <a href="javascript:void(0)" class="jabolish jconfirm">提交</a>
                <a href="javascript:void(0)" class="jabolish jclance">取消</a>
            </div>
        </div>
    </form>
</div>
<!-- 精华 -->
<div class="essence-box">
    <form>
        <h3>选择了一篇帖子</h3>
        <div class="frame-main">
            <div><span class="seltext eseltext">精华</span>
                    <span class="selbg">
                        <span class="selhid">
                            <select name="digestlevel" id="digestlevel" class="eselect">
                                <option value="0"><?php echo lang('forum/template', 'admin_digest_remove') ?></option>
                                <option value="1"><?php echo lang('forum/template', 'thread_digest'); ?> 1</option>
                                <?php if($_G['group']['allowdigestthread'] >= 2) { ?>
                                    <option value="2"><?php echo lang('forum/template', 'thread_digest'); ?> 2</option>
                                    <?php if($_G['group']['allowdigestthread'] == 3) { ?>
                                        <option value="3"><?php echo lang('forum/template', 'thread_digest'); ?> 3</option>
                                    <?php } ?>
                                <?php } ?>
                            </select>
                        </span>
                    </span>
            </div>
        </div>
        <div class="commd">
            <a href="javascript:;" class="them1 eclance">取消</a>
            <a href="javascript:;" class="them2 econfirm">确定</a>
        </div>
    </form>
</div>
<!-- 置顶 -->
<div class="puttop-box">
    <form>
        <h3>选择了一篇帖子</h3>
        <div class="frame-main">
            <div><span class="seltext eseltext">置顶</span>
                    <span class="selbg">
                        <span class="selhid">
                            <select name="sticklevel" id="sticklevel" class="eselect">
                                <?php if($_G['forum']['status'] != 3) { ?>
                                    <option value="0"><?php echo lang('forum/template', 'none'); ?></option>
                                    <option value="1"><?php echo $_G['setting']['threadsticky'][2]; ?></option>
                                    <?php if($_G['group']['allowstickthread'] >= 2) { ?>
                                        <option value="2"><?php echo $_G['setting']['threadsticky'][1]; ?></option>
                                        <?php if($_G['group']['allowstickthread'] == 3) { ?>
                                            <option value="3"><?php echo $_G['setting']['threadsticky'][0]; ?></option>
                                        <?php } ?>
                                    <?php } ?>
                                <?php } else {?>
                                    <option value="0"><?php echo lang('forum/template', 'no'); ?>&nbsp;</option>
                                    <option value="1"><?php echo lang('forum/template', 'yes'); ?>&nbsp;</option>
                                <?php } ?>
                            </select>
                        </span>
                    </span>
            </div>
        </div>
        <div class="commd">
            <a href="javascript:;" class="them1 tclance">取消</a>
            <a href="javascript:;" class="them2 tconfirm">确定</a>
        </div>
    </form>
</div>
<!-- 分享显示下载按钮 -->
<?php if($weixin || $_GET['isshare'] == 1) { ?>
    <div class="downapp">
        <a href="<?php echo $_G['baseurl']; ?>mocuzapp.php"><img style="max-width: 100%;display: block;" src="assets/images/downapp.png?_=12414"  alt="" class="downappimg"></a>
    </div>
<?php } ?>

<script type="text/javascript" src='assets/js/jquery.lazyload.min.js?_=201509291647331'></script>
<script type="text/javascript">
    /*视频播放器*/
    (function() {
        var serviceUrl = 'http://tool.mocuz.com/videoplay.php';
        var videoCon = $('.videocontainer');
        function loadVideo() {
            videoCon.each(function() {
                var that = $(this);
                $.getJSON(serviceUrl+'?url='+that.attr('videourl')+'&callback=?', function(data) {
                    if (typeof data.url != 'undefined') {
                        var url=encodeURI(data.url);
                        if(MocuzMobile.Android()) {
                            that.html('<div style="position: relative;" ><img onclick="video_url(\''+url+'\')" src="'+data.img.large+'"><div class="vdo_btn" onclick="video_url(\''+url+'\')"><img  src="assets/images/vdo.png" alt=""></div></div>');
                        }else if(MocuzMobile.iOS()) {
                            that.html('<div style="position: relative;" ><iframe height="199" width="296" frameborder="0" src="'+data.url+'" /></div>');
                        }else{
                            that.html('<div style="position: relative;" ><img onclick="video_url(\''+url+'\')" src="'+data.img.large+'"><div class="vdo_btn" onclick="video_url(\''+url+'\')"><img src="assets/images/vdo.png" alt=""></div></div>');
                        }

                    } else {
                        that.html('<div class="video_text video_error">视频加载失败</div>');
                    }
                });
            });
        }
        setTimeout(loadVideo, 1);
    })();
    $(function() {
        $(".img_detail").lazyload();
    });
</script>
<?php
$e = new Mcrypt3Des();
// 精华
$jinghua_params = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'moderate'=>array($_G['tid']), 'operations'=>array('digest'));
$jinghua_params = json_encode($jinghua_params);
$jinghua_params = $e->encrypt($jinghua_params);
// 置顶
$zhiding_params = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'moderate'=>array($_G['tid']), 'operations'=>array('stick'));
$zhiding_params = json_encode($zhiding_params);
$zhiding_params = $e->encrypt($zhiding_params);
// 报名
$baoming_params = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'pid'=>$postarr['pid']);
$baoming_params = json_encode($baoming_params);
$baoming_params = $e->encrypt($baoming_params);
// 投票
$toupiao_params = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'action'=>'votepoll');
$toupiao_params = json_encode($toupiao_params);
$toupiao_params = $e->encrypt($toupiao_params);
// 插件活动报名
$xj_params = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
$xj_params = json_encode($xj_params);
$xj_params = $e->encrypt($xj_params);
$jxqx_params = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
$jxqx_params = json_encode($jxqx_params);
$jxqx_params = $e->encrypt($jxqx_params);
?>
<script type="text/javascript">
    auth = '<?php echo  urldecode(json_encode (urlencode($_GET['auth']))); ?>';
    uid = '<?php echo  $_G['uid']; ?>';
    replies_pagecount= '<?php echo $replies_pagecount; ?>';
    view_pids = <?php echo $view_pids; ?>;
    get_uid = <?php echo  $_G['uid']; ?>;
    fuid = '<?php echo $_G['forum_thread']['authorid']; ?>';
    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']; ?>;
    pid = <?php echo $postarr['pid']; ?>;
    authorid = <?php echo $postarr['authorid']; ?>;//发帖者id
    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($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>
<?php if(in_array('xj_event', $_G['setting']['plugins']['available']) && ($items['postclass'] == 1 || $items['postclass'] == 2)) {?>
    <script type="text/javascript">
        //        /*插件活动报名*/
        //        function joinin_show(){
        //             window.ontouchmove=function(e){
        //                e.preventDefault && e.preventDefault();
        //                e.returnValue=false;
        //                e.stopPropagation && e.stopPropagation();
        //                return false;
        //            }
        //            $('.shade').show();
        //            $('.join_show').show();
        //            var div=$('.join_show');
        //            $('.join_show').css('left',parseInt(($(window).width()-div.width())/2));
        //            $('.join_show').css('top',parseInt(($(window).height()-div.height())/2+$(document).scrollTop()));
        //        }
        //        $('.event-go').click(function(){
        //            joinin_show();
        //        })
        //        // 取消
        //        $('.jclance').click(function(event) {
        //            $('.join_show').hide();
        //            $('.shade').hide();
        //            window.ontouchmove=function(e){
        //                e.preventDefault && e.preventDefault();
        //                e.returnValue=true;
        //                e.stopPropagation && e.stopPropagation();
        //                return true;
        //            }
        //        });
        //
        //        $('.jconfirm').click(function(event) {
        //            window.ontouchmove=function(e){
        //                e.preventDefault && e.preventDefault();
        //                e.returnValue=true;
        //                e.stopPropagation && e.stopPropagation();
        //                return true;
        //            }
        //            var auth = auth;
        //            var message = $('#message').val() || '';
        //            auth = encodeURIComponent(auth);
        //            href = location.href+'&auth='+auth;
        //
        //            var oparams = $('#xjactive').serialize();
        //            if (oparams) {
        //                var d = oparams.split('&');
        //                for (var i = d.length - 1; i >= 0; i--) {
        //                    var dd = d[i].split('=');
        //                    if(!trim(dd[1])) {
        //                        alert('带 "*" 号为必填项，请填写完整');
        //                        return;
        //                    }
        //                };
        //            }
        //            <?php
                $arr = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
                $xj_params = json_encode($arr);
                $e = new Mcrypt3Des();
                $xj_params = $e->encrypt($xj_params);
            ?>//
        //            $.ajax({
        //                 type: "POST",
        //                 url: siteurl+"index.php?mod=xj_event&ishtml=1&message="+message+'&'+decodeURI(oparams),
        //                 data: xj_params,
        //                 dataType: "html",
        //                 success: function(data){
        //                            $('.join_show').hide();
        //                            $('.shade').hide();
        //                            v_dialog(data);
        //                        }
        //             });
        //        });
        //        $('.quxiao').click(function(){
        //            if(confirm("是否取消报名？")) {
        //                var auth = '<?php echo $_GET['auth']; ?>';
        //                auth = encodeURIComponent(auth);
        //                href = location.href+'&auth='+auth;
        //                <?php
                    $arr = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
                    $params = json_encode($arr);
                    $e = new Mcrypt3Des();
                    $params = $e->encrypt($params);
                ?>//
        //                params = '<?php echo $params; ?>';
        //                $.ajax({
        //                     type: "POST",
        //                     url: "<?php echo $_G['siteurl'] ?>index.php?mod=xj_event&action=cannel&ishtml=1",
        //                     data: params,
        //                     dataType: "html",
        //                     success: function(data){
        //                                v_dialog(data);
        //                            }
        //                 });
        //            }
        //        })
    </script>
    <script type="text/javascript" src="assets/js/h5_3.min.js?hash=<?php echo rand(0,100000);?>"></script>
<?php } ?>

<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');
    }

    $(document).ready(function(){
        var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
        if(height<504){
            $('.bbs-cv-info,.operate_box,.content_zan,.discuss,.content,.discuss,.award,.discuss_ulA li,.discuss_ul li,.html-data table caption,.html-data table tr td,.vote_box_tle,.activity_box table caption,.activity_box table tr td').css('border-width','1px');
        }
        var u = navigator.userAgent;
        if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
            $('.bbs-cv-info,.operate_box,.content_zan,.discuss,.content,.discuss,.award,.discuss_ulA li,.discuss_ul li,.html-data table caption,.html-data table tr td,.vote_box_tle,.activity_box table caption,.activity_box table tr td').css('border-width','1px');
        }
        var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
        if(width<360){
            var num= $('.award_font ul li').length;
            if(num>=6){
                $('.award_font ul li').last().css('display','none');
            }
        }

        var glNum=$('.operate ul li').length;

        switch(glNum)
        {
            case 1:
                $('.operate ul li').css('width','100%');
                break;
            case 2:
                $('.operate ul li').css('width','50%');
                break;
            case 3:
                $('.operate ul li').css('width','33%');
                break;
            case 4:
                $('.operate ul li').css('width','25%');
                break;
            case 5:
                $('.operate ul li').css('width','20%');
                break;
        }
    });

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

</script>

<script type="text/javascript" src="assets/js/h5_2.min.js?hash=<?php echo $_G['timestamp']; ?>"></script>
</body>


</html>
