<!-- #include file="config.asp" -->
<!-- #include file="config_nsort.asp" -->
<!-- #include file="skin.asp" -->
<%
dim tnum,news_tui,istop,atb:atb=" target=_blank"
news_tui="&nbsp;&nbsp;<img src=images/small/tj.gif border=0 title=推荐文章不想看看么？>"
index_url="article":n_sort="art"
tit_fir=format_menu(index_url)

sub article_main(n_jt,l_num,c_num,timt,et)
  response.write vbcrlf&"<table border=0 width='100%' align=center cellspacing=0 cellpadding=0>"
  dim cnum,snum,rssum,j,nummer,topic,sql2,rs2,nid,temp1
  if n_jt<>"" then n_jt=img_small(n_jt)
  sql="select count(c_id) from jk_class where nsort='"&n_sort&"'"
  set rs=conn.execute(sql)
  cnum=rs(0):rs.close
  sql="select count(jk_sort.s_id) from jk_class inner join jk_sort on jk_class.c_id=jk_sort.c_id where nsort='"&n_sort&"'"
  set rs=conn.execute(sql)
  snum=rs(0):rs.close
  
  sql="select count(id) from article where hidden=1"
  set rs=conn.execute(sql)
  rssum=rs(0):rs.close
  response.write vbcrlf&"<tr><td colspan=3 height=25 align=center>&nbsp;"&tit&"&nbsp;现在有&nbsp;<font class=red>"&cnum&"</font>&nbsp;个大类&nbsp;<font class=red>"&snum&"</font>&nbsp;小类&nbsp;&nbsp;共&nbsp;<font class=red>"&rssum&"</font>&nbsp;篇相关的技术文章&nbsp;</td></tr>"
  sql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order,c_id"
  set rs=conn.execute(sql)
  do while not rs.eof
    response.write vbcrlf&"<tr align=center valign=top>"
    for j=1 to 2
      if j=2 then rs.movenext
      if rs.eof then exit for
      nid=rs(0)
      temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
      sql2="select top "&l_num&" id,topic,tim,counter,istop from article where hidden=1 and c_id="&nid&" order by id desc"
      set rs2=conn.execute(sql2)
      do while not rs2.eof
    tnum=c_num:istop=""
    if rs2("istop")=1 then tnum=tnum-3:istop=news_tui
        topic=rs2("topic")
         temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='article_view.asp?id="&rs2("id")&"'"&atb&" title='"&code_html(topic,1,0)&"'>"&code_html(topic,1,tnum)&"</a>"&istop&""&format_end(et,"<font class=gray>"&time_type(rs2("tim"),timt)&"</font>,<font class=blue>"&rs2("counter")&"</font>")&"</td></tr>"

        rs2.movenext
      loop
      rs2.close:set rs2=nothing
      temp1=temp1&"</table>"
      response.write vbcrlf&"<td width='49%'>"&format_bar("<a href='article_list.asp?c_id="&nid&"'><b><font class=end>"&rs(1)&"</font></b></a>",temp1,21,0,0,"|"&web_var(web_color,1)&"|100","")&"</td>"
      if j=1 then response.write "<td width='2%'></td>"
    next
    if not rs.eof then rs.movenext
    response.write vbcrlf&"</tr><tr><td height=5></td></tr>"
  loop
  rs.close:set rs=nothing
  response.write vbcrlf&"</table>"
end sub

sub article_view_review()
%>
<table border=0 width='96%' cellspacing=0 cellpadding=0 class=tf>
<tr><td height=5></td></tr>
<tr><td><% call review_type(n_sort,id,"article_view.asp?id="&id,1) %></td></tr>
<tr><td height=5></td></tr>
</table>
<%
end sub

sub article_view_about()
%>
<table border=0 width='96%' cellspacing=0 cellpadding=0 class=tf>
<tr><td height=5></td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td height=20 bgcolor=<%response.write web_var(web_color,5)%> align=center>
  <table border=0 width='98%'>
  <tr>
  <td class=red_3><b>→&nbsp;主题所属分类：</b>&nbsp;&nbsp;<a href='article_list.asp?c_id=<%response.write cid%>'><%response.write cname%></a>&nbsp;→&nbsp;<a href='article_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>'><%response.write sname%></a></td>
  <td class=red_3 align=right>→&nbsp;<%response.write closer%></td>
  </tr>
  </table>
</td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td bgcolor=<%response.write web_var(web_color,5)%>>
  <table border=0 width='100%'>
  <tr valign=top align=center><td width='50%'><%call article_left_hot("jt0",10,24,1,6)%></td>
  <td width='50%'><%call article_left_new("jt0",10,24,1,6,11)%></td></tr>
  </table>
