<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="inc/conn.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<%=jianbook.sysinfo("keyword")%>" />
<meta name="description" content="<%=jianbook.sysinfo("dsc")%>" />
<title><%if request("lm")<>"" then response.Write request("lm")&"-" end if%><%=jianbook.sysinfo("title")%></title>
<link href="ui/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link href="ui/images/main.css" rel="stylesheet" type="text/css" />
<link href="ui/skin/<%=jianbook.css%>.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 9]> <script type="text/javascript" src="ui/browser.js"></script><![endif]-->

</head>


<body>


<%
'''jianbook 
''' ==================================================================
''' 版权所有 http://www.9416.cn
''' ------------------------------------------------------------------
''' 此程序为免费开源版，个人可免费自由使用，不得作为商业用途，不可以修改再次发布！
''' ------------------------------------------------------------------
''' 个人使用需要保留版权，如需去除版权请联系作者购买。
''' ==================================================================
%>


<!--#include file="head.asp"-->

<%

if request.Cookies("admin")("login")="true" then
my_id=0
elseif request.Cookies("user")("login")="true" then
my_id=request.Cookies("user")("id")
end if

set rs=conn.execute ("select count(*) as tnum from comment where isread=0 and class=2 and name='"&my_id&"'")
if rs("tnum")>0 then
snum="<span>"&rs("tnum")&"</span>"
end if
rs.close

%>

<div class="main">
<%sql2="select * from comment where slide =1 and pic<>''"
  if request("lm")<>"" then
sql1=sql1&" and lm='"&request("lm")&"'"
end if
sql=sql2&sql1&" order by id desc"
rs.open sql,conn,1,1
if not rs.eof then%>
<div class="layui-carousel" id="banner" >
  <div carousel-item>
  <%
do while not rs.eof 
 mpic=split(rs("pic"),",")
%>
    <div><a href="show.asp?id=<%=rs("id")%>"><img src=<%=mpic(0)%> width="100%"></a></div>
   <%rs.movenext
   loop
   %>
  </div>
</div>
<%end if
   rs.close%>
<div class="layui-row layui-col-space10">
<div class="layui-col-md9">

<%if jianbook.sysinfo("guest")=1 or request.Cookies("user")("login")="true" or request.Cookies("admin")("login")="true"  then%>
<div class="main_top"> 
<div class="label">
<a href="?lm=<%=request("lm")%>&order=default" <%if request("order")="default" then%> class="lactive"<%end if%>><i class="layui-icon layui-icon-ok"></i>默认</a>
<a href="?lm=<%=request("lm")%>&order=new" <%if request("order")="new" then%> class="lactive"<%end if%>><i class="layui-icon layui-icon-log"></i>最新</a>

<a href="?lm=<%=request("lm")%>&order=zan" <%if request("order")="zan" then%> class="lactive"<%end if%>><i class="layui-icon layui-icon-praise"></i>最赞</a>
<a href="?lm=<%=request("lm")%>&order=hot" <%if request("order")="hot" then%> class="lactive"<%end if%>><i class="layui-icon layui-icon-fire"></i>最热</a>
<a href="message.asp?type=receive" <%if request("type")="receive" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我的消息<%=snum%></a>
<a href="message.asp?type=send" <%if request("type")="send" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我发的私信</a>

<a href="index.asp?order=my" <%if request("order")="my" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我发的帖子</a>
</div>

</div>

<%
if request("order")="my" and request.Cookies("user")("login")="" and request.Cookies("admin")("login")="" then 
%>
<div class="guset_mes">
您需要登录后才可以查看，
请先<a href="#" onclick="user_login()">登录</a>

</div>
<%
else
%>

<div class="comment">


<div class="c_list list-loop" >

<%




if request("order")="my" then
my_mid="01,"
sql="select * from comment where uid='"&my_id&"' and class in (0,1)"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof 
my_mid=my_mid&rs("upid")&","

rs.movenext
loop
end if
rs.close
my_mid=left(my_mid,len(my_mid)-1)


end if

rquest_lm=jianbook.enhtml(request.QueryString("lm"))
rquest_ip=jianbook.enhtml(request("ip"))
rquest_uid=jianbook.enhtml(request("uid"))
rquest_key=jianbook.enhtml(request("key"))
sql="select * from comment where upid=0 and class in (0,1)"
if jianbook.sysinfo("audit")=1 and request.Cookies("admin")("login")=""  then
sql1=sql1&" and zt=1"
end if
if request("lm")<>"" then
sql1=sql1&" and lm='"&rquest_lm&"'"
end if
if request("ip")<>"" then
sql1=sql1&" and ip='"&rquest_ip&"'"
end if
if request("utype")=1 then
sql1=sql1&" and type=1"
end if
if request("uid")<>"" then
sql1=sql1&" and uid='"&rquest_uid&"'"
end if

