生成公司三级分类

<% data_path="../../../" 'ACC连接数据库路径，对SQL无效 dir="no" numid="no" %> <% '过滤内容中出现的html代码，引用时用 “RemoveHTML(调用内容)” Function RemoveHTML(strHTML) Dim objRegExp, Match, Matches Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True '取闭合的<> objRegExp.Pattern = "<.+?>" '进行匹配 Set Matches = objRegExp.Execute(strHTML) ' 遍历匹配集合，并替换掉匹配的项目 For Each Match in Matches strHtml=Replace(strHTML,Match.Value,"") Next RemoveHTML=strHTML Set objRegExp = Nothing End Function '定义结束。 '读取模板^^^^^^^^^^^start^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set rs=Server.createobject("adodb.recordset") rs.Open ("select corporation_type2 from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1 If rs.Eof Then Response.Write("
对不起！该模版不存在！ 关闭") Response.End() End If If Not rs.Eof Then pencat=rs("corporation_type2") rs.Close End If '^^^^^^^^^^^^^^^^^^end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If Request("page")<>"" Then If Cint(Request("page"))<1 Then currentPage=1 Else currentPage=Cint(Request("page")) End If Else currentPage=1 End If If Request("page2")<>"" Then If Cint(Request("page2"))<1 Then currentPage2=1 Else currentPage2=Cint(Request("page2")) End If Else currentPage2=1 End If MaxPerPage=1 If Request("all")="all" Then Set rs=Server.createobject("adodb.recordset") rs.Open ("select * from Websen_class_3 order by typeid_2 desc"),conn,1,1 elseif Request("all")="update" Then id1=replace(Request("id1"),"'","") id2=replace(Request("id2"),"'","") Set rs=Server.createobject("adodb.recordset") rs.Open ("select * from Websen_class_3 Where typeid_2 between "&id1&" and "&id2&" order by typeid_2 desc"),conn,1,1 End If If not rs.eof Then rs.pagesize=MaxPerPage mpage=rs.pagecount '得到总页数 rs.move (currentPage-1)*MaxPerPage If mpage>=currentPage Then ttid=rs("typeid_2") tytid=rs("typeID") sttid=rs("sortID") End If End If rs.Close If ttid="" Then ttid=0 End If If tytid="" Then tytid=0 End If If sttid="" Then sttid=0 End If Response.Write "已生成/要生成的三级分类:"¤tPage-1&"/"&mpage&"个" If mpage " Else msg_per_page=15 If Request("all")="all" or Request("all")="update" Then Set rs=Server.createobject("adodb.recordset") rs.Open ("select * from Websen_corporation where typeID_2="&ttid&" and flag=1 order by trust_score desc,id desc"),conn,1,1 End If If not rs.eof Then totalrec=RS.RecordCount'总记录条数 rs.pagesize=msg_per_page '每页数 mpage2=rs.pagecount '得到总页数 rowcount=msg_per_page rs.move (currentPage2-1)*MaxPerPage If mpage2>=currentPage2 Then tttid=currentPage2 End If End If %> <% Set rssort1=Server.createobject("adodb.recordset") rssort1.Open ("select * from Websen_class_1 where sortID="&sttid&""),conn,1,1 Set rssort=Server.createobject("adodb.recordset") rssort.Open ("select * from Websen_class_2 where typeID="&tytid&""),conn,1,1 Set rssort2=Server.createobject("adodb.recordset") rssort2.Open ("select * from Websen_class_3 where typeID_2="&ttid&""),conn,1,1 If rs.eof Then HOPE_body=HOPE_body&"
暂无公司信息
" Else Dim t,tmon t=1 tmon=0 i=1 HOPE_body=HOPE_body&"
" do while not rs.eof and rowcount > 0 HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&""&vbCrlf HOPE_body=HOPE_body&"

"&VbCrLf HOPE_body=HOPE_body&"

