<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/mocuz/mobile_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="topic_list_header">
        <div class="tl_header_bgIMG blur"></div>
        <div class="tl_header_box">
<!--            <div class="tl_hb_icon">
                <img src="<?php /*echo asset_url('h5/images/back.png')*/?>" alt="" class="tl_back">
                <img src="<?php /*echo asset_url('h5/images/share.png')*/?>" alt="" class="tl_share">
            </div>-->
            <div class="tl_hb_msg">
                <div class="tl_hdIMG">
                    <img src="<?php echo $listimg;?>" alt="">
                </div>
                <div class="tl_text">
                    <p class="tl_text_title">#&nbsp;<span><?php echo $title_conflict;?></span>&nbsp;#</p>
                    <div class="tl_text_num">
                        <div class="tl_num_box tl_pr">
                            <p><?php echo !empty($extracount) ? $extracount : $involcount;?></p>
                            <p>参与人数</p>
                        </div>
                        <div class="tl_num_box tl_ml">
                            <p><?php echo $piccount;?></p>
                            <p>照片</p>
                        </div>
                        <button onclick="openApp()">参与话题</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="topic_zan_list tl_zanList">
        <!-- 列表最多显示9个点赞用户头像、最后一个为“查看所有点赞用户”的图标 -->
        <?php if (!empty($part_uids)):?>
            <ul class="topic_zan_more">
                <?php foreach ($part_uids as $uid):?>
                    <li>
                        <img src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $uid;?>&size=small&random=<?php echo $timestamp;?>">
                    </li>
                <?php endforeach;?>
            </ul>
        <?php endif;?>
    </div>

    <div class="bbs-feed-list discuss mb80">
        <?php if (!empty($post_info)):?>
            <ul class="discuss_ulA topic_list_box">
                <?php foreach ($post_info as $value):?>
                    <li class="item-view">
                        <div class="discuss_box ">
                            <img class="discuss_portrait"  src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $value['uid'];?>&size=small&random=<?php echo $timestamp;?>">
                            <div class="discuss_user">
                                <p class="user_name" href="javascript:void(0);"><?php echo $value['username'];?></p>
                                <span class="discuss_span span_date topic_list_date"><?php echo $value['ctime_format']?></span>
                            </div>
                            <div class="discuss_content">
                                <p class="tl_til_text"><?php echo $value['content'];?></p>
                                <?php if (!empty($value['img_arr'])):?>
                                    <ul class="topic_img_list topic_list_ul">
                                        <?php foreach ($value['img_arr'] as $img):?>
                                            <li><img src="<?php echo $img['path'] . '.small.jpg';?>"></li>
                                        <?php endforeach;?>
                                    </ul>
                                <?php endif;?>
                            </div>
                        </div>
                    </li>
                <?php endforeach;?>
            </ul>
        <?php endif;?>
    </div>
</div>
<!--<div class="tl_btm_box">-->
<!--    <div class="tl_btm_close">×</div>-->
<!--    <div class="tl_btm_img">-->
<!--        <img src="--><?php //echo asset_url('h5/images/icon.png')?><!--" alt="">-->
<!--        <div class="tl_btm_img_text">-->
<!--            <p>下载淮水安澜APP</p>-->
<!--            <p>一起嗨翻天！</p>-->
<!--        </div>-->
<!--    </div>-->
<!--    <button onclick="openApp()">参与话题</button>-->
<!--</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">
    $(function(){
        new FastClick(document.body);
        $(".img_detail").lazyload();

        //替换顶部背景图
        $('.tl_header_bgIMG').css('background','url(<?php echo $listimg;?>) center no-repeat');
    })

</script>
<script type="text/javascript">
    $(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){
                $('.discuss,.discuss_ulA li,.discuss_ul li,.topic_zan_list,.tl_pr,.tl_btm_close').css('border-width','0.8px');
            }
        }
        $('.tl_btm_close').click(function(){
            $('.tl_btm_box').hide();
            $('.bbs-feed-list').removeClass('mb80');
        })

        function topic_img(){
            $('.topic_img_list').each(function(){
                var index=$(this).children().length;
                var mr=$(this).children().eq(0).css('margin-right');

                if(index==1){
                    $(this).addClass('topic_img_one');
                }else if(index==2){
                    $(this).addClass('topic_img_two');
                    var width=$(this).children().eq(0).width();
                    $(this).children().css({
                        'height':width
                    })
                }else{
                    var width=$(this).children().eq(0).width();
                    $(this).children().css({
                        'height':width,
                        'margin-bottom':mr
                    })
                }
            })
            $('.tl_hdIMG,.tl_text').css('height',$('.tl_hdIMG').width());
            var topicList_H=$('.tl_hb_icon img').width()+$('.tl_hb_msg').height()+25
            $('.topic_list_header').css('height',topicList_H+'px');
        }
        topic_img();
        window.onresize=function(){
            topic_img();
        }
    });

function openApp(){
    window.location.href='http://<?php echo $_SERVER['HTTP_HOST']; ?>/mocuzapp.php?tid=<?php echo $id;?>&is_share=1&type=topicdetail';
}
</script>

</html>