<%
Function maketodh()
    dim sql,rs1,rs,emptying,m,dhnl,str
	sql="select BBS_ID,BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs From BBS_Cate where deleted=0 and BBS_Cate_PID='0' order by BBS_ID "
	Set Rs1=Conn.Execute(sql)
	dhnl=""
	do while not rs1.eof
		dhnl=dhnl+"<option value=main.asp?layer_1="&rs1("BBS_Cate_ID")&"&qs="&rs1("BBS_Cate_Qs")&">©ï <b>"&rs1("BBS_Cate_Name")&"</b></option>"
        str="select BBS_ID,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Name,BBS_Cate_Qs From BBS_Cate where deleted=0 and BBS_Cate_PID='"&rs1("BBS_Cate_ID")&"' order by BBS_ID"
		set Rs=Conn.Execute(str)
        do while not rs.eof
		   dhnl=dhnl+"<option value=main.asp?layer_1="&rs("BBS_Cate_PID")&"&layer_2="&rs("BBS_Cate_ID")&"&qs="&rs("BBS_Cate_Qs")&">&nbsp;©Ä "&rs("BBS_Cate_Name")&"</option>"
           rs.movenext
		loop
	    rs1.movenext
	loop
	Set Rs1 = Nothing
	nl="<form name=""myurl""><select name=""select"" size=""1"" onchange=""location=this.options[this.selectedIndex].value""><option value=#>ÂÛÌ³µ¼º½²Ëµ¥</option>"+dhnl+"</select></form>"
    nl="document.write('"&nl&"');"
	dhurl="../ftbbsdh.js"
    myFile = Server.MapPath(dhurl)

    Const ForReading = 1
    Const Forwriting = 2
    Const ForAppending = 8
    Set fileStreamObj = CreateObject("Scripting.FileSystemObject")
    fileStreamObj.CreateTextFile(myFile)
    set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
    textStream.Write(nl)
    textStream.Close()
