<%
sub news_fpic(nt,t_num,n_num,c_num,n_title)
  dim temp1,pid,nid,n_topic,n_username,n_tim
  sql="select top 1 id,topic,pic from news where hidden=1 and ispic=1 order by id desc"
  set rs=joekoe_cms.exec(sql,1)
  if not rs.eof then
    n_topic=rs("topic")
    temp1=format_pic_type(rs("pic"),n_topic,t_num,"news_view.asp?id="&rs("id"))
  end if
  rs.close
  response.write vbcrlf&news_bar_top(n_title,1,1,"") & _
		 vbcrlf&"<tr>" & _
		 vbcrlf&"<td align=center width='30%'>"&temp1&"</td>" & _
		 vbcrlf&"<td width='70%'>" & _
		 vbcrlf&"  <table border=0>"
  sql="select top "&n_num&" id,username,topic,tim,counter,ispic from news where hidden=1 and ispic=1"
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
  case "good"
    sql=sql&" and istop=1 order by id desc"
  case else
    sql=sql&" order by id desc"
  end select
  set rs=joekoe_cms.exec(sql,1)
  do while not rs.eof
    n_username=rs("username")
    n_topic=rs("topic")
    n_tim=rs("tim")
    n_tim=joekoe_cms.time_type(n_tim,1)
    response.write vbcrlf&news_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),1)
    rs.movenext
  loop
  rs.close
  response.write vbcrlf&"  </table>" & _
		 vbcrlf&"</td></tr>" & _
		 vbcrlf&news_bar_end("",1)
end sub

sub news_pic(nt,n_num,c_num,n_title)
  dim temp1,nid,per_num,n_topic
  per_num=100\n_num
  response.write vbcrlf&news_bar_top(n_title,1,1,"") & _
		 vbcrlf&"<tr align=center>"
  sql="select top 2 id,topic,pic from news where hidden=1 and ispic=1"
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
  case "good"
    sql=sql&" and istop=1 order by id desc"
  case else
    sql=sql&" order by id desc"
  end select
  set rs=joekoe_cms.exec(sql,1)
  do while not rs.eof
    n_topic=rs("topic")
    response.write vbcrlf&"<td width='"&per_num&"%' align=center>"&format_pic_type(rs("pic"),n_topic,c_num,"news_view.asp?id="&rs("id"))&"</td></tr>"
    rs.movenext
  loop
  rs.close
  response.write vbcrlf&"" & _
		 vbcrlf&news_bar_end("",1)
end sub

sub news_main_list(n_num,c_num)
  dim ncid,ncname,crs,csql,sqla,n_username,n_topic,n_tim
  csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
  set crs=joekoe_cms.exec(csql,1)
  do while not crs.eof
    ncid=crs("c_id")
    ncname=crs("c_name")
    sqla=" and c_id="&ncid
    response.write vbcrlf&news_bar_top(ncname,1,1,"news_list.asp?action=more&c_id="&ncid)
    sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&ncid&" order by id desc"
    set rs=conn.execute(sql)
    do while not rs.eof
      n_username=rs("username")
      n_topic=rs("topic")
      n_tim=rs("tim")
      n_tim=joekoe_cms.time_type(n_tim,1)
      response.write vbcrlf&news_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),2)
      rs.movenext
    loop
    rs.close
    response.write vbcrlf&news_bar_end("",1)
    crs.movenext
  loop
  crs.close
  set crs=nothing
end sub

%>