<fh-function>
$config=json_decode(file_get_contents("conn/config.json"));

$page=$_GET["page"];
$tag=t($_GET["tag"]);

$url=gethttp().$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
function url($url,$key,$value){
  $url=str_replace("&".$key."=".str_replace("%3A",":",urlencode($value)),"",$url);
  return $url;
}

if($tag==""){
  $taginfo="";
}else{
  $taginfo=" and CONCAT(\" \",N_tag,\" \") like '% ".$tag." %'";
}

$M_id=intval($_GET["M_id"]);
if($page==""){
  $page=1;
}

if($M_id!=0){
  $M_info=" and N_mid=$M_id".$taginfo;
}else{
  $M_info=" and N_sh=1".$taginfo;
}

$sql="select * from sl_nsort where S_id=".$id;
  $result = mysqli_query($conn, $sql);
  $row = mysqli_fetch_assoc($result);
  if (mysqli_num_rows($result) > 0) {
    $S_sub=$row["S_sub"];
  }

if($id==0){
  $sql="select count(N_id) as N_count from sl_news where N_del=0 ".$M_ninfo."  $M_info order by N_top desc,N_order,N_id desc";
}else{
  if($S_sub==0){
    $sql="select count(N_id) as N_count from sl_news,sl_nsort where S_del=0 $M_info and N_del=0 ".$M_ninfo."  and N_sort=S_id and S_sub=".$id." order by N_top desc,N_order,N_id desc";
  }else{
    $sql="select count(N_id) as N_count from sl_news,sl_nsort where S_del=0 $M_info and N_del=0 ".$M_ninfo."  and N_sort=S_id and S_id=".$id." order by N_top desc,N_order,N_id desc";
  }
}

$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$N_count=$row["N_count"];

$page_num=intval($N_count/16)+1;
if($N_count%16 ==0){
  $page_num=$page_num-1;
}

</fh-function>
<!DOCTYPE HTML>
<html><head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<meta name="apple-mobile-web-app-title" content="Modown">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<title>[S_title] - [fh_title]</title>
		<link href="media/[fh_ico]" rel="shortcut icon" />
		<meta name="description" content="[S_content]" />
		<meta name="keywords" content="[S_keywords]" />
		<link rel="stylesheet" href="template/t16/assets/web/styles/libs.css?1638004846">
		<link rel="stylesheet" href="template/t16/assets/web/styles/style.css?1638004846">
		<link rel="stylesheet" href="template/t16/assets/web/fonts/css/fontawesome-all.min.css">
		<link rel="stylesheet" href="template/t16/assets/styles/swiper.min.css">
		<link href="css/Pager.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="template/t16/assets/scripts/jquery.min.js"></script>
		<script type="text/javascript" src="template/t16/assets/scripts/swiper.min.js"></script>
		<script type="text/javascript" src="template/t16/assets/scripts/layer.js"></script>
		<link rel="stylesheet" href="template/t16/assets/scripts/theme/default/layer.css?v=3.3.0" id="layuicss-layer">
		<script type="text/javascript" src="template/t16/assets/scripts/bjplus.js"></script>
		<script type="text/javascript" src="template/t16/assets/scripts/tmodjs.js"></script>
		<script type="text/javascript" src="template/t16/assets/scripts/clipboard.min.js"></script>	
	</head>
<body>	
[fh_header]
<div class="single">
   <div class="main">
	    <div class="container clearfix" style="min-height: calc(100vh - 399px);">
		    <div class="breadcrumbs">当前位置：<span><a href="./"><span>首页</span></a></span> 
			    <span class="sep"><i class="fa fa-angle-right"></i></span> 
				<span><a href=""> <span>[S_title]</span></a></span> 
			</div>
		    <div class="content-wrap">
			    <div class="content">
				    <div class="single-related">
					<h3 class="related-title"><i class="icon icon-related"></i> [S_title]</h3>
										<div class="filters">
			          	<div class="filter-item">
                            <div class="filter">


                            	<fh-function>
  $sql="select * from sl_nsort where S_sub=0 and S_del=0 order by S_id desc";
        s[[
        if($id==$row["S_id"] || getrs("select * from sl_nsort where S_id=$id","S_sub")==$row["S_id"]){
        $class="active";
    }else{
    $class="";
}

        $api=$api."<a href=\"?type=news&id=".$row["S_id"]."\" class=\"".$class."\" data-type=\"".$row["S_id"]."\">".$row["S_title"]."</a>";


        ]]
        </fh-function>


															</div>
                        </div>
                    </div>
								                <div class="lists cols-two relateds clearfix" id="container">
        <fh-function>
