<!-- #include file="config.asp" -->
<!-- #include file="config_nsort.asp" -->
<!-- #include file="skin.asp" -->
<%
index_url="article"
n_sort="art"
tit_fir=objv7.format_menu(web_menu,index_url)

sub article_main(n_num,c_num)
  dim ccid,ccname,sqla,crs,csql,nn,temp1,tim,cnum:nn=0
  csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order,c_id"
  set crs=conn.execute(csql)
  do while not crs.eof
    temp1="<table border=0 width='100%'><tr><td width='92%' height=1></td><td width='8%'></td></tr>"
    ccid=crs("c_id"):ccname=crs("c_name"):sqla=" and c_id="&ccid
    sql="select top "&n_num&" id,topic,tim,username,counter from article where hidden=1 and c_id="&ccid&" order by id desc"
    set rs=conn.execute(sql)
    do while not rs.eof
      dim topic:cnum=c_num:topic=rs("topic"):tim=rs("tim")
      temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&img_skins()&"<a href='javascript:;' onclick=""javascript:open_view('article_view.asp?id="&rs("id")&"',1);"" title='文章标题："&objv7.code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>浏览人次："&rs("counter")&"<br>整理时间："&objv7.time_type(tim,88)&"'>"&objv7.code_html(topic,1,cnum)&"</a></td><td class=gray align=right>"&objv7.time_type(tim,1)&"</td></tr>"
      rs.movenext
    loop
    rs.close
    temp1=temp1&vbcrlf&"</table>"
    response.write kong&main_bar(1,ccname,temp1,1,"100%","<a href='article_list.asp?c_id="&ccid&"'>"&morepic&"</a>")
    crs.movenext
  loop
  crs.close:set crs=nothing
end sub

sub article_main1(l_num,c_num)
  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,n_jt
  n_jt=img_skins()
  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 class=tdbg-dark><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>"
      sql2="select top "&l_num&" id,topic,tim,counter from article where hidden=1 and c_id="&nid&" order by id desc"
      set rs2=conn.execute(sql2)
      do while not rs2.eof
        topic=rs2("topic")
         temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('article_view.asp?id="&rs2("id")&"');"" title='"&objv7.code_html(topic,1,0)&"'>"&objv7.code_html(topic,1,c_num)&"</a></td></tr>"
        rs2.movenext
      loop
      rs2.close:set rs2=nothing
      temp1=temp1&"</table>"
      response.write vbcrlf&"<td width='49%'>"&main_bar(1,rs(1),temp1,1,"100%","<a href='article_list.asp?c_id="&nid&"'>"&morepic&"</a>")
      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>
<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>
<tr><td height=5></td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td height=20 bgcolor=<%response.write objv7.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>
  <table border=0 width='100%'>
  <tr valign=top align=center><td width='50%'><%call article_left_hot(6,24)%></td>
  <td width='50%'><%call article_left_new(6,24)%></td></tr>
  </table>
</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=objv7.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)
  response.write kong&admin_bar("文章列表",1,"100%")
%>
<table border=0 width='100%' align=center>
<tr><td>
  <table border=0 width='100%' cellspacing=0 cellpadding=1>
  <tr><td height=1 colspan=5 background='images/bg_dian.gif'></td></tr>
  <tr align=center class=tdbg-dark height=18 valign=bottom>
  <td width='6%' class=gray>序号</td>
  <td width='67%' class=gray>文章主题</td>
  <td width='13%' class=gray>更新日期</td>
  <td width='7%' class=gray><%response.write m_unit%></td>
  <td width='7%' class=gray>人气</td>
  </tr>
  <tr><td height=1 colspan=5 background='images/bg_dian.gif'></td></tr>