End Function
Function bbsad()
    sql="select top 3 id,Boardid_1,Boardid_2,user_id,name,title,hit,rep,dateh,redate,bbs_img,bbs_img_display,huati,img_url_display,P_display,picture,sign,zhiye,htmfilename,bbstop,bbstop1,titlecolor,boardsign,reinfo from bbstitle where deleted=0 and boardsign=1 order by bbstop1 desc,bbstop desc,redate desc"
	set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,3,1
    if not rs.eof then
	nlstr=""
    do while not rs.eof
       nlstr=nlstr&"¡¤<a class=""f14"" href=""ftbbs.asp?id="&rs("id")&""" title="&rs("title")&" target=""_blank""><font color="&rs("titlecolor")&">"&rs("title")&"("&formatdatetime(rs("dateh"),2)&")</font></a>"
	   rs.movenext
	loop
	rs.close
	set rs=nothing
    adnl="<tr align=middle class=""maintbtr1"">"
    adnl=adnl&"<td height=25 colspan=6> <marquee truespeed direction=""left"" scrollamount=""1"" scrolldelay=""50"" width=""99%"" onMouseOver=""this.stop()"" onMouseOut=""this.start()"">"&nlstr&"</marquee></td></tr>"
    adnl="document.write('"&adnl&"')"
	else
	adnl="document.write('')"
	end if
	
	bbsadurl="../bbsad.js"
    myFile = Server.MapPath(bbsadurl)

    Const ForReading = 1
    Const Forwriting = 2
    Const ForAppending = 8
    Set fileStreamObj = CreateObject("Scripting.FileSystemObject")
    fileStreamObj.CreateTextFile(myFile)
    set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
    textStream.Write(adnl)
    textStream.Close()
End Function
Function listad()
    sql="select * from ftbbs_ad where adflag=0 and adtype=1 order by id desc"
	set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,3,1
    if not rs.eof then
	   nlstr=""
	   i=0
       do while not rs.eof
	      tr=""
		  i=i+1
	      if i mod 4=0 then
		  tr="</tr>"
		  end if
          nlstr=nlstr&"<td width=""25%"" height=""23"" class=""ftbbsad"" align=""center""><a href="&rs("adurl")&" target=""_blank""><font color="&rs("adcolor")&">"&rs("adtitle")&"</font></a></td>"&tr
		  rs.movenext
	   loop
	   rs.close
	   set rs=nothing
       adnl="<table width=""100%"" border=""0"" align=""center"" cellpadding=""0""><tr> <td height=2><spacer height=""2"" type=""block""></td></tr></table>"
	   adnl=adnl&"<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" class=""maintbbg""><tr>"&nlstr&"</tr></table>"
       adnl="document.write('"&adnl&"')"
	else
	   adnl="document.write('')"
	end if
	
	bbsadurl="../listad.js"
    myFile = Server.MapPath(bbsadurl)

    Const ForReading = 1
    Const Forwriting = 2
    Const ForAppending = 8
    Set fileStreamObj = CreateObject("Scripting.FileSystemObject")
    fileStreamObj.CreateTextFile(myFile)
    set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
    textStream.Write(adnl)
    textStream.Close()
End Function
Function default_listbbsad()
    sql="select top 3 id,Boardid_1,Boardid_2,user_id,name,title,hit,rep,dateh,redate,bbs_img,bbs_img_display,huati,img_url_display,P_display,picture,sign,zhiye,htmfilename,bbstop,bbstop1,titlecolor,boardsign,reinfo from bbstitle where deleted=0 and boardsign=1 order by bbstop1 desc,bbstop desc,redate desc"
	set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,3,1
    if not rs.eof then
	nlstr=""
    do while not rs.eof
       nlstr=nlstr&"¡¤<a class=""f14"" href=""ftbbs.asp?id="&rs("id")&""" title="&rs("title")&" target=""_blank""><font color="&rs("titlecolor")&">"&rs("title")&"("&formatdatetime(rs("dateh"),2)&")</font></a>"
	   rs.movenext
	loop
	rs.close
	set rs=nothing
    adnl=adnl&"<marquee truespeed direction=""left"" scrollamount=""1"" scrolldelay=""50"" width=""99%"" onMouseOver=""this.stop()"" onMouseOut=""this.start()"">"&nlstr&"</marquee>"
    adnl="document.write('"&adnl&"')"
	else
	adnl="document.write('')"
	end if
	
	bbsadurl="../df_listad.js"
    myFile = Server.MapPath(bbsadurl)

    Const ForReading = 1
    Const Forwriting = 2
    Const ForAppending = 8
    Set fileStreamObj = CreateObject("Scripting.FileSystemObject")
    fileStreamObj.CreateTextFile(myFile)
    set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
    textStream.Write(adnl)
    textStream.Close()
End Function
Function default_listad()
    sql="select * from ftbbs_ad where adflag=0 and adtype=1 order by id desc"
	set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,3,1
    if not rs.eof then
	   nlstr=""
	   i=0
       do while not rs.eof
	      tr=""
		  i=i+1
	      if i mod 4=0 then
		  tr="</tr>"
		  end if
          nlstr=nlstr&"<td width=""25%"" height=""25"" class=""ftbbsad"" align=""center""><a href="&rs("adurl")&" target=""_blank""><font color="&rs("adcolor")&">"&rs("adtitle")&"</font></a></td>"&tr
		  rs.movenext
	   loop
	   rs.close
	   set rs=nothing
	   adnl="<table width=""99%"" border=""0"" align=""center"" cellpadding=""0""><tr> <td height=2><spacer height=""2"" type=""block""></td></tr></table>"
	   adnl=adnl&"<table width=""99%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" class=""maintbbg""><tr>"&nlstr&"</tr></table>"
       adnl=adnl&"<table width=""99%"" border=""0"" align=""center"" cellpadding=""0""><tr> <td height=2><spacer height=""2"" type=""block""></td></tr></table>"
	   adnl="document.write('"&adnl&"')"
	else
	   adnl="document.write('')"
	end if
	
	bbsadurl="../default_list_ad.js"
    myFile = Server.MapPath(bbsadurl)

    Const ForReading = 1
    Const Forwriting = 2
    Const ForAppending = 8
    Set fileStreamObj = CreateObject("Scripting.FileSystemObject")
    fileStreamObj.CreateTextFile(myFile)
    set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
    textStream.Write(adnl)
    textStream.Close()
End Function
%>