if($id==0){
  $sql="select * from sl_news,sl_nsort where S_del=0 and N_del=0 ".$pa.$M_ninfo."  and N_sort=S_id ".shuxing("N_shuxing")." $M_info $order limit ".(($page-1)*16).",16";
}else{
  if($S_sub==0){
    $sql="select * from sl_news,sl_nsort where S_del=0 ".shuxing("N_shuxing")." $M_info and N_del=0 ".$pa.$M_ninfo."  and N_sort=S_id and S_sub=".$id." $order limit ".(($page-1)*16).",16";
  }else{
    $sql="select * from sl_news,sl_nsort where S_del=0 ".shuxing("N_shuxing")." $M_info and N_del=0 ".$pa.$M_ninfo."  and N_sort=S_id and S_id=".$id." $order limit ".(($page-1)*16).",16";
  }
}
                s[[
  if(strpos($row["N_content"],"[fh_free]")!==false || p($row["N_price"])==0){
    $intro=mb_substr(strip_tags(splitx($row["N_content"],"[fh_free]",0)),0,200,"utf-8");
  }else{
    $intro="内容加密";
  }

if($row['N_mid']==0){
  $author_pic=pic($C["C_ico"]);
}else{
  $author_pic=pic(getrs("select * from sl_member where M_id=".$row['N_mid'],"M_head"));
}

$sub_title=getrs("select * from sl_nsort where S_id=".$row["S_sub"]);
$api=$api."<div class=\"post grid\">
							<div class=\"img\">
							    <a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\">
									<img src=\"".pic($row["N_pic"])."\" class=\"thumb\" alt=\"".$row["N_title"]."\" style=\"width: 115px\">
								</a>
							</div>
							<div class=\"cat\"><a href=\"?type=news&id=".$row["S_id"]."\">".$row["S_title"]."</a> <a href=\"?type=news&id=".$sub_title["S_id"]."\">".$sub_title["S_title"]."</a></div>
							<h3><a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\">".$row["N_title"]."</a></h3>
							<p class=\"excerpt\" target=\"_blank\">".$row["N_title"]."</p>
							<div class=\"grid-meta\">
								<span class=\"time\"><i class=\"icon icon-time\"></i> ".date("Y-m-d",strtotime($row["N_date"]))."</span>
								<span class=\"views\"><i class=\"icon icon-eye\"></i> ".$row["N_view"]."</span>
								<span class=\"comments\"><i class=\"icon icon-posts\"></i> ￥".p($row["N_price"])."</span>
							</div>
						</div>";
]]

        </fh-function>


		</div>

								
				    </div>
				    <div id="pager"></div>
			    </div>
		    </div>
		
		<aside class="sidebar">
			<div class="theiaStickySidebar">
				<div class="widget widget-postlist">
					    <h3><i class="icon icon-posts"></i> 最新发布</h3>
					    <ul class="clearfix hasimg">


					    	    <fh-function>
      $i=1;
 $sql="select * from sl_news,sl_nsort where S_id=N_sort and S_del=0 and N_del=0 ".$M_ninfo."  order by N_date desc limit 8";
          s[[


      $api=$api."<li onclick=\"location.href='?type=newsinfo&id=".$row["N_id"]."'\">
							<a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\" class=\"img\">
								<img src=\"".pic($row["N_pic"])."\" class=\"thumb\" alt=\"".$row["N_title"]."\">
							</a>
							<h4><a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\">".$row["N_title"]."</a></h4>
							<p class=\"meta\">
								<span class=\"time\"><i class=\"icon icon-time\"></i> ".date("Y-m-d",strtotime($row["N_date"]))."</span> 
								<span class=\"views\"><i class=\"icon icon-eye\"></i> ".$row["N_view"]."</span> 
								<span class=\"comments\"><i class=\"icon icon-posts\"></i> ￥".p($row["N_price"])."</span>
							</p>
						</li>";


     $i=$i+1;
     ]]
