<?php

require_once 'includes/Mcrypt3Des.php';
$postarr = array();

foreach($postlist as $key => $post) {
    if($post['first']) {
        $post['message'] = odz_format_message($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;
        unset($postlist[$key]);
        break;
    }
}

?>

<!DOCTYPE html>
<html class="h5-support">
<head lang="zh-cn">
    <meta charset="<?php echo CHARSET ?>">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
	<script>
	    var MocuzMobile = {
        Android: function() {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function() {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function() {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function() {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function() {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };
	</script>
    <script type="text/javascript" src="assets/js/commondz.js"></script>

    <link type="text/css" rel="Stylesheet" href="assets/css/share_pages.css?1440048521"/>
    <script type="text/javascript" src='assets/js/jquery.lazyload.min.js?_=20150929164733'></script>
        <script type="text/javascript">
            $(function() {
                $(".img_detail").lazyload();  
            });
        </script>
</head>

<body style="padding-top: 0px;">
<img src="assets/images/weixindwn.png" style="width:100%;display: block;margin-bottom: -1px;">
<main style="padding-top: 0px;">
    <header>
        <meta-list>
            <meta-copyright><?php echo odz_lang('share_tips_3');?></meta-copyright>
            <meta-data><?php echo $postarr['dateline'];?></meta-data>
            <meta-data><a href="<?php echo $_G['mocuz_config']['app_url']; ?>" style="vertical-align: text-bottom;
"><?php echo $_G['setting']['bbname'];?></a></meta-data>
            <meta-data><?php echo $postarr['author'];?></meta-data>
        </meta-list>
        <thumb>
            <!--<img src="assets/images/1.jpg"/>-->
        </thumb>
    </header>

    <?php if ($threadsort && $threadsortshow && $threadsortshow['optionlist'] && $threadsortshow['optionlist'] != 'expire') {?>
        <div class="html-data " style="margin-bottom: 14px;">
            <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 echo $option['value'] !== '' ? $option['value'].' '.$option['unit'] : '-'; ?>
                            </td>
                        </tr>
                    <?php } ?>
                <?php } ?>
                </tbody>
            </table>
        </div>
    <?php } ?>


    <article>
        <?php echo $postarr['message'];?>
    </article>


    <footer>
        <a class="view-source" href="javascript:"></a>
        <span class="article-meta"><?php echo odz_lang('share_tips_4');?>&nbsp;<?php echo $_G['forum_thread']['views']; ?></span>
        <span class="article-meta meta-praise"><?php echo odz_lang('share_tips_5');?>&nbsp;<?php echo $_G['forum_thread']['replies']; ?></span>
        <a class="report-article" href="javascript:"><?php echo odz_lang('share_tips_6');?></a>
    </footer>
</main>
<comments>

    <aside><a href="<?php echo $_G['mocuz_config']['app_url']; ?>"><?php echo odz_lang('share_tips_8');?></a></aside>
    <thumb><a href="<?php echo $_G['mocuz_config']['app_url']; ?>"><img src="<?php echo $_G['mocuz_config']['app_ad']."?hash=".rand(0,10000);?>"></a></thumb>

    <div class="comments-header">
        <h4><?php echo odz_lang('share_tips_7');?></h4>
    </div>
   <div id="comments">

        <ul>
            <?php foreach($postlist as $post):?>
            <?php
            // 匿名发帖用户使用默认头像
            if(empty($post['authorid']) || $post['anonymous'] == 1) {
                $post['avatar'] = "<img src=".$_G['baseurl']."uc_server/images/noavatar_small.gif>";
                $post['author'] = odz_lang('anonymous');
            }
         
            ?>
            <li class="item-view" pid="">
                <div class="hd">
                    <a href="javascript:void(0);" class="user-hd"><?php echo $post['avatar']; ?></a>
                    <div class="hd-name">
                        <a href="javascript:void(0);" class="user-txt-name"><?php echo $post['author']; ?><?php echo $post['authortitle'] ? "[$post[authortitle]]" : ''; ?></a>
                        <p class="hd-time"><?php echo $post['dateline']; ?></p>
                        <div class="hd-time hd-s"><?php echo $post['message']; ?></div>
                    </div>
                </div>
            </li>
            <?php endforeach; ?>
        </ul>

   </div>

    <div style="text-align: center;clear:both;font-size: large"><a href="<?php echo $_G['mocuz_config']['app_url']; ?>"><?php echo odz_lang('share_tips_9');?></a></div><br/>        <!--<notice>以上评论由公众帐号筛选后显示</notice>-->
</comments>

</body>
</html>

<?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((document.body.clientHeight-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 realname = $('#realname').val() || '';
            var telephone = $('#telephone').val() || '';
            var mobile = $('#mobile').val() || '';
            var idcardtype = $('#idcardtype').val() || '';
            var idcard = $('#idcard').val() || '';
            var applynumber = $('#applynumber').val() || '';
            var message = $('#message').val() || '';
            var qq = $('#qq').val() || '';
            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&realname="+realname+"&telephone="+telephone+"&mobile="+mobile+"&qq="+qq+"&idcardtype="+idcardtype+"&idcard="+idcard+"&ishtml=1&applynumber="+applynumber+"&message="+message,
                data: params,
                dataType: "html",
                success: function(data){
                    // $('.eroll-show').hide();
                    $('.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">
    /*精华*/
    function essence_show(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.shade').show();
        $('.essence-box').show();
        var div=$('.essence-box');
        $('.essence-box').css('left',parseInt(($(window).width()-div.width())/2));
        $('.essence-box').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }
    $('.essence').click(function(){
        essence_show();
    });

    // 取消
    $('.eclance').click(function(event) {
        $('.essence-box').hide();
        $('.shade').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });
    //确定
    $('.econfirm').click(function(event) {
        alert("精华确定");
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });
    /*置顶*/
    function puttop_show(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.shade').show();
        $('.puttop-box').show();
        var div=$('.puttop-box');
        $('.puttop-box').css('left',parseInt(($(window).width()-div.width())/2));
        $('.puttop-box').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }

    $('.puttop').click(function(){
        puttop_show();
    });

    // 取消
    $('.tclance').click(function(event) {
        $('.puttop-box').hide();
        $('.shade').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });

    //确定
    $('.tconfirm').click(function(event) {
        alert("置顶确定");
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });

    /*checkbox投票*/
    var checknum = '<?php echo $maxchoices;?>'; // 最多可选几项
    checknum = parseInt(checknum);
    function votecheck(){
        var str = '';
        if($(".vote-check:checked").length <= checknum){
            // var chkVal = [];
            $(".vote-check:checked").each(function(){
                // chkVal.push($(this).val());
                str += "&pollanswers[]="+$(this).val();
            });
        }

        return str;
    }
    /*checkbox选中未选中*/
    $('.vote-check').click(function(event) {
        if($(".vote-check:checked").length ==checknum){
            $('.vote-check').not("input:checked").each(function(){
                $(this).attr('disabled',true);
            });
        }else{
            $('.vote-check').attr('disabled',false);
        }
    });
    // 跳转到投票列表
    $('#showpoll').click(function(){
        var auth = '<?php echo $_GET['auth']; ?>';
        auth = encodeURIComponent(auth);
        var url = '<?php echo $_G['siteurl'].'index.php?mod=forum_misc&action=viewvote&tid='.$_G['tid'] ?>';
        url = url+'&auth='+auth;
        if (MocuzMobile.Android()) {
            window.commonjs.tonextpage(url); //安卓刷新
            return;
        }
        location.href = url;
    })
    // 活动报名框
    function erollshow(){
        $('.shade').show();
        $('.eroll-show').show();
        var div=$('.eroll-show');
        $('.eroll-show').css('left',parseInt(($(window).width()-div.width())/2));
        $('.eroll-show').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }
    // 点击报名
    $('.baoming').click(function() {
        erollshow();
    })
    //提交活动报名之后弹出层
    function subshow(html){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.subshade').show();
        $('.subdialog').show();
        $('.subdTop').text(html);
        var div=$('.subdialog');
        $('.subdialog').css('left',parseInt(($(window).width()-div.width())/2));
        $('.subdialog').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }

    //提交活动报名之后弹出层 关闭
    function sub_dBottom(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
        $('.subdialog').hide();
        $('.subshade').hide();

    }
    var href;
    // 提交活动报名信息
    $('.sub').click(function() {
        var auth = '<?php echo $_GET['auth']; ?>';
        var action = 'activityapplies';
        var fid = <?php echo $_G['fid']; ?>;
        var tid = <?php echo $_G['tid'] ?>;
        var pid = <?php echo $postarr['pid']; ?>;
        var realname = $('.realname').val() || '';
        var mobile = $('.mobile').val() || '';
        var qq = $('.qq').val() || '';
        var message = $('.remarks').val() || '';
        var payvalue = "";
        var payment = 0;
        var activitysubmit = 1;
        auth = encodeURIComponent(auth);
        href = location.href+'&auth='+auth;
        var action, activitysubmit = 0, activitycancel = 0;
        var errmsg = '提交成功';
        if ($('.realname').hasClass('must')) {
            if(realname == '') {
                subshow('请输入真实姓名');
                return;
            }
        }
        if ($('.mobile').hasClass('must')) {
            if(mobile == '') {
                subshow('请输入mobile');
                return;
            }
        }
        if ($('.qq').hasClass('must')) {
            if(qq == '') {
                subshow('请输入qq');
                return;
            }
        }
        if($('.payImg').attr('alt')=='1'){
            payment = 1
            payvalue = $('.pay').val();
        }
        action = 'activityapplies';
        if($(this).attr('data') == 'go') {
            activitysubmit = 1;
        } else if($(this).attr('data') == 'back') {
            activitycancel = 1;
        }
        <?php
            $arr = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'pid'=>$postarr['pid']);
            $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=forum_misc&payment="+payment+"&realname="+realname+"&mobile="+mobile+"&qq="+qq+"&message="+message+"&payvalue="+payvalue+"&ishtml=1&action="+action+"&activitysubmit="+activitysubmit+"&activitycancel="+activitycancel,
            data: params,
            dataType: "html",
            success: function(data){
                $('.eroll-show').hide();
                v_dialog(data);
            }
        });
    })
    // 投票提交
    function votepoll(pollid) {
        var pollid = parseInt(pollid);
        var auth = '<?php echo $_GET['auth']; ?>';
        var str = votecheck();
        if(!checknum) {
            str += '&pollanswers[]='+pollid;
        }
        auth = encodeURIComponent(auth);
        href = location.href+'&auth='+auth;
        <?php
            $arr = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'action'=>'votepoll');
            $params = json_encode($arr);
            $e = new Mcrypt3Des();
            $params = $e->encrypt($params);
        ?>
        var params = '<?php echo $params; ?>';
        $.ajax({
            type: "POST",
            url: "<?php echo $_G['siteurl'] ?>index.php?mod=forum_misc&ishtml=1"+str,
            data: params,
            dataType: "html",
            success: function(data){
                v_dialog(data);
            }
        });
    }
    // 投票成功后调用
    //显示弹窗
    function v_dialog(html){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.shade').show();
        $('.vdialog').show();
        $('.dTop').text(html);
        var div=$('.vdialog');
        $('.vdialog').css('left',parseInt(($(window).width()-div.width())/2));
        $('.vdialog').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }
    //关闭弹窗
    function v_dBottom(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
        $('.vdialog').hide();
        $('.shade').hide();
        if (MocuzMobile.Android()) {
            window.commonjs.tonextpage(href); //安卓刷新
            return;
        }
        location.href = href;
    }
    //取消
    $('.opera a').click(function(event) {
        $('.shade').hide();
        $('.eroll-show').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });
    //操作居中
    function op_center(){
        var liindex=$('.operation li').length;
        /*var lihidden=$(".operation li:hidden").length;*/
        var licount=liindex
        var op_w=$('.operation').width();
        $('.operation li').width(op_w/licount-1);

    }
    op_center();

    //弹出框
    $('.move_op').click(function(event) {
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.frame-box').show();
        $('.shade').show();
        var div=$('.frame-box');
        $('.frame-box').css('left',parseInt(($(window).width()-div.width())/2));
        $('.frame-box').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));

    });

    //切换选择
    $('.them').click(function(event) {
        $('.them').find('img').attr('data',"false");
        $('.them').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/nselect.png');
        $(this).find('img').attr('data',"true");
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });

    //下拉
    $('.frame-main select:first').change(function(event) {
        var options=$(".test option:selected");
        if(options.text()!='默认板块'){
            $('.select-them').show();
            $('.frame-main select').css('color','#454545');
        }else{
            $('.select-them').hide();
        }
    });
    $('.clance').click(function(event) {
        $('.frame-box').hide();
        $('.shade').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });

    //确定
    $('.confirm').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 action = 'moderate';
        var fid = <?php echo $_G['fid']; ?>;
        var moveto = $('select[name=moveto]').val();
        var threadtypeid = $('select[name=threadtypeid]').val();
        var moderate = <?php echo $_G['tid']; ?>;
        var operations = 'move';
        var type = $('.them1 img').attr('data') ? 'normal' : 'redirect';

        // 调用客户端移动帖子方法
        if (MocuzMobile.Android()) {
            window.myjs.executeMove(""+fid, ""+moderate, ""+moveto, ""+threadtypeid, ""+type);
            return;
        }
        if (MocuzMobile.iOS()) {
            var cmd = "executeMove";
            window.location.href="objc://"+cmd+":/"+action+"/"+fid+"/"+moderate+"/"+operations+"/"+moveto+"/"+threadtypeid+"/"+type;
        }
    });

    // 编辑帖子
    function editpost(pid) {
        var auth = "<?php echo $_GET['auth']; ?>",
            fid = <?php echo $_G['fid']; ?>,
            tid = <?php echo $_G['tid']; ?>,
            pid = pid;
        // alert($('.item-view').length);
        // 调用客户端编辑帖子方法
        if (MocuzMobile.Android()) {
            window.myjs.executeEdit(""+fid, ""+tid, ""+pid);
            return;
        }
        if (MocuzMobile.iOS()) {
            var cmd = "executeEdit";
            window.location.href="objc://"+cmd+":/"+fid+"/"+tid+"/"+pid;
        }
    }
    // 帖子删除  post删除帖子  topic 删除主题
    function deletepost(type, pid) {
        if(confirm("确认要删除吗？")) {
            if (type == 'post') {
                data = {auth:'<?php echo $_GET['auth']; ?>', action:'delpost', fid:<?php echo $_G['fid']; ?>, tid:<?php echo $_G['tid']; ?>, topiclist:pid};
                // alert(data.tid);
                //调用客户端删除帖子方法
                if (MocuzMobile.Android()) {
                    window.myjs.executeDelete(""+data.action, ""+data.fid, ""+data.tid, ""+data.topiclist);//android
                    return;
                }
                if (MocuzMobile.iOS()) {
                    var cmd = "executeDelete";
                    window.location.href="objc://"+cmd+":/"+data.action+"/"+data.fid+"/"+data.tid+"/"+data.topiclist;
                }
            } else if (type == 'topic') {
                data = {auth:'', action:'moderate', fid:<?php echo $_G['fid']; ?>, moderate:<?php echo $_G['tid']; ?>, operations:'delete'};
                // 调用客户端删除主题方法
                if (MocuzMobile.Android()) {
                    window.myjs.executeDelete(""+data.action, ""+data.fid, ""+data.moderate, ""+data.operations);//android
                    return;
                }
                if (MocuzMobile.iOS()) {
                    var cmd = "executeDelete";
                    window.location.href="objc://"+cmd+":/"+data.action+"/"+data.fid+"/"+data.moderate+"/"+data.operations;
                }
            } else {
                return;
            }
        }
    }

    // 帖子删除成功调用方法
    function afterdel(pid) {
        var item = document.getElementsByClassName('item-view');
        for(var i=0; i<item.length; i++) {
            tagid = item[i].getAttribute('pid');
            if (tagid == pid) {
                item[i].style.display = 'none';;
            }
        }
    }
    // 获取板块类型
    function getthreadtypes(fid) {
        if (!fid) {
            return;
        }
        $.ajax({
            type: "GET",
            url: "<?php echo $_G['baseurl']; ?>mocuz/index.php?mod=forum_ajax&action=getthreadtypes&fid="+fid,
            dataType: "html",
            success: function(data){
                $('#threadtypeid').html('');
                $('#threadtypeid').append(data);
                return;
            }
        });
    }
    // 投票
    //li居中
    function op_center1(){
        var op_w=$('.poll-list').width();
        $('.poll-list li').width(op_w/2-6);
    }
    op_center1();
    // 投票
    var param=0;                      //判断是否选择了一项
    $('.toupiao').click(function() {
        $(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/select.png');
        //记录已选择
        param=$(this).attr('data');
        obj=$(this);
        if ($(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/select.png')) {
            $('.toupiao').not(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/noselect.png')
        };
    });
    /*
     改变投票结果
     */
    $('.signtext').click(function(){
        votepoll(param);
    })
    // 投票后
    function hideVote(){
        $('.v-hide').css('visibility','hidden');
    }
    //活动报名切换选择
    $('.payable').click(function(event) {
        $('.payable').find('img').attr('alt',"0");
        $('.payable').find('img').attr('data',"false");
        $('.payable').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/noselect.png');
        $(this).find('img').attr('data',"true");
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('alt',"1");
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });

    //切换选择
    $('.poll-list p').click(function(event) {
        $('.poll-list p').find('img').attr('data',"false");
        $('.poll-list p').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/noselect.png');
        $(this).find('img').attr('data',"true");
        //记录已选择
        s_param=$(this).attr('data');
        //获取勾选的对象上上级(那个li)
        s_obj=$(this).prev().parent();
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });
    /*
     改变投票结果
     */
    $('.signimg').click(function(){
        votepoll(s_param);
    })
    var tagindex = 1;

    $(function() {
        //分享出去页面打开点击回复按钮进去下载引导页
        var wei_href="<?php echo $_G['baseurl']; ?>app.html#mp.weixin.qq.com"
        $('.report-advert').attr('href',wei_href);
        /*获取页面中img*/
        var  contentid = '<?php echo $_G['tid']?>';
        var data = {
            'tid'        : '<?php echo $_G['tid']?>'
        };


        //==============================
    })
    /**
     * 夜间模式切换
     * @param isNight 是否启用夜间模式
     */
    function switchNightMode(isNight) {
        var colorVal = '';
        if (isNight == 1) {
            $('.bbs-cv-hd .btm').css('border-bottom','1px solid #454545');
            $('.bbs-feed-list li').css('border-top','1px solid #454545');
            $('.quote').css('background-color','#A5A7AA');
            colorVal = '#2C2D32';
        } else {
            colorVal = '';
        }
        document.body.style.backgroundColor = colorVal;
    }

    //论坛举报客户端加载
    function report(){
        var pid="<?php echo $postarr['pid']?>";
        var fid="<?php echo $_G['fid']?>";
        if(MocuzMobile.Android()) {
            window.myjs.report(fid,pid);//android
            return;
        }
        if(MocuzMobile.iOS()) {
            window.location.href="objc://report:/"+fid+"/"+pid;
            return;
        }
    }
    //论坛h5客户端加载
    function testClick(cmd, pid, author){
        var tid = '<?php echo $_G['tid']?>';
        var author = author || "<?php echo $_G['forum_thread']['author']; ?>";
        if(MocuzMobile.Android()) {
            window.myjs.runJs(""+tid, ""+pid);//android
            return;
        }
        if(MocuzMobile.iOS()) {
            window.location.href="objc://"+cmd+":/"+tid+"/"+author+"/"+pid;
        }
    }

    function scrollParameter(){
        $(window).bind('scroll', AdapterObj.scrollEvent);
    };
    //回复跳转
    tagindex = 1;
  

    $("body").on("touchstart", function(e) {
        startX = e.originalEvent.changedTouches[0].pageX,
            startY = e.originalEvent.changedTouches[0].pageY;
    });
    $("body").on("touchmove", function(e) {
        moveEndX = e.originalEvent.changedTouches[0].pageX,
            moveEndY = e.originalEvent.changedTouches[0].pageY,
            X = moveEndX - startX,
            Y = moveEndY - startY;

        if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
            $('.backtop').show();
            if($("body").scrollTop()<=0){
                $('.backtop').hide();
            }

        }else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
            $('.backtop').hide();
        }

    });
    //返回顶部
    $('.backtop').click(function(event) {
        $('.backtop img').attr('src','assets/images/backtop2.png');
        $("html,body").animate({scrollTop:"0px"},300,function(){
            $('.backtop img').attr('src','assets/images/backtop.png');
            $('.backtop').hide();
        });
    });



    // 数据交互
    function jiaohu(cmd,str) {
        var client="<?php echo $_GET['client'];?>";
        var favid="<?php echo $postarr['favid'];?>";
        var sharelink="<?php echo urlencode($sharelink); ?>";
        var share_text="<?php echo odz_format_sharetext($sharetext); ?>";
        var sharesubject="<?php echo $_G['forum_thread']['subject']; ?>";
        if(favid){
            var status='1';
        }else{
            var status='0';
        }
        var cmd ='jiaohu';
        var str = '{"shoucang":'+status+', "shareSNS":{"sharelink":"'+sharelink+'", "sharetext":"'+share_text+'", "sharesubject":"'+sharesubject+'"}}';
//        var str = '{"shoucang":'+subject+'}';
        if(MocuzMobile.Android()&&client==1) {
            window.shareInfo.jiaohu(str);//android
            return;
        }
        if (MocuzMobile.iOS()&&client==1) {
            window.location.href="objc://"+cmd+":/"+str;
        }
    }
    window.onload = jiaohu();

    /*4个分享的宽度*/
    function sharew(){
        var su=$('.toshare ul').width();
        $('.toshare ul li').width(su/4-20);
    }
    sharew();


</script>