if request("order")="my" then
sql1=sql1&" and uid='"&my_id&"'"
end if
if request("key")<>"" then
sql1=sql1&" and content like '%"&rquest_key&"%'"
end if
sql2=" order by ontop desc,replytime desc,id desc"
if request("order")="new" then
sql2=" order by id desc"
end if
if request("order")="zan" then
sql2=" order by zan desc"
end if
if request("order")="hot" then
sql2=" order by reply desc"
end if
mysql=sql&sql1&sql2
'response.Write mysql
rs.open mysql,conn,1,3

if not rs.eof then
dim currentpage,page_count,Pcount 
dim totalrec,endpage 
if request("page")="" then 
currentPage=1 
else 
currentPage=cint(request("page")) 
end if 
perpage=10
rs.PageSize = perpage 
rs.AbsolutePage=currentpage 
page_count=0 
totalrec=rs.recordcount 
lou=0
while (not rs.eof) and (not page_count = rs.PageSize) 

select case rs("uid")
case "-1"
art_title=rs("name")
case "0"
art_title="admin"

case else
sql="select * from [user] where id="&rs("uid")
set rs2=conn.execute(sql)
if not rs2.eof then
art_title=rs2("username")
end if
rs2.close

end select

%><div class="c_show loop">


<div class="details-avatar">
<%jianbook.user_tx rs("uid"),rs("ip")%>
        </div>
<div class="comment_list" >
<ul><li>  
 
    
       <h1> <a href="show.asp?id=<%=rs("id")%>"><%=art_title%> </a></h1>
   
    
	<%if rs("ontop")=1 then%><div class="iconfont icon-fire ontop"></div><%end if%>
   
     <h2><%=jianbook.utype(rs("type"))%>&nbsp;|&nbsp;<%if rs("ip")<>"" then response.Write look_ip(rs("ip"))&" | " end if%>  <%=jianbook.formatdate(rs("intime"))%> </h2></li>
   <% if rs("class")=1 then%> 
    <li >   <article ><a href="show.asp?id=<%=rs("id")%>"><%=rs("name")%><b  class="more"> 「 详情 」</b></a>
      <%if rs("zt")=0 and jianbook.sysinfo("audit")=1 then%>
     <div class="noaudit">未审核</div>
     <%end if%>
   </article>
    
      </li>
   
   <%else%>
    <li > <article ><a href="show.asp?id=<%=rs("id")%>"><%=jianbook.enhtml(rs("content"))%> </a>
      <%if rs("zt")=0 and jianbook.sysinfo("audit")=1 then%>
     <div class="noaudit">未审核</div>
     
     <%end if%>
   
     </article>
     
     <%if rs("pic")<>"" then%>
     <div  class="c_pic">
     <%
	  mpic=split(rs("pic"),",")
	  for pi=0 to ubound(mpic)
	  %>
 <a href="<%=mpic(pi)%>"  ><img src="<%=mpic(pi)%>" /></a>
    <%
	next%>
    </div>
<%end if%>
      </li>
      <%end if%>
       
        
 <%
 
 rsql="select * from [comment] where upid="&rs("id")&""

 sql=rsql&rsql1&" order by id desc"
rs1.open Sql,conn,3,1
	if not rs1.eof then
	i=0%>
    <div class="readmore">
	 <div class="reply_div ">  
 <%do while not rs1.eof
select case rs1("uid")
case "-1"
com_author=rs1("name")
case "0"
com_author="admin"

case else
sql="select * from [user] where id="&rs1("uid")
set rs2=conn.execute(sql)
if not rs2.eof then
com_author=rs2("username")
end if
rs2.close
end select


if rs1("class")=2 then
select case rs1("name")
case "0"
reply_author="admin"
case else
sql="select * from [user] where id="&rs1("name")
set rs2=conn.execute(sql)
if not rs2.eof then
reply_author=rs2("username")
end if
rs2.close

end select

