<?php
    include_once($_SERVER['DOCUMENT_ROOT'].'/mocuz/mobile_config.php');
    // include_once($mocuz.'config.php');
?>
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>帖子详情</title>
    <link rel="stylesheet" type="text/css" href="<?php echo asset_url('h5/css/style_3.css') ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo asset_url('h5/css/activity.css') ?>">
    <script type="text/javascript" src="<?php echo asset_url('js/jquery-1.9.1.min.js') ?>"></script>
</head>
<body>
<div class="mobile-wrap">
    <div class="bbs-cv-info">
        <a href="javascript:void(0);" class="user-hd">
            <img class="discuss_portrait" src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $uid;?>&size=small&random=<?php echo $timestamp;?>">
        </a>
        <div class="user-txt">
            <a href="javascript:void(0);" class="user-txt-name namecolor">
                <span><?php echo $username;?></span><?php echo $usergroup_level;?>
            </a>
            <p><?php echo $ctime_format?>&nbsp;&nbsp;来自<?php echo $platform_v;?>客户端</p>
        </div>
    </div>
    <div class="bbs-cv-main">
        <div class="bbs-cv-hd ">
            <p class="topic_text"><?php echo $content_style;?></p>
            <ul class="topic_img_list">
                <?php if (!empty($img_arr)):?>
                    <?php foreach ($img_arr as $value):?>
                        <li><img src="<?php echo $value['path'] . '.small.jpg';?>"></li>
                    <?php endforeach; endif;?>
            </ul>
        </div>
    </div>
    <div class="content_zan ">
        <div class="likea">
            <?php if ($is_liked) :?>
                <img src="<?php echo asset_url('h5/images/good.png')?>" alt="" >
            <?php else: ?>
                <img id="like_img" src="<?php echo asset_url('h5/images/good.png')?>" alt="" >
            <?php endif;?>
            <p><?php echo $likecount;?></p>
        </div>
    </div>
    <div class="topic_zan_list">
        <p>点赞用户</p>
        <!-- 列表最多显示9个点赞用户头像、最后一个为“查看所有点赞用户”的图标 -->
        <ul id="ul_post_like" <?php if(!empty($like_users)) {echo 'class="topic_zan_more"';}?>>
            <?php if (!empty($like_users)):?>
                <?php foreach ($like_users as $value):?>
                    <li>
                        <img src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $value['uid'];?>&size=small&random=<?php echo $timestamp;?>">
                    </li>
                <?php endforeach;?>
                <?php endif;?>
        </ul>
    </div>

    <div class="bbs-feed-list discuss mb80">
        <div>
            <a href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/mocuzapp.php?tid=<?php echo $id;?>&is_share=1&type=topicbbsdetail" class="open_khdmore">
                <img src="<?php echo asset_url('h5/images/open_khdmore.png')?>" alt="">
                打开<?php echo $sitename;?>客户端，查看更多精彩内容
            </a>
        </div>
        <p class="discuss_type">最新评论</p>
        <?php if (!empty($comment['comment_list'])):?>
            <ul class="discuss_ulA" id="comment_ul">
                <?php foreach ($comment['comment_list'] as $key => $value):?>
                    <li>
                        <div class="discuss_box ">
                            <a  href="javascript:void(0);">
                                <img class="discuss_portrait"  src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $value['uid'];?>&size=small&random=<?php echo $timestamp;?>">
                            </a>
                            <div class="discuss_user">
                                <p class="user_name" href="javascript:void(0);"><?php echo $value['username'] . $value['usergroup_level'];?></p>
<!--                                <div class="admin_name_type admin_gl_w">版主</div>-->
                                <span class="discuss_span span_date"><?php echo $value['ctime_format'];?></span>
                            </div>
                            <div class="post-operation">
                                <span class="post-floor"><?php echo $key + 1;?>楼</span>
                                <!--                    <img src="images/more.png" class="discuss_more">-->
                            </div>

                            <div class="discuss_content"><?php echo $value['content_smily'];?></div>

                            <div class="discuss_bottom">
                                <div class="praise_reply pid_praise20682685">
                                    <?php if (isset($value['is_liked']) && $value['is_liked']):?>
                                        <img src="<?php echo asset_url('h5/images/zaned.png')?>" alt="">
                                        <span class="discuss_zan color_red"><?php echo $value['likecount'];?></span>
                                    <?php else:?>
                                        <img src="<?php echo asset_url('h5/images/zan.png')?>" alt="">
                                        <span class="discuss_zan"><?php echo $value['likecount'];?></span>
                                    <?php endif;?>
                                </div>
                                <div class="praise_reply">
                                    <img src="<?php echo asset_url('h5/images/reply.png')?>">
                                    <span class="discuss_zan">回复</span>
                                </div>
                            </div>
                        </div>
                    </li>
                <?php endforeach;?>
            </ul>
        <?php endif;?>
    </div>
</div>
<!-- 底部悬浮条 下载客户端 -->
<div class="share_load">
    <div class="load_logo">
        <img src="<?php echo '../3.0/assets/images/icon.png';?>" alt="">
    </div>
    <div class="load_text">
        <p class="note_text_head ">更多精彩</p>
        <p class="note_text_btm">尽在<?php echo $sitename;?>客户端</p>
    </div>
    <div class="load_btn">
        <a class="btn_clk" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/mocuzapp.php?tid=<?php echo $id;?>&is_share=1&type=topicbbsdetail">立即下载</a>
    </div>
    <div class="load_close">
        <img src="<?php echo asset_url('h5/images/close.png')?>" alt="">
    </div>
</div>
</body>
<script type="text/javascript" src="<?php echo asset_url('h5/js/jquery.lazyload.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo asset_url('h5/js/fastclick.js') ?>"></script>
<!--<script type="text/javascript" src="--><?php //echo asset_url('h5/js/iscroll.js') ?><!--"></script>-->
<script type="text/javascript">
    // 浏览器类型检测代码
    var MocuzMobile = {
        Android: function() {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function() {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function() {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function() {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function() {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };

    $(function(){
        new FastClick(document.body);
        $(".img_detail").lazyload();

    })
</script>
<script type="text/javascript">
    $(document).ready(function(){
        var ua = navigator.userAgent.toLowerCase();
        var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
        if (/iphone|ipad|ipod/.test(ua)) {
            if(height>504){
                $('.bbs-cv-info,.operate_box,.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,.topic_zan_list').css('border-width','0.8px');
            }
        }


        function topic_img(){
            var index=$('.topic_img_list li').length;
            if(index==1){
                $('.topic_img_list').addClass('topic_img_one');
            }else if(index==2){
                $('.topic_img_list').addClass('topic_img_two');
                var width=$('.topic_img_list li').width();
                $('.topic_img_list li').css({
                    'height':width,
                })
            }else{
                var width=$('.topic_img_list li').width();
                var mr=$('.topic_img_list li:first').css('margin-right');
                $('.topic_img_list li').css({
                    'height':width,
                    'margin-bottom':mr
                })
            }


        }
        topic_img();
        window.onresize=function(){
            topic_img();
        }

    });
</script>
</html>