<?php
require_once 'includes/Mcrypt3Des.php';
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$weixin=strpos($user_agent, 'MicroMessenger');
$h5_page=$_G['ppp']-1;
$postarr = array();
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']);
        // $post['message'] =preg_replace("/<(\/?br.*?)>/si","",$message); //过滤br标签
        /*$post['message'] =preg_replace('/(<\/?br.*?>\s\D)+/i', '<br>', $message);*/ //过滤br标签
        $postarr = $post;
		//if(strpos($postarr['message'],'<br>')){
			//$postarr['message'] = str_replace('<br>','',$postarr['message']);
		//}
        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'];
function renderurl ($url, $params) {
        $html = '<div class="videoCon "><iframe';
        $html .= " src=\"{$url}\"";
        $html .= " quality=\"high\"";
        $html .= " width=\"{$params['width']}\"";
        $html .= " height=\"{$params['height']}\"";
        $html .= " align=\"middle\"";
        $html .= " frameborder=\"0\"";
        $html .= " allowScriptAccess=\"always\"";
        $html .= " allowFullScreen=\"true\"";
        $html .= " mode=\"transparent\"";
        $html .= " type=\"application/x-shockwave-flash\"";
        $html .= "></iframe></div>";
        return $html;
}

  
?>
<!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">
        <title><?php echo $_G['forum_thread']['subject']; ?></title>
        <link rel="stylesheet" type="text/css" href="assets/css/mods.css?hash=<?php echo rand(0,100000);?>">
        <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="assets/js/commondz.js?hash=12121212"></script>
        <link rel="stylesheet" type="text/css" href="assets/css/activity.css?ver=12121212121">
        <style type="text/css">
        /*视频播放器*/
        .videowrap { margin: 10px 0; }
        .videocontainer { border:1px solid #eaeaea; background-color:#f7f7f7; font-size: 12px; color:#666666; margin: 0 auto; height:203; width:300px; }
        .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: #f0f0f0; padding: 6px;font-size: 12px;color: #666666; border-radius: 5px;}
	.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: 14px;}
        .html-data table tr td{padding: 6px 5px 6px 5px !important;}
        .html-data table caption{background: #FAFAFA;padding: 6px 5px 6px 5px !important;font-weight: bold;text-align: left;border:1px solid #EEEEEE;}
        .html-data table tr td{border-bottom:1px solid #C2D5E3;padding: 6px 5px 6px 5px !important;}
        .html-data table tr td.textname{border-bottom:1px solid #EEEEEE;border-left:1px solid #EEEEEE;border-right:1px solid #EEEEEE;color:#B0B0B0;width: 26%}
        .html-data table tr td.textvalue{border-bottom:1px solid #EEEEEE;border-right:1px solid #EEEEEE;color:#6F6F6F;}
        .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}
        </style>
        <script type="text/javascript">
            var smiley_search = <?php echo make_smilie_json();?>;
        </script>
</head>
<body>
    <div class="shade"></div>
    <div class="subshade"></div>
    <div class="mobile-wrap" id="mobile-wrap">
        <div class="bbs-cv-hd">
            <h1><?php echo $_G['forum_thread']['subject']; ?></h1>
            <div class="btm">
                <span class="btm-type"><?php echo $_G['forum']['name']?></span>
                <span class="btm-ico btm-ico-reads"><?php echo $_G['forum_thread']['views']; ?></span>
            </div>               
        </div>
		
        <div class="bbs-cv-main">
            <div class="bbs-cv-info">
			<?php if($postarr['anonymous'] == 1 ||$_G['forum_thread']['authorid'] == ""):?>
                <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'] == ""):?>
                    <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']; ?></a>
				<?php endif;?>
				<?php if($postarr['anonymous'] == 1 ||$_G['forum_thread']['authorid'] == ""):?>
                    <p><?php echo ""; ?></p>
				<?php else:?>
					<p><?php echo $postarr['authortitle']; ?></p>
				<?php endif;?>
                </div>
                <div class="user-type">
                    <p><?php echo h5_showstars($_G['cache']['usergroups'][$postarr['groupid']]['stars']);?></p>
                    <span><?php echo $postarr['dateline']; ?></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">
                <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>
            <?php } ?>
            <!-- 表格信息END -->
            <div class="html-data hd-s ">
                <?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">
                        <!-- <p class="take-number" style="display:none;">已有37人参与。<a href="javascript:void(0);">查看报名名单</a></p> -->
                        <ul class="activity-list">
                            <li>
                                <span class="ac-adress"><?php echo lang('forum/template', 'activity_space'); ?></span>
                                <span class="content"><?php echo $activity['place']; ?></span>
                            </li>
                            <li>
                                <span class="ac-adress"><?php echo lang('forum/template', 'activity_starttime'); ?></span>
                                <span class="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"><?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"><?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">
                                    <?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"><?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"><?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"><?php echo $activity[expiration];?></span>
                                </li>
                            <?php } ?>
                        </ul>
                        <?php if($_G['uid'] && !$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){
                ?>
                <ul class="operation">
                    <?php if ($operation_edit) {?>
                    <li><a href="javascript:editpost(<?php echo $postarr[pid]; ?>);"><img src="assets/images/edit.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/delete.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/move.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/move.png" alt="">精华</a></li> -->
                        <li><a href="javascript:void(0);" class="essence"><img src="assets/images/essence.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/move.png" alt="">置顶</a></li> -->
                        <li><a href="javascript:void(0);" class="puttop"><img src="assets/images/top.png" alt=""><p>置顶</p></a></li>
                        <?php } ?>
                    <?php } ?>
                </ul>
                <?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 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>
        </div>
		<div class='linezyc'></div>
        <!-- bbs-cv-main -->
        <div class="bbs-feed-list">
            <div class="itm"><?php include './template/viewthread_reply.php';?></div>
            <div class="loading-con" style="text-align:center;display:none" id="replay_itm">
                    <img src="assets/images/loading.gif?hash=201503301552" >
                    <span class="loadtext">正在加载中...</span>
            </div>
        </div>  
        <div class="backtop">
            <img src="assets/images/backtop.png" alt="返回顶部" />
        </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') {
                        that.html('<div style="margin:2px 2px 0 2px;background-color:#dddddd;"><iframe height="199" width="296" frameborder="0" src="'+data.url+'" /></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 $_GET['auth']; ?>';
        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 = '<?php echo $_GET['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>
<?php } ?>
<script type="text/javascript" src="assets/js/h5_2.min.js?hash=<?php echo rand(0,100000);?>"></script>
</body>
</html>