<!-- #include file="include/con_jswz.asp" -->
<%

dim id
id=trim(request.querystring("id"))
if not(isnumeric(id)) then
  call format_redirect("jswz.asp")
end if
%>
<!-- #include file="include/jk_review.asp" -->
<!-- #include file="include/jk_emoney.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_keyes.asp" -->
<%
dim username,topic,word,tim,counter,comto,author,cod,tt,power,emoney,a_keyes
sql="select top 1 * from jswz where hidden=1 and id="&id
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
  rs.close
  call format_redirect("jswz.asp")
end if
cid=rs("c_id")
sid=rs("s_id")
username=rs("username")
topic=rs("topic")
word=rs("word")
tim=rs("tim")
counter=rs("counter")
power=rs("power")
emoney=rs("emoney")
comto=rs("comto")
author=rs("author")
cod=rs("cod")
a_keyes=rs("keyes")
rs.close

cname="文章浏览"
sname=""
if cint(cid)>0 then
  if cint(sid)>0 then
    sql="select top 1 jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
  else
    sql="select top 1 c_name from jk_class where c_id="&cid
  end if
  set rs=joekoe_cms.exec(sql,1)
  if not(rs.eof) then
    cname=rs("c_name")
    if sid>0 then sname=rs("s_name")
    tit=cname&"（"&sname&"）"
  end if
  rs.close
end if

tit=cname
if sname<>"" then tit=tit&"（"&sname&"）"

page_power=power
call web_head(0,0,3,0,0)
call emoney_notes(power,emoney,n_sort,id,1,"jswz_list.asp?c_id="&cid&"&s_id="&sid)
call jswz_load(0,0,0)
%>

<table width="777" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="600" valign="top"><%
'----------------------------中间 开始----------------------------
if int(cod)=1 then word=code_jk(word)
tim=joekoe_cms.time_type(tim,1)
topic=joekoe_cms.code_html(topic,1,0)
comto=joekoe_cms.code_html(comto,1,0)

dim id1,topic1,id2,topic2
id1=0
topic1=""
id2=0
topic2=""
sql="select top 1 id,topic from jswz where hidden=1 and id<"&id&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
if not(rs.eof) then
  id1=rs(0)
  topic1=rs(1)
end if
rs.close
sql="select top 1 id,topic from jswz where hidden=1 and id>"&id&" order by id"
set rs=joekoe_cms.exec(sql,1)
if not(rs.eof) then
  id2=rs(0)
  topic2=rs(1)
end if
rs.close

response.write vbcrlf&jswz_view1(id,topic,joekoe_cms.time_type(tim,5),comto,author)
response.write "<font id=""font_word"" class=htd style=""font-size:14px; font-family:宋体, Verdana, Arial, Helvetica, sans-serif;"">"&word&"</font>"
response.write vbcrlf&jswz_view2(id,topic,counter,username,id1,topic1,id2,topic2)
i=1 
dim a_topic,a_id,temp2 
if var_null(a_keyes)<>"" then 
sql="select top 5 id,topic from jswz where hidden=1 and "&sql_key(a_keyes,"keyes",1,"or")&" and id<>"&id&" order by id desc" 
set rs=joekoe_cms.exec(sql,1) 
if rs.eof then  
temp2=temp2&vbcrlf&"<td><font class=gray>没有相关文章</font></td>" 
else  
do while not rs.eof 
a_topic=rs("topic") 
a_id=rs("id") 
temp2=temp2&vbcrlf&"<td width='50%' ><a href='jswz_view.asp?id="&a_id&"' title='"&joekoe_cms.code_html(a_topic,1,0)&"'>"&joekoe_cms.code_html(a_topic,1,50)&"</a></td>" 
if i=2 then 
temp2=temp2&vbcrlf&"</tr><tr>" 
i=0 
end if 
rs.movenext 
i=i+1 
loop 
rs.close 
end if 
else  
temp2=temp2&vbcrlf&"<td><font class=gray>没有相关文章</font></td>" 
end if
response.write vbcrlf&"<table cellspacing=0 cellpadding=1 class=table>" 
response.write vbcrlf&"<tr><td class=td>&nbsp;&nbsp;<b>→ 相关文章</b></td></tr><tr class=bg_td><td>" 
response.write vbcrlf&"<table border=0 width='100%'><tr>" 
response.write temp2 
response.write vbcrlf&"</tr></table></td></tr></table><br>"
response.write vbcrlf&jswz_bar_top("文章评论",0)
call review_type(n_sort,id,"jswz_view.asp?id="&id,1,username)
response.write vbcrlf&jswz_bar_end("",0)

call joekoe_cms.exec("update jswz set counter=counter+1 where id="&id,0)
'----------------------------中间 结束----------------------------
%>
</td><td width="3"></td><td width="1" bgcolor="#CCCCCC"></td><td width="3"></td>
    <td width="170" bgColor=#efefef valign="top"><table width="170" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><TABLE style="BORDER-bottom: #999999 1px solid;BORDER-right: #999999 1px solid;BORDER-left: #efefdf 1px solid;BORDER-top: #efefdf 1px solid" cellSpacing=0 
            cellPadding=0 width=170 align=center border=0 bgColor=#dfdfdf>
              <TBODY>
              <TR>
                <TD height=20 align="center">阅读排行</TD></TR></TBODY></TABLE></td>
  </tr>
  <tr>
    <td><table border=0 cellspacing=0 cellpadding=0 width='100%'>
                        <%
sql="select top 12 id,topic from jswz where hidden=1  order by counter desc, id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
  id=rs("id")
  topic=rs("topic")
    response.write vbcrlf&"    <tr><td height='"&dim_num(6)&"'> · <a href='jswz_view.asp?id="&id&"' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,11)&"</a></td></tr>"
  rs.movenext
loop
rs.close
%>
                      </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td  align=center><script language=javascript src='ads/ads_news1.js'></script></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <TR>
                <TD height=20 align="center"><TABLE style="BORDER-bottom: #999999 1px solid;BORDER-right: #999999 1px solid;BORDER-left: #efefdf 1px solid;BORDER-top: #efefdf 1px solid" cellSpacing=0 
            cellPadding=0 width=170 align=center border=0 bgColor=#dfdfdf>
              <TBODY>
              <TR>
                <TD height=20 align="center">推荐文章</TD></TR></TBODY></TABLE></TD>
  </tr>
  <tr>
    <td><table border=0 cellspacing=0 cellpadding=0 width='100%'>
                        <%
sql="select top 12 id,topic from jswz where hidden=1 and istop=1 order by  id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
  id=rs("id")
  topic=rs("topic")
    response.write vbcrlf&"    <tr><td height='"&dim_num(6)&"'> · <a href='jswz_view.asp?id="&id&"' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,11)&"</a></td></tr>"
  rs.movenext
loop
rs.close
%>
                      </table></td>
  </tr>

</table>
</td>
  </tr>

</table>
<%
call jswz_end()
call web_end(0,0)
%>