<!-- #include file="skin.asp" -->
<!-- #include file="jk_nsort.asp" -->
<!-- #include file="../style/data_sort_auto.asp" -->

<%
dim tmp_img_h
cid=0
sid=0
n_sort="auto"
index_url="auto"
tit_fir=format_menu(index_url)
m_channel=index_url
web_img_m="m_"&m_channel
web_img_h="h_"&m_channel
tmp_img_h=web_img_h

sub auto_load(t1,t2,t3)

end sub

sub auto_end()
  if isarray(sort_dim) then erase sort_dim
end sub

sub auto_search(t_title)
  response.write auto_bar_top(t_title,0,1,"") & _
		 vbcrlf&auto_search_list("文章") & _
		 vbcrlf&auto_bar_end("",0)
end sub

sub auto_label(t_title)
  response.write vbcrlf&auto_bar_top(t_title,0,2,"") & _
		 vbcrlf&auto_label_list() & _
		 vbcrlf&auto_bar_end("",0)
end sub

sub auto_sort(t_url,t1,t2,t_title)
  response.write vbcrlf&auto_bar_top(t_title,0,1,"") & _
		 vbcrlf&sort_type(t_url,t1,t2) & _
		 vbcrlf&auto_bar_end("",0)
end sub

sub auto_left(nt,n_num,c_num,n_title)
  dim n_username,n_topic,n_tim
  response.write vbcrlf&auto_bar_top(n_title,1,2,"")
  sql="select top "&n_num&" id,username,topic,tim,counter,ispic from auto where hidden=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&auto_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),0)
    rs.movenext
  loop
  rs.close
  response.write vbcrlf&auto_bar_end("",1)
end sub

function auto_bar_top(tvar,tt,ttype,tmore)
  dim w_wid,more_var,temp1
  w_wid="23%"
  if len(tvar)>10 then w_wid="45%"
  if len(tvar)>25 then w_wid="70%"
  if int(ttype)=2 then w_wid="45%"
  more_var="<img src='"&joekoe_cms.web_dir_skin&"main/"&m_channel&"_more_0"&ttype&".gif' border=0>"
  if tmore<>"" or var_null(tmore)<>"" then
    more_var="<a href='"&tmore&"'><img src='"&joekoe_cms.web_dir_skin&"main/"&m_channel&"_more_1"&ttype&".gif' border=0 alt='点击浏览更多……'></a>"
  end if
  web_img_h=tmp_img_h&ttype
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 class=tablew>" & _
        vbcrlf&"<tr><td align=center>"
  if tt=1 then temp1=temp1&vbcrlf&"  <table border=0 width='100%'>"
  auto_bar_top=temp1
end function

function auto_bar_end(mvar,tt)
  dim temp1
  if tt=1 then temp1=temp1&vbcrlf&"  </table>"
  temp1=temp1&vbcrlf&"</td></tr>" & _
              vbcrlf&"</table>"
  auto_bar_end=temp1&ukong
end function

function auto_topic_type(b_c_num,b_id,b_username,b_topic,b_tim,b_counter,b_ispic,b_tim_type)
  dim n_url,n_jt
  n_url="auto_view.asp?id="&b_id
  n_jt=img_skin(web_img_h)
  auto_topic_type=format_topic_type(n_jt,b_username,b_topic,b_c_num,n_url,b_tim,b_counter,b_ispic,"文章标题","浏览人次",b_tim_type)
end function

function auto_label_list()
  dim temp1
  temp1=temp1&"<table border=0 cellspacing=0 cellpadding=4>" & _
       vbcrlf&"<tr><td>&nbsp;"&img_skin("label_"&m_channel)&"&nbsp;<a href='auto_list.asp?action=pic'"
  if action="pic" then temp1=temp1&" class=red"
  temp1=temp1&">文章图片</a></td></tr>" & _
       vbcrlf&"<tr><td>&nbsp;"&img_skin("label_"&m_channel)&"&nbsp;<a href='auto_list.asp?action=good'"
  if action="good" then temp1=temp1&" class=red"
  temp1=temp1&">推荐文章</a></td></tr>" & _
       vbcrlf&"<tr><td>&nbsp;"&img_skin("label_"&m_channel)&"&nbsp;<a href='auto_list.asp?action=hot'"
  if action="hot" then temp1=temp1&" class=red"
  temp1=temp1&">文章排行</a></td></tr>" & _
       vbcrlf&"</table>"
  auto_label_list=temp1
end function

function auto_list_pagecute(p_nummer,p_rssum,p_viewpage,p_thepages,p_pageurl)
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%' cellspacing=0 cellpadding=2>" & _
             vbcrlf&"<tr>" & _
             vbcrlf&"<td height=25>" & _
             vbcrlf&"&nbsp;本栏共有 <font class=red>"&p_rssum&"</font> 条文章" & _
             vbcrlf&"页次：<font class=red>"&p_viewpage&"</font>/<font class=red>"&p_thepages&"</font>&nbsp;" & _
             vbcrlf&"&nbsp;分页："&jk_pagecute(p_nummer,p_thepages,p_viewpage,p_pageurl,5,"#ff0000") & _
             vbcrlf&"</td>" & _
             vbcrlf&"</table>"&ukong
  auto_list_pagecute=temp1
end function

