<%



Function Get_www654cn_MingZhan(SortName)   
      www654cn_MingZhan=""
	  set rs_MingZhan=server.createobject("adodb.recordset")
      sql_MingZhan="select wwwid,wwwurl,wwwweb,addtime,isok,hits from www654cn_City_WEB where wwwsort='"&SortName&"' order by hits desc"
      rs_MingZhan.open sql_MingZhan,conn,1,1
      jishu=1
      do while not rs_MingZhan.eof
         if rs_MingZhan("addtime")>Now()-7 then
          '  xin="<FONT COLOR=#FF0000>新</FONT>"
         Else
            xin=""
         end if
	     www654cn_MingZhan=www654cn_MingZhan&"<li>"
	     if weblanmu(14)=1 then  '判断是否 统计点击率		      
	        if weblanmu(13)=1 then  '判断是否 内 外连接
			   www654cn_MingZhan=www654cn_MingZhan&"<A HREF=""../go.asp?url=list/"&rs_MingZhan("wwwid")&".htm&id="&rs_MingZhan("wwwid")&""" title=""点击"&rs_MingZhan("hits")&"次"" TARGET=""_blank"">"
		    Else
			   www654cn_MingZhan=www654cn_MingZhan&"<A HREF=""../go.asp?url="&rs_MingZhan("wwwurl")&"&id="&rs_MingZhan("wwwid")&""" title=""点击"&rs_MingZhan("hits")&"次"" TARGET=""_blank"">"
	        End if
	     Else
	        If weblanmu(13)=1 then  '判断是否 内 外连接
			   www654cn_MingZhan=www654cn_MingZhan&"<A HREF=""../list/"&rs_MingZhan("wwwid")&".htm"" TARGET=""_blank"">"
	        Else
			   www654cn_MingZhan=www654cn_MingZhan&"<A HREF="""&rs_MingZhan("wwwurl")&""" TARGET=""_blank"">"
		    End if
	     End if
         www654cn_MingZhan=www654cn_MingZhan&xin&rs_MingZhan("wwwweb")
         www654cn_MingZhan=www654cn_MingZhan&"</A></li>"&vbcrlf
         jishu=jishu+1
         rs_MingZhan.movenext
		 if jishu-1>=24 then exit do  '只显示24条
      loop
      rs_MingZhan.close
      set rs_MingZhan=nothing
Get_www654cn_MingZhan=www654cn_MingZhan
End Function


Function Get_indexlist(bigID)
   WebNameWidth=0  '判断累加网址字符长度
   n=1  '控制
   indexlist=""
   sql_list="select * from www654cn_City_SORT where sortstep=1 and bigid="&cint(bigid)&" order by sortstep,queue"
   Set rs_list=Server.CreateObject("ADODB.RecordSet")
       rs_list.Open sql_list,conn,1,1
   If rs_list.eof then
      Response.Write("目前还没有分类，请<a href=""City_class_edit.asp?a=add"">添加一个分类</a>")
   End if
   do while not rs_list.eof 
      Cityinfo=Split(rs_list("info"),"|")
      Cityname_2=Cityinfo(3)                '城市名称。如：工作 

	  ymgjc=rs_list("ymgjc")
	  	  if n=1 then
  	        indexlist=indexlist&"<dl class=""bg0"">"&vbcrlf
            indexlist=indexlist&"<dt class=""sortName"">[<a href="""&rs_list("sml")&".htm"" >"&Cityname_2&"</a>]</dt>"&vbcrlf
          else
		   	if  n mod 2=0 then
			    indexlist=indexlist&"<dl class=""bg1"">"&vbcrlf
                indexlist=indexlist&"<dt>[<a href="""&rs_list("sml")&".htm"" >"&Cityname_2&"</a>]</dt>"&vbcrlf
		    else
			    indexlist=indexlist&"<dl class=""bg0"">"&vbcrlf
                indexlist=indexlist&"<dt>[<a href="""&rs_list("sml")&".htm"" >"&Cityname_2&"</a>]</dt>"&vbcrlf
			end if
	     end if
      set rs_url=server.createobject("adodb.recordset")
      sql_url="select wwwid,wwwurl,wwwweb,addtime,isok,hits from www654cn_City_WEB where wwwsort='"&rs_list("sort")&"' order by hits desc"
      rs_url.open sql_url,conn,1,1
      do while not rs_url.eof	
	  	 WebNameWidth=WebNameWidth+strlen(rs_url("wwwweb"))+1  '+1表示每次一个空各
	     if WebNameWidth>=68 then exit do  '总长度不要超过66
         if rs_url("addtime")>Now()-7 then
         '   xin="<FONT COLOR=#FF0000>新</FONT>"
         Else
            xin=""
         end if
         if rs_url("isok")=true or rs_url("hits")>1000  then   ' 推出 或 到达1000点时也自动推出
            jian="√"
         else
            jian=""
         end if
         if rs_url("isok")=true then
            classhot=" class=""hot"""
         else
            classhot=""
         end if 
         indexlist=indexlist&"<dd"&classhot&">"
	     if weblanmu(15)=1 then '判断是否增加搜索	
            indexlist=indexlist&"<a href=http://so.654.cn/go.asp?NO=8&Key="&rs_url("wwwweb")&" target=""_blank"">卍</a>"
         end if
         if weblanmu(16)=1 then  '判断是否连接报告 
            indexlist=indexlist&"<a href=../break.asp?id="&rs_url("wwwid")&" title=""无法连接报告"">╳</a>"
         end if
	     if weblanmu(14)=1 then  '判断是否 统计点击率		      
	        if weblanmu(13)=1 then  '判断是否 内 外连接
			   indexlist=indexlist&"<A HREF=""../go.asp?url=list/"&rs_url("wwwid")&".htm&id="&rs_url("wwwid")&""" title=""点击"&rs_url("hits")&"次"" TARGET=""_blank"">"
		    Else
			   indexlist=indexlist&"<A HREF=""../go.asp?url="&rs_url("wwwurl")&"&id="&rs_url("wwwid")&""" title=""点击"&rs_url("hits")&"次"" TARGET=""_blank"">"
	        End if
	     Else
	        If weblanmu(13)=1 then  '判断是否 内 外连接
			   indexlist=indexlist&"<A HREF=""../list/"&rs_url("wwwid")&".htm"" TARGET=""_blank"">"
	        Else
			   indexlist=indexlist&"<A HREF="""&rs_url("wwwurl")&""" TARGET=""_blank"">"
		    End if
	     End if
         indexlist=indexlist&xin&rs_url("wwwweb")&jian
         indexlist=indexlist&"</A></dd>"&vbcrlf 		 
         rs_url.movenext
      loop
	  rs_url.close
      set rs_url=nothing
	  WebNameWidth=0
     n=n+1
     indexlist=indexlist&"<dd class=""more""><a href="""&rs_list("sml")&".htm"" >更多&gt;&gt;</a></dd>"&vbcrlf
     indexlist=indexlist&"</dl>"&vbcrlf
      rs_list.movenext
	  if rs_list.eof or rs_list.bof  then exit do
   loop
   rs_list.close
   set rs_list=nothing