</td></tr>
<tr><td height=5 bgcolor=<%response.write web_var(web_color,5)%>></td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td height=5></td></tr>
</table>
<%
end sub

sub article_list(n_num,c_num,timt,et)
  dim topic,tim,nid,ss:ss=0
  if n_num>5 then nummer=n_num
  pageurl="?"
  keyword=code_form(request.querystring("keyword"))
  sea_type=trim(request.querystring("sea_type"))
  if sea_type<>"username" then sea_type="topic"
  call cid_sid_sql(2,sea_type)
%>
<table border=0 width='100%' align=center>
<tr><td>|&nbsp;<font class=red><b>一级分类</b></font>&nbsp;>|<%
  sql="select c_name,c_id from jk_class where nsort='"&n_sort&"' order by c_order"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=rs("c_id")
    response.write "&nbsp;<a href='?c_id="&nid&"'"
    if nid=cid then ss=1:response.write " class=red_3"
    response.write ">"&rs("c_name")&"</a>&nbsp;|"
    rs.movenext
  loop
  rs.close
%></td></tr>
<% if ss=1 then %>
<tr><td align=right>
  <table border=0 width='96%'>
  <tr><td>|&nbsp;<font class=red><b>二级分类</b></font>&nbsp;>|<%
    sql="select s_name,s_id from jk_sort where c_id="&cid&" order by s_order"
    set rs=conn.execute(sql)
    do while not rs.eof
      nid=rs("s_id")
      response.write "&nbsp;<a href='?c_id="&cid&"&s_id="&nid&"'"
      if nid=sid then response.write " class=red_3"
      response.write ">"&rs("s_name")&"</a>&nbsp;|"
      rs.movenext
    loop
    rs.close
%></td></tr>
  </table>
</td></tr>
<%
  end if
%>
<tr><td align=center><table border=0 width='100%'></table></td></tr>
<tr><td>
  <table border=0 cellspacing=0 cellpadding=1>
  <tr><td height=1 colspan=4 background='images/bg_dian.gif'></td></tr>
  <tr align=center>
  <td width='6%' class=gray>序号</td>
  <td width='66%' class=gray>文章主题</td>
  <td width='8%' class=gray><%response.write m_unit%></td>
  <td width='20%' class=gray>浏览权限</td>
  </tr>
  <tr><td height=1 colspan=4 background='images/bg_dian.gif'></td></tr>
<%
  set rs=server.createobject("adodb.recordset")
    sql="select id,username,topic,tim,counter,emoney,power,istop from article where hidden=1"&sqladd&" order by id desc"
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  call format_pagecute()
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
	tnum=c_num:istop=""
    if rs("istop")=1 then tnum=tnum-3:istop=news_tui
    topic=rs("topic"):tim=rs("tim")
    response.write vbcrlf&"  <tr>" & _
		   vbcrlf&"  <td height="&space_mod&">"&i+(viewpage-1)*nummer&".</td>" & _
		   vbcrlf&"  <td><a href='article_view.asp?id="&rs("id")&"'"&atb&" title='文章标题："&code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>浏览人次："&rs("counter")&"<br>整理时间："&rs("tim")&"'>"&code_html(topic,1,c_num)&"</a>"&istop&""&format_end(et,"<font class=gray>"&time_type(tim,timt)&"</font>,<font class=blue>"&rs("counter")&"</font>")&"</td>" & _
		   vbcrlf&"  <td class=red_3 align=center>"&rs("emoney")&"</td>" & _
		   vbcrlf&"  <td>"&power_pic(0,rs("power"),0)&"</td></tr>"
    rs.movenext
  next
  rs.close:set rs=nothing
%>
  </table>
</td></tr>
<tr><td align=center><table border=0 width='100%'><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr>
<tr><td>
本栏共有&nbsp;<font class=red><%response.write rssum%></font>&nbsp;篇文章&nbsp;
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")%>
</td></tr>
</table>
<%
end sub