<%
  set rs=server.createobject("adodb.recordset")
  sql="select id,username,topic,tim,counter,emoney,power 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
    topic=rs("topic"):tim=rs("tim")
    response.write vbcrlf&"  <tr>" & _
		   vbcrlf&"  <td height="&space_mod&">"&i+(viewpage-1)*nummer&".</td>" & _
		   vbcrlf&"  <td><a href='javascript:;' onclick=""javascript:open_view('article_view.asp?id="&rs("id")&"');"" title='文章标题："&objv7.code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>整理时间："&rs("tim")&"'>"&objv7.code_html(topic,1,c_num)&"</a></td>" & _
		   vbcrlf&"  <td class=gray>"&objv7.time_type(tim,3)&"</td>" & _
		   vbcrlf&"  <td class=time align=center>"&rs("emoney")&"</td>" & _
		   vbcrlf&"  <td class=hit align=center>"&rs("counter")&"</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=time><%response.write rssum%></font>&nbsp;篇文章&nbsp;
页次：<font class=time><%response.write viewpage%></font>/<font class=time><%response.write thepages%></font>&nbsp;
分页：<%response.write objv7.jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")%>
</td></tr>
<tr><td height=5></td></tr>
</table>
<%
response.write kong&admin_bar("",2,"100%")
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>" & _
        vbcrlf&"<tr><td>" & _
        vbcrlf&"  <table border=0><tr>" & _
        vbcrlf&"  <td><select name=sea_type sizs=1><option value='topic'>文章标题</option><option value='username'>发布人</option></seelct></td>" & _
        vbcrlf&"  <td><input type=text name=keyword value='请输入关键字' onfocus=""if (value =='请输入关键字'){value =''}"" onblur=""if (value ==''){value='请输入关键字'}"" size=12 maxlength=20></td>" & _
        vbcrlf&"  </tr></table>" & _
        vbcrlf&"</td></tr><tr><td>" & _
        vbcrlf&"  <table border=0><tr>" & _
        vbcrlf&"  <td><script language=javascript src='style/select_article.js'></script></td>" & _
        vbcrlf&"  <td><input type=image src='images/small/search_go.gif' border=0></td>" & _
        vbcrlf&"  </tr></table>" & _
        vbcrlf&"</td></tr>" & _
        vbcrlf&"</form><tr><td height=1></td></tr></table>"
  response.write kong&main_bar(0,"文章搜索",temp1,0,"100%","")
end sub

sub article_left_hot(n_num,c_num)
  dim rs,sql,ltemp,topic,n_jt
  n_jt=img_skins()
  ltemp=vbcrlf&"<table border=0 width='100%'>"
  sql="select top "&n_num&" id,username,topic,tim,counter from article where hidden=1 order by counter desc,id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    ltemp=ltemp&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('article_view.asp?id="&rs("id")&"');"" title='文章标题："&objv7.code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>整理时间："&rs("tim")&"'>"&objv7.code_html(topic,1,c_num)&"</a></td></tr>"
    rs.movenext
  loop
  rs.close:set rs=nothing
  ltemp=ltemp&vbcrlf&"</table>"
  response.write kong&main_bar(0,"热门文章",ltemp,0,"100%","")
  'ltemp=format_bar("<font class="&sk_class&">热门文章</font>",ltemp,"",sk_bar,"")
  'response.write kong&format_bar3(ltemp)
end sub

sub article_left_new(n_num,c_num)
  dim rs,sql,ltemp,topic,tim
  dim n_jt:n_jt=img_skins()
  ltemp=vbcrlf&"<table border=0 width='100%'>"
  sql="select top "&n_num&" id,username,topic,tim,counter from article where hidden=1 order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic"):tim=rs("tim")
    ltemp=ltemp&vbcrlf&"<tr><td height="&space_mod&">"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('article_view.asp?id="&rs("id")&"');"" title='文章标题："&objv7.code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>整理时间："&tim&"'>"&objv7.code_html(topic,1,c_num)&"</a>"&objv7.format_end(1,objv7.time_type(tim,1))&"</td></tr>"
    rs.movenext
  loop
  rs.close:set rs=nothing
  ltemp=ltemp&vbcrlf&"</table>"
  response.write kong&main_bar(0,"最近更新",ltemp,0,"100%","")
  'ltemp=format_bar("<font class="&sk_class&"><b>最近更新</b></font>",ltemp,"",sk_bar,"")
  'response.write kong&format_bar3(ltemp)
end sub
%>