</fh-function>



					    					   
					    	
		                </ul>
		            </div>
				
				<div class="widget widget-postlist">
					    <h3><i class="icon icon-posts"></i> 最多浏览</h3>
					    <ul class="clearfix hasimg">


					    	    <fh-function>
      $i=1;
 $sql="select * from sl_news,sl_nsort where S_id=N_sort and S_del=0 and N_del=0 ".$M_ninfo."  order by N_view desc limit 8";
          s[[


      $api=$api."<li onclick=\"location.href='?type=newsinfo&id=".$row["N_id"]."'\">
							<a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\" class=\"img\">
								<img src=\"".pic($row["N_pic"])."\" class=\"thumb\" alt=\"".$row["N_title"]."\">
							</a>
							<h4><a href=\"?type=newsinfo&id=".$row["N_id"]."\" target=\"_blank\" title=\"".$row["N_title"]."\">".$row["N_title"]."</a></h4>
							<p class=\"meta\">
								<span class=\"time\"><i class=\"icon icon-time\"></i> ".date("Y-m-d",strtotime($row["N_date"]))."</span> 
								<span class=\"views\"><i class=\"icon icon-eye\"></i> ".$row["N_view"]."</span> 
								<span class=\"comments\"><i class=\"icon icon-posts\"></i> ￥".p($row["N_price"])."</span>
							</p>
						</li>";


     $i=$i+1;
     ]]
</fh-function>



					    					   
					    	
		                </ul>

		            </div>
			</div>
		</aside>
	</div>
</div>
</div>		

<script id="tpl_empty" type="text/html">
    <div class="infoimg">
	    <img src="template/t16/assets//img/nodata.png">
	</div>
</script>
<script language="javascript">
    var page = 1;
    var scrolled = false;
    var current_type = "4006";
    function bindScroller(){
        var loaded = false;
        var stop = true;  
        $(window).scroll(function () {
            if (loaded) {
                return;
            }
            totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
            if ($(document).height() <= totalheight) {
                if (stop == true) {
                    stop = false; scrolled = true;
                    $('#container').append('<div id="credit_loading"><i class="fa fa-spinner fa-spin"></i> 正在加载...</div>');
                    page++;
                    core_json("/index.php?mod=mobile&act=category&do=article&op=category&m=eshop&beid=10", {id:current_type,page: page}, function (morejson) {
                        stop = true;
                        $('#credit_loading').remove();
                        $("#container").append(tpl('tpl_log', morejson.result));
                        if (morejson.result.list.length < morejson.result.pagesize) {
                            $("#container").append('<div id="credit_loading">已经加载完全部记录</div>');
                            loaded = true;
                            $(window).scroll = null;
                            return;
                        }
                    }, true);
                }
            }
        });
    }
    function getLog(type) {
        core_json("/index.php?mod=mobile&act=category&do=article&op=category&m=eshop&beid=10", {id:type,page: page}, function (json) {
            if (json.result.list.length <= 0) {
                $('#container').html(tpl('tpl_empty'));
                return;
            }
            $('#container').html(tpl('tpl_log', json.result));
            bindScroller();
        }, true);
    }
    $('.filter a').unbind('click').click(function () {
		 var $currItem = $(this),
	    index = $currItem.index();
	    $currItem.addClass('active').siblings().removeClass('active');	
        page = 1; current_type = $(this).data('type')
        getLog(current_type);
    });	
    getLog(current_type);
</script>
<script src="js/jquery.pager.js" type="text/javascript"></script>
<script>
$(".scms-pic").attr("style","float: none;display:inline-block;vertical-align:top;");
$(document).ready(function() {
    $("#pager").pager({ pagenumber: <fh-function> $api=$api.$page;</fh-function>, pagecount: <fh-function> $api=$api.$page_num;</fh-function>, buttonClickCallback: PageClick });
});

PageClick = function(pageclickednumber) {
  window.location="<fh-function>$api=$api.url($url,"page",$_GET["page"]);</fh-function>&page="+pageclickednumber;
}
</script>
[fh_footer]
</body></html>