sub article_sea()
  dim temp1,nid,nid2,rs,sql,rs2,sql2
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 align=center>" & _
        vbcrlf&"<script language=javascript><!--" & _
        vbcrlf&"function article_sea()" & _
        vbcrlf&"{" & _
        vbcrlf&"  if (article_sea_frm.keyword.value==""请输入关键字"")" & _
        vbcrlf&"  {" & _
        vbcrlf&"    alert(""请在搜索新闻前先输入要查询的 关键字 ！"");" & _
        vbcrlf&"    article_sea_frm.keyword.focus();" & _
        vbcrlf&"    return false;" & _
        vbcrlf&"  }" & _
        vbcrlf&"}" & _
        vbcrlf&"--></script>" & _
        vbcrlf&"<form name=article_sea_frm action='article_list.asp' method=get onsubmit=""return article_sea()"">" & _
        vbcrlf&"<tr><td height=5></td></tr><tr align=center>" & _
        vbcrlf&"<td>搜索选项：</td>" & _
        vbcrlf&"<td>&nbsp;&nbsp;<select name=sea_type sizs=1><option value='topic'>文章标题</option><option value='username'>发布人</option></seelct></td>" & _
        vbcrlf&"<td>&nbsp;&nbsp;<select name=c_id sizs=1><option value=''>请选择文章的类别</option>"
  sql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order,c_id"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=int(rs(0))
    temp1=temp1&vbcrlf&"<option value='"&nid&"' class=bg_2"
    if cid=nid then temp1=temp1&" selected"
    temp1=temp1&">"&rs(1)&"</option>"
    sql2="select s_id,s_name from jk_sort where c_id="&nid&" order by s_order,s_id"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
      nid2=rs2(0)
      temp1=temp1&vbcrlf&"<option value='"&nid&"&s_id="&nid2&"'"
      if sid=nid2 then temp1=temp1&" selected"
      temp1=temp1&">　"&rs2(1)&"</option>"
      rs2.movenext
    loop
    rs2.close:set rs2=nothing
    rs.movenext
  loop
  rs.close:set rs=nothing
  temp1=temp1&vbcrlf&"</select></td>" & _
      vbcrlf&"<td>&nbsp;&nbsp;<input type=text name=keyword value='请输入关键字' onfocus=""if (value =='请输入关键字'){value =''}"" onblur=""if (value ==''){value='请输入关键字'}"" size=20 maxlength=20></td>" & _
      vbcrlf&"<td>&nbsp;&nbsp;<input type=image src='images/small/search_go.gif' border=0></td></tr>" & _
      vbcrlf&"</form><tr><td height=5></td></tr></table>"
  response.write kong & format_bar("<font class=end><b>文章搜索</b></font>",temp1,21,0,0,"|"&web_var(web_color,1)&"|100","")
end sub

sub article_left_hot(n_jt,n_num,c_num,et,ct)
  dim rs,sql,ltemp,topic
  if n_jt<>"" then n_jt=img_small(n_jt)
  ltemp=vbcrlf&"<table border=0 width='100%' class=tf>"
  sql="select top "&n_num&" id,username,topic,tim,counter,istop from article where hidden=1 order by counter desc,id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    tnum=c_num:istop=""
    if rs("istop")=1 then tnum=tnum-3:istop=news_tui
    topic=rs("topic")
    ltemp=ltemp&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='article_view.asp?id="&rs("id")&"'"&atb&" title='文章标题："&code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>浏览人次："&rs("counter")&"<br>整理时间："&rs("tim")&"'>"&code_html(topic,1,tnum)&"</a>"&istop&""&format_end(et,"<font class=red>"&rs("counter")&"</font>")&"</td></tr>"

    rs.movenext
  loop
  rs.close:set rs=nothing
  ltemp=ltemp&vbcrlf&"</table>"
  'response.write kong & format_bar("<font class=end><b>热门文章（TOP "&n_num&"）</b></font>",ltemp,0,0,0,web_var(web_color,2)&"||images/bg2.gif","")
  response.write kong &"<table border=0 cellspacing=0 cellpadding=0 width='96%'><tr><td align=center>"&format_bar("<font class=end><b>热门文章</b></font>",ltemp,21,0,0,"|"&web_var(web_color,ct)&"|65","")&"</td></tr></table>"
end sub

sub article_left_new(n_jt,n_num,c_num,et,ct,tt)
  dim rs,sql,ltemp,topic,tim
  if n_jt<>"" then n_jt=img_small(n_jt)
  ltemp=vbcrlf&"<table border=0 width='100%' class=tf>"
  sql="select top "&n_num&" id,username,topic,tim,counter,istop from article where hidden=1 order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    tnum=c_num:istop=""
    if rs("istop")=1 then tnum=tnum-3:istop=news_tui
    topic=rs("topic"):tim=rs("tim")
    ltemp=ltemp&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='article_view.asp?id="&rs("id")&"'"&atb&" title='文章标题："&code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>浏览人次："&rs("counter")&"<BR>整理时间："&tim&"'>"&code_html(topic,1,c_num)&"</a>"&istop&""&format_end(et,time_type(tim,tt))&"</td></tr>"
    rs.movenext
  loop
  rs.close:set rs=nothing
  ltemp=ltemp&vbcrlf&"</table>"
  response.write kong &"<table border=0 cellspacing=0 cellpadding=0 width='96%'><tr><td align=center>"&format_bar("<font class=end><b>最近更新</b></font>",ltemp,21,0,0,"|"&web_var(web_color,ct)&"|65","")&"</td></tr></table>"
end sub
%>