function auto_search_list(stit)
  dim keyvar,temp1
  keyvar="请输入关键字"
  temp1=temp1&vbcrlf&"<table border=0>" & _
              vbcrlf&"<form name=auto_sea_frm action='auto_list.asp' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
              vbcrlf&"<input type=hidden name=action value='search'>" & _
              vbcrlf&"<tr height=10>" & _
              vbcrlf&"<td colspan=2>"&select_type(stit,0,0)&"</td></tr><tr>" & _
              vbcrlf&"<td><select name=sea_type sizs=1><option value='topic'>&nbsp;"&stit&"标题&nbsp;</option><option value='username'>发布人</option></seelct></td>" & _
              vbcrlf&"<td><select name=sea_term sizs=1><option value='all'>满足所有条件</option><option value='only'>满足一个条件</option></seelct></td></tr><tr>" & _

              vbcrlf&"<td><input type=text name=keyword value='"&keyvar&"' onfocus=""if (value =='请输入关键字'){value =''}"" onblur=""if (value ==''){value='请输入关键字'}"" size=12 maxlength=20 title='多个关键字请用 空格 格开'></td>" & _

              vbcrlf&"  <td> &nbsp;&nbsp;&nbsp;&nbsp;<input type=submit value='开始搜索' onclick=""javascript:return auto_sea('"&stit&"');""></td>" & _
              vbcrlf&"</tr></form></table>" & _
              vbcrlf&"<script language=javascript>" & _
              vbcrlf&"function auto_sea(stit)" & _
              vbcrlf&"{" & _
              vbcrlf&"  if (document.auto_sea_frm.keyword.value==""请输入关键字"")" & _
              vbcrlf&"  {" & _
              vbcrlf&"    alert('请在搜索"&stit&"前先输入要查询的 关键字 ！');" & _
              vbcrlf&"    document.auto_sea_frm.keyword.focus();" & _
              vbcrlf&"    return false;" & _
              vbcrlf&"  }" & _
              vbcrlf&"}" & _
              vbcrlf&"</script>"
  auto_search_list=temp1
end function

function auto_view1(v_id,v_topic,v_tim,v_comto,v_pic,v_ispic)
  dim n_pic,temp1
if v_ispic=true and v_pic<>"" and var_null(v_pic)<>"" then n_pic="<tr><td align=center><img src='"&pic_url(v_pic,0)&"' border=0 onload=""javascript:if(this.width>"&max_w&")this.width="&max_w&";""></td></tr>"
  temp1=temp1&vbcrlf&"<table border=0 width='98%' cellspacing=0 cellpadding=0 align=center>" & _
              vbcrlf&"<tr><td align=center height=50><font class=red_3 size=3><b>"&v_topic&"</b></font></td></tr>" & _
			  vbcrlf&"<tr><td height=1 bgColor=9b9aa2></td></tr>" & _
              vbcrlf&"<tr><td align=center height=25 bgColor=#dfdfdf>发布时间："&v_tim&"  发布人："&joekoe_cms.web_name&"  文章来源："&v_comto&"</td></tr>" & _
              vbcrlf&"<tr><td height=10></td></tr>" & _
              vbcrlf&"<tr><td valign=top>" & _
              vbcrlf&"  <table border=0><tr><td>" & _
              vbcrlf&"    <table border=0 width='100%' class=tf><tr><td class=bw>"
if n_pic="" then
temp1=temp1&vbcrlf&"<table align=left float=left border=0><tr><td><script language=javascript src='ads/ads_news.js'></script></td></tr></table>"
else
end if
temp1=temp1&vbcrlf&"<table align=left float=left border=0><tr><td>"&n_pic&"</td></tr></table>"
  auto_view1=temp1
end function

function auto_view2(v_id,v_topic,v_counter,v_username,v_id1,v_topic1,v_id2,v_topic2)
  dim temp1
  temp1=temp1&vbcrlf&"&nbsp;<font class=gray>（本文已被浏览&nbsp;"&v_counter&"&nbsp;次）</font>" & _
              vbcrlf&"    </td></tr></table>" & _
              vbcrlf&"  </td></tr></table>" & _
              vbcrlf&"</td></tr>" & _
              vbcrlf&"<tr><td height=10></td></tr>" & _
              vbcrlf&"<tr><td>" & _
              vbcrlf&"  <table border=0 width='100%'>" & _
              vbcrlf&"  <tr>" & _
              vbcrlf&"  <td width='25%' class=htd>&nbsp;发布人："&format_user_name(v_username,0,"")&"<br>&nbsp;"&commend_friend(tit,v_topic,"auto_view.asp?id="&v_id)&"</td>" & _
              vbcrlf&"  <td width='75%' class=htd>" & _
              vbcrlf&"上篇文章："
  if v_topic1<>"" and var_null(v_topic1)<>"" then
    temp1=temp1&"<a href='auto_view.asp?id="&v_id1&"' title='"&joekoe_cms.code_html(v_topic2,1,0)&"'>"&joekoe_cms.code_html(v_topic1,1,25)&"</a>"
  else
    temp1=temp1&"<font class=gray>没有找到相关文章</font>"
  end if
  temp1=temp1&"<br>下篇文章："
  if v_topic2<>"" and var_null(v_topic2)<>"" then
    temp1=temp1&"<a href='auto_view.asp?id="&v_id2&"' title='"&joekoe_cms.code_html(v_topic2,1,0)&"'>"&joekoe_cms.code_html(v_topic2,1,25)&"</a>"
  else
    temp1=temp1&"<font class=gray>没有找到相关文章</font>"
  end if
  temp1=temp1&vbcrlf&"  </td></tr></table>" & _
              vbcrlf&"</td></tr>" & _
              vbcrlf&"</table>"
  auto_view2=temp1&ukong
end function
%>