"&vbCrlf '--是否使用的名片页------------------------------------------------------------ set rsmp=server.CreateObject("adodb.recordset") sqlmp="select * from Websen_vipgrade where roleid="&rs("gradeid") rsmp.open sqlmp,conn,1,1 if not rsmp.eof then if instr(rsmp("rolelist"),"qw")>0 then If is2weburl=1 Then'二级域名''''''''''''''''''''''''''''''''''''''''''''''''''' HOPE_body=HOPE_body&""&rs("qymc")&""&vbCrlf Else HOPE_body=HOPE_body&""&rs("qymc")&""&vbCrlf End If Else HOPE_body=HOPE_body&""&rs("qymc")&""&vbCrlf End If rsmp.close end if HOPE_body=HOPE_body&" " c="select title from Websen_cor_format where id="&rs("p_z_Z_LegalStatus")&"" Set rsc=Server.CreateObject("ADODB.Recordset") rsc.Open c,conn,1,1 If not rsc.Eof Then HOPE_body=HOPE_body&"（"&rsc("title")&"）
" End If rsc.Close Set rsc=Nothing HOPE_body=HOPE_body&"
[摘要]"&vbCrlf HOPE_body=HOPE_body&""&left(rs(RemoveHTML("qyjj")),55)&"……
"&vbCrlf '--是否使用的名片页------------------------------------------------------------ set rsmp1=server.CreateObject("adodb.recordset") sqlmp1="select * from Websen_vipgrade where roleid="&rs("gradeid") rsmp1.open sqlmp1,conn,1,1 FileFlag=rsmp1("FileFlag") if not rsmp1.eof then if instr(rsmp1("rolelist"),"qw")>0 then If is2weburl=1 Then HOPE_body=HOPE_body&" " Else HOPE_body=HOPE_body&" " End If End If HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"

"&VbCrLf HOPE_body=HOPE_body&"

" HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"
"&rs("trust_score")&"
" HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"

"&vbCrlf rsmp1.close end if If rs("country")="中国" Then HOPE_body=HOPE_body&rs("Sf")&"-"&rs("City") Else HOPE_body=HOPE_body&rs("country") End If If rs("tm")<>"" then HOPE_body=HOPE_body&"" End if HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&""&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"

"&vbCrlf i=i+1 icolor=icolor+1 If icolor>1 Then icolor=0 rowcount=rowcount-1 rs.Movenext loop End If '进行分页处理^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf If not (rs.Eof and rs.Bof) Then gopage=currentpage2 totalpage=mpage2 blockPage=Int((gopage-1)/10)*10+1 HOPE_body=HOPE_body&" 共 "&totalrec&" 条信息，每页 "&msg_per_page&" 条信息，共 "&mpage2&" 页，浏览 " If LCase(Request.ServerVariables("HTTPS")) = "off" Then strTemp = "http://" Else strTemp = "https://" End If strTemp = strTemp & CheckStr(Request.ServerVariables("SERVER_NAME")) If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & CheckStr(Request.ServerVariables("SERVER_PORT")) strTemp = strTemp & CheckStr(Request.ServerVariables("URL")) lenstrTemp=Len(strTemp)+1 If Instr(Left(linkfile,lenstrTemp),"?")>0 Then i=1 Do Until i > 10 or blockPage > mpage2 If blockPage=Int(gopage) Then HOPE_body=HOPE_body&""&blockPage&"" Else HOPE_body=HOPE_body&" "&blockPage&" " End If blockPage=blockPage+1 i = i + 1 Loop HOPE_body=HOPE_body&" 直接到第 " HOPE_body=HOPE_body&" " HOPE_body=HOPE_body&" 页" Else i=1 Do Until i > 10 OR blockPage > mpage2 If blockPage=int(gopage) Then HOPE_body=HOPE_body&""&blockPage&"" Else HOPE_body=HOPE_body&" "&blockPage&" " End If blockPage=blockPage+1 i = i + 1 Loop HOPE_body=HOPE_body&" 直接到第 " HOPE_body=HOPE_body&" " HOPE_body=HOPE_body&" 页" End If 'Startinfo=((gopage-1)*msg_per_page)+1 'Endinfo=gopage*msg_per_page 'If Endinfo>totalrec Then Endinfo=totalrec End If HOPE_body=HOPE_body&" "&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_Title=rssort2("typename_2") '网页标题头 HOPE_Sort=""&rssort1("sort")&"" '所属大类名称 HOPE_Type=""&rssort("typename")&"" '所属二类名称 HOPE_TradeGo="首页 > 公司库 > "&HOPE_Sort&" > "& HOPE_Type&" > "&HOPE_Title If totalrec="" Then totalrec=0 End If HOPE_TotalCor=""&totalrec&"" '此类公司数统计 rs.Close rssort.Close rssort1.Close rssort2.Close pencat=Hope_HtmlResult(pencat) Set fso = YXFSO If mpage2>1 Then If Cint(Request("page2"))<1 Then Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/offerlist/"&sttid&"-"&tytid&"-"&ttid&".html")) fout.Write pencat&"
" fout.Close End If Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/offerlist/"&sttid&"-"&tytid&"-"&ttid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close Else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/offerlist/"&sttid&"-"&tytid&"-"&ttid&".html")) sort_save.Write pencat&"
" sort_save.Close End If Set fso = Nothing If currentPage2 已生成*页/此类共*页:"¤tPage2&"/共"&mpage2&"页，" Response.Write "" Else Response.Write "" End If End If Set rs=Nothing conn.Close Set conn=Nothing %>