Get_indexlist=indexlist
End Function



'//-----------以下为分页信息函数

'//////////////////////分类导航条
Function Get_City_class_navigation(SortName)
'分类导航条，如：乐府诗-〉网址导航-〉色情网址。哈哈哈
	Dim TempRs,TempRs_1,filename,TemFromID,i
	Set TempRs = Conn.Execute("Select SortID,FromID,sml from www654cn_City_SORT where Sort='" & SortName & "'")
	if Not (TempRs.bof And TempRs.EOF) then
	  TemFromID=Split(TempRs("FromID"),"|")  
	  for i=2 to UBound(TemFromID)	      
		  Set TempRs_1 = Conn.Execute("Select Sort,sml from www654cn_City_SORT where SortID="&TemFromID(i)&"")
          if Not (TempRs_1.bof And TempRs_1.EOF) then  
			   'Get_City_class_navigation =  Get_City_class_navigation&"＞<a href="""&TempRs_1("sml")&".htm"">"&TempRs_1("Sort")&"</a>"
  			    Get_City_class_navigation =  Get_City_class_navigation&"＞<a href=""index.htm"">"&TempRs_1("Sort")&"</a>"
		  end if
          TempRs_1.Close
          Set TempRs_1 = Nothing		  
	  next
	  Get_City_class_navigation=Get_City_class_navigation&"＞<a href="""&TempRs("sml")&".htm"">"&SortName&"</a>"
	end if	    
	TempRs.Close
	Set TempRs = Nothing
	Get_City_class_navigation="<a href=""/"">654上网导航</a>：城市导航"&Get_City_class_navigation
End Function
Function Get_WWW654CN_SortName(SortID)  '给分类id 收得分类名  查询父级名
   Dim TempRs
  ' SortID=CStr(SortID)
  ' Response.write SortID
  ' Response.end
   Set TempRs = Conn.Execute("Select Sort from www654cn_City_SORT where SortID="&SortID&"")
   if Not (TempRs.bof And TempRs.EOF) then   
      Get_WWW654CN_SortName=TempRs("Sort")
   end if
   TempRs.Close
   Set TempRs = Nothing  
End Function
'//////////////////////分类导航条end

Function Get_www654cn_City_WEB_urllist()
	 '-----------生成网址连接数据列表
if webopen=false then
   urllist="<li>"+webmodi+"<br><br><a href=""../admin/index.asp"">管理员由此入内</a>"
else
  urllist=urllist&"<div class=""UrlSort"">"&vbcrlf
  urllist=urllist&"<div class=""UrlTit""><h2>"&rs("sort")&"</h2>"&vbcrlf
  urllist=urllist&"<p class=""back""><a href=""#"" target=""_self"">返回页首↑</a></p>"&vbcrlf
  urllist=urllist&"</div>"&vbcrlf
  urllist=urllist&"<div class=""UrlTxt"">"&vbcrlf
  urllist=urllist&"<ul>"&vbcrlf
   set rs_url=server.createobject("adodb.recordset")
   sql_url="select wwwid,wwwurl,wwwweb,addtime,isok,hits from www654cn_City_WEB where wwwsort='"&rs("sort")&"' order by hits desc"
   rs_url.open sql_url,conn,1,1
   jishu=1
   while not rs_url.eof
      if rs_url("addtime")>Now()-7 then
         xin="<FONT COLOR=#FF0000>新</FONT>"
      Else
         xin=""
      end if

      if rs_url("isok")=true or rs_url("hits")>1000  then   ' 推出 或 到达1000点时也自动推出
         jian="√"
      else
         jian=""
      end if
  
      if rs_url("isok")=true then
         classhot=" class=""hot"""
      else
         classhot=""
      end if 
      urllist=urllist&"<li"&classhot&">"
           
	  if weblanmu(15)=1 then '判断是否增加搜索	
         urllist=urllist&"<a href= http://so.654.cn/go.asp?NO=8&Key="&rs_url("wwwweb")&" target=""_blank"">卍</a>"
      end if
	  
      if weblanmu(16)=1 then  '判断是否连接报告 
         urllist=urllist&"<a href=../break.asp?id="&rs_url("wwwid")&" title=""无法连接报告"">╳</a>"
      end if
	
	  if weblanmu(14)=1 then  '判断是否 统计点击率		      
	     if weblanmu(13)=1 then  '判断是否 内 外连接
			urllist=urllist&"<A HREF=""../go.asp?url=list/"&rs_url("wwwid")&".htm&id="&rs_url("wwwid")&""" title=""点击"&rs_url("hits")&"次"" TARGET=""_blank"">"
		 Else
			urllist=urllist&"<A HREF=""../go.asp?url="&rs_url("wwwurl")&"&id="&rs_url("wwwid")&""" title=""点击"&rs_url("hits")&"次"" TARGET=""_blank"">"
	     End if
	  Else
	     If weblanmu(13)=1 then  '判断是否 内 外连接
			urllist=urllist&"<A HREF=""../list/"&rs_url("wwwid")&".htm"" TARGET=""_blank"">"
	     Else
			urllist=urllist&"<A HREF="""&rs_url("wwwurl")&""" TARGET=""_blank"">"
		 End if
	  End if
      urllist=urllist&xin&rs_url("wwwweb")&jian
      urllist=urllist&"</A></li>"&vbcrlf
      jishu=jishu+1
      rs_url.movenext
   wend
   rs_url.close
   set rs_url=nothing
   urllist=urllist&"</ul>"&vbcrlf
 '  urllist=urllist&"<dl class=""SoKeys"">"&vbcrlf
 '  urllist=urllist&"<dt><strong>[注]</strong></dt>"&vbcrlf       
 '  if weblanmu(15)=1 then '判断是否增加搜索	
 '     urllist=urllist&"<dd>卍：搜索</dd>"&vbcrlf
'   end if   
'   if weblanmu(16)=1 then  '判断是否连接报告 
'      urllist=urllist&"<dd>╳：报告错误</dd>"&vbcrlf
'   end if
'   urllist=urllist&"<dt><strong>申请加入此类：</strong></dt>"&vbcrlf   	    
'   urllist=urllist&"<dd><a href=""../addurl.asp?sort="&rs("sort")&""">请点击这里</a></dd></dl>"&vbcrlf
   urllist=urllist&"<dl class=""SoKeys"">"&vbcrlf
   urllist=urllist&"<dt><strong>相关搜索：</strong></dt>"&vbcrlf 
   urllist=urllist&Get_keywords_Search(rs("ymgjc"),16)   '关键词搜索该类10个
   urllist=urllist&"</dl>"&vbcrlf
   urllist=urllist&"</div>"&vbcrlf
   urllist=urllist&"</div><!-- UrlSort -->"&vbcrlf
        'response.write urllist	   
end if
Get_www654cn_City_WEB_urllist=urllist
End Function

Function Get_www654cn_City_SORT_classlist(BIGid)
'--------写出下级分类列表
  set rs_classlist=server.createobject("adodb.recordset")
  sql_classlist="select sortid,sort,reid,sml,sjsum from www654cn_City_SORT where sortid="&BIGid&""
  rs_classlist.open sql_classlist,conn,1,1
    Get_classlist=Get_classlist&"<ul>"&vbcrlf         
    Get_classlist=Get_classlist&"<li><a href=""index.htm"">"&rs_classlist("sort")&"</a>&nbsp;<span class=""unum"">("&rs_classlist("sjsum")&")</span>"            
    Get_classlist=Get_classlist&"<ul>"&vbcrlf
  rs_classlist.close
  sql_classlist="select sortid,sort,reid,sml,sjsum from www654cn_City_SORT where reid="&BIGid&""
  rs_classlist.open sql_classlist,conn,1,1

  do while not rs_classlist.eof
     Get_classlist=Get_classlist&"<li><a href="""&rs_classlist("sml")&".htm"">"&rs_classlist("sort")&"</a>&nbsp;<span class=""unum"">("&rs_classlist("sjsum")&")</span></li>"&vbcrlf
	 rs_classlist.movenext
     if rs_classlist.eof then exit do     
  loop
  Get_classlist=Get_classlist&"</ul>"&vbcrlf
  Get_classlist=Get_classlist&"</li>"&vbcrlf
  Get_classlist=Get_classlist&"</ul>"&vbcrlf 
  rs_classlist.close
  set rs_classlist=nothing
  Get_www654cn_City_SORT_classlist=Get_Classlist
End Function


Function Get_keywords(sortname,type_character)  'Get_keyword(类名，替换字符)
  'type_character="|"
  'sortname="聊天论坛"
   'Get_keywords=""
    Get_keywords=replace(rs("ymgjc"),",",type_character)
End Function
Function Get_keywords_Search(sortname,n)  'Get_keyword(类名,几条)
   dim Search_n
   
   keywords_Search=Split(sortname,",")
   Search_n=UBound(keywords_Search)+1  '相关搜索个数
   sortname=strvalue(sortname,85-Search_n)
   keywords_Search=Split(sortname,",")
  
  '  if n>13 then n=12 
  '  keywords_Search=Split(sortname,",")
  '  Response.write "-->"&keywords_Search(0)
  '  Response.write "-->"&UBound(keywords_Search)
  '  Response.end
	
    if UBound(keywords_Search)<n-1 then
	   for i=0 to UBound(keywords_Search)-1
           Get_keywords_Search=Get_keywords_Search&"<dd><a href=http://so.654.cn/go.asp?NO=8&Key="&keywords_Search(i)&" target=""_blank"">"&keywords_Search(i)&"</a></dd>"&vbcrlf
       next   
	else
	   for i=0 to n-1
           Get_keywords_Search=Get_keywords_Search&"<dd><a href= http://so.654.cn/go.asp?NO=8&Key="&keywords_Search(i)&" target=""_blank"">"&keywords_Search(i)&"</a></dd>"&vbcrlf
       next 	
	end if
'	Response.write Get_keywords_Search
'    Response.end
End Function


%>