com_title=com_author&"<b>回复</b>"&reply_author
else
com_title=com_author
end if
	   
	i=i+1%>
      <div class="reply_list">
      <ul>
      <li><h1 class="tips" tips="回复" onclick="tc('回复【<%=com_author%>】','lib/message.asp?upid=<%=rs("id")%>&class=2&send=<%=rs1("uid")%>',800,400)"><%=com_title%>  </h1><h2><%=jianbook.utype(rs1("type"))%> | <%if rs("ip")<>"" then response.Write look_ip(rs1("ip"))&" | " end if%><%=jianbook.formatdate(rs1("intime"))%></h2>
      <%if jianbook.isadmin() or request.Cookies("user")("id")=rs1("uid")  then%> 
      <!--<span class="iconfont icon-xiaoxizhongxin com-replay" ><b>回复</b></span> -->
      <span class="layui-icon layui-icon-delete" onclick="del_reply(this,<%=rs1("id")%>,<%=rs1("upid")%>)" ></span> <%end if%> </li>
    <li><article > <%=jianbook.enhtml(rs1("content"))%></article>
  
    
    </li>
   
      </ul>
      <div class="clear"></div>
        <%if i<>rs1.recordcount and rs1.recordcount>1 then %><div class="line"></div><%end if%>
      </div>
     
      <%rs1.movenext
	  loop%>
      </div>
      </div>
      <%
	   end if
	  rs1.close
	
	  %>
     </ul>
     <div class="clear"></div>
         
   <div class="c_tool"> <span class="layui-icon layui-icon-praise" onclick="zan(this,<%=rs("id")%>)"><b><%=rs("zan")%></b></span>

 <%if rs("noreply")=false then%>  
 <span class="layui-icon layui-icon-dialogue" onclick="tc('回复【<%=rs("name")%>】','lib/message.asp?upid=<%=rs("id")%>',800,400)"><b><%=rs("reply")%></b></span> 
 <%end if%>
 
    <span class="iconfont icon-erweima" onclick="qrcode(<%=rs("id")%>)"><b>分享</b></span>
<%if jianbook.isadmin() or request.Cookies("user")("id")=rs("uid") then%> 
<%if rs("class")=0	  then%> 
<span class="layui-icon layui-icon-edit tips" onclick="tc('编辑【<%=rs("name")%>】','lib/message.asp?id=<%=rs("id")%>',800,400)" tips="编辑文章"></span> 
<%else%>
<span class="layui-icon layui-icon-edit tips" onclick="pop_up('编辑【<%=rs("name")%>】','lib/article.asp?id=<%=rs("id")%>','95%','95%')" tips="编辑文章"></span> 
<%end if%>
<span class="layui-icon layui-icon-close tips" onclick="dell(this,<%=rs("id")%>)" tips="删除帖子"></span> 
<%end if%> 

<%if jianbook.isadmin()  then%> 
<%if rs("zt")=0 and jianbook.sysinfo("audit")=1 then%>
<span class="layui-icon layui-icon-ok tips" onclick="set('zt',1,<%=rs("id")%>,'审核通过？')" tips="审核通过"></span><%end if%>

<span class="layui-icon layui-icon-flag tips" onclick="set_attr(<%=rs("id")%>,[<%=rs("ontop")%>,<%=rs("isnice")%>,<%=rs("isnote")%>])" tips="设置属性"></span>

<%if rs("noreply")=False then%>
<span class="iconfont icon-jinzhipinglun tips" onclick="set('noreply',true,<%=rs("id")%>,'禁止评论？')" tips="禁止评论"></span>
<%else%>
<span class="iconfont icon-comments tips" onclick="set('noreply','false',<%=rs("id")%>,'恢复评论？')" tips="恢复评论"></span><%end if%>

<%if rs("slide")=1 then%>
<span class="iconfont icon-wrong tips" onclick="set('slide',0,<%=rs("id")%>,'取消幻灯片？')" tips="取消幻灯片"></span>
<%else%>
<span class="iconfont icon-success tips" onclick="set('slide',1,<%=rs("id")%>,'设置幻灯片？')" tips="设置幻灯片"></span><%end if%>

 

 <%end if%>

<%
 if rs("file")<>"" then
suffix=Mid(rs("file"), InstrRev(rs("file"), ".") + 1)

if instr("mp4,avi,MOV",suffix)>0 then

 %>

 <a href="javascript:void(0)" class="m-video" data-src="<%=rs("file")%>"><i class="iconfont icon-play-filling"></i> 观看 </a>




  <%else
 %>
  
    <%if jianbook.isadmin()  then%> 
 <a href="javascript:void(0)" class="c_file" onclick="set_file(<%=rs("id")%>,<%=rs("jf")%>)" ><i class="iconfont icon-fujian1"></i> 设置下载积分</a>
 <%else%>

 <a href="javascript:void(0)" class="c_file" onclick="down_file(<%=rs("id")%>)"><i class="iconfont icon-fujian1"></i> 附件下载

 </a> <%if rs("jf")>0 then response.Write "(需"&rs("jf")&"积分)" end if%>
    <%end if%>
 <%end if
 end if
 %>

<%if rs("lm")<>"" then%><em class="lmtype"><a href="?lm=<%=rs("lm")%>"><i class=" layui-icon layui-icon-note"></i><%=rs("lm")%></a></em><%end if%> 
</div>
       </div></div>
<%page_count = page_count + 1 
rs.movenext 
lou=lou+1
wend
else%>
<div class="guset_mes">
没有信息
</div>

<%
end if
rs.close%>


</div>

<div class="pagemore">
 <%

 if totalrec>perpage then
dim ii,p,n 
if totalrec mod perpage=0 then 
n= totalrec \ perpage 
else 
n= totalrec \ perpage+1 
end if 

if currentPage=n then 
response.Write"<a href='' class=page_none></a>"
else
response.Write"<a href='?page="&currentPage +1&"&lm="&request("lm")&"&order="&request("order")&"&uid="&request("uid")&"' class='layui-btn layui-btn-primary' >查看更多</a>"
end if
end if

  %>
</div>

</div>
<%

end if
else%>
<div class="comment">
<div class="guset_mes">
您需要登录后才可以查看，
请先<a href="#" onclick="user_login()">登录</a>
</div>
</div>
<%end if%>


</div>
<div class="layui-col-md3 leftdiv">
<div class="" id="left">

<div class="layui-card" style="margin-top:10px">
<div class="layui-card-header">公告</div>
<div class="layui-card-body">
<ul class="right-list">
<%
sql="select top 1 * from comment where class=0 and isnote=1 order by intime desc"

rs.open sql,conn,1,1

if not rs.eof then
 %>

 <a href="show.asp?id=<%=rs("id")%>"><%=jianbook.enhtml(rs("content"))%> </a> 
<%

end if
rs.close


%>
</ul>
</div>

</div>


<div class="layui-card" style="margin-top:10px">
<div class="layui-card-header">推荐文章</div>
<div class="layui-card-body">
<ul class="right-list">
<%
sql="select top 10 * from comment where class=1 and isnice=1 "
if request("lm")<>"" then
sql1=sql1&" and lm='"&request("lm")&"'"
end if

msql=sql&sql1&" order by  intime desc "

rs.open msql,conn,1,1

if not rs.eof then

do while not rs.eof %>

<li> <a href="show.asp?id=<%=rs("id")%>"><%=rs("name")%> </a> </li>
<%

rs.movenext
loop
end if
rs.close


%>
</ul>
</div>

</div>






<div class="layui-card" style="margin-top:10px">
<div class="layui-card-header">友情链接</div>
<div class="layui-card-body">
<ul class="right-list">
 <%
Sql="select * from [type] where islink=1 order by  num asc,id desc"
rs1.open Sql,conn,3,3
	if not rs1.eof then
	do while not rs1.eof

navurl=rs1("url")
	
	
%>

<li><a href="<%=navurl%>" target='_blank'><%=rs1("title")%></a></li>
    

<%

rs1.movenext
loop
end if
rs1.close%>

</ul>
</div>

</div>




<!--<div class="layui-card" style="margin-top:10px">
<div class="layui-card-header">最新会员</div>
<div class="layui-card-body">
<ul >
 <%
'Sql="select top 6 * from [user] where del=0 order by id desc"
'rs1.open Sql,conn,3,3
	'if not rs1.eof then
	'do while not rs1.eof

'if isnull(rs1("pic")) then
'author_tx="<img src='ui/images/user_01.jpg' /></a>"
'else
'author_tx="<img src='"&rs1("pic")&"' /></a>"
'end if

%>

<li class="user-list"><div class="user-pic"><%'=author_tx%></div> <div class="user-right"><h1><%'=rs1("username")%> </h1><p><%'=rs1("intime")%> </p></div></li>
    

<%

'rs1.movenext
'loop
'end if
'rs1.close%>

</ul>
</div>

</div>-->





</div>
</div>

</div>


<div class="foot">© <%=year(now())%>　<%=jianbook.cor%></div>



<script type="text/javascript" src="ui/jquery.js"></script>
<script type="text/javascript" src="ui/layui/layui.js"></script>

<script type="text/javascript" src="ui/jq.js"></script>

<script type="text/javascript" src="ui/qrcode.min.js"></script>


      
<script type="text/javascript" src="ui/pc.js?11"></script>

<script>



$(function(){



$(window).bind("scroll",function(){
	var h1=$(".leftdiv").offset().top
	var w1=$(".leftdiv").width()

	var s1=$(document).scrollTop()
	if (s1>=h1){
		console.log(1)
	$("#left").css("position","fixed")
	$("#left").css("width",w1)
	$("#left").css("top",60)
	}else
	{
	$("#left").css("position","")
		}
console.log(h1,s1,w1)
	
	})

})
</script>
<%

jianbook.jcount(1)
%>

</body>
</html>
