生成公司一级分类

<% 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 '定义结束。 Set rs=Server.createobject("adodb.recordSet") rs.Open ("select corporation_sort 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_sort") rs.Close End If 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_1 order by sortID desc"),conn,1,1 End If If not rs.Eof Then rs.pagesize=MaxPerPage mpage=rs.pagecount '得到总条数 If currentPage>mpage Then Response.Write "
生成完毕 完成时间："&now()&"" Response.end End If rs.move (currentPage-1)*MaxPerPage If mpage>=currentPage Then sortid=rs("sortid") sortname=rs("sort") End If End If rs.Close If sortid="" Then sortid=0 End If response.write "已生成/要生成的一级分类:"¤tPage-1&"/"&mpage&"个" If mpage " Else msg_per_page=15 If Request("all")="all" Then Set rs=Server.createobject("adodb.recordset") rs.Open ("select * from Websen_corporation where Websen_corporation.sortid="&sortid&" 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 %> <% '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_type=HOPE_type&"

" HOPE_type=HOPE_type&"
网站首页 > 公司信息 > "&sortname&"
按分类筛选：

" sqltype="SELECT * FROM Websen_class_2 WHERE sortid="&sortid Set rstype=Server.CreateObject("ADODB.Recordset") rstype.Open sqltype,conn,1,1 If Not rstype.Eof Then j=1 Do While Not rstype.Eof '^^^^^^^^^^^^^^^^^^^^^^^^^ start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '查询出属于第一类的二级分类下的所含小分类的总数 Set thirrs=Server.CreateObject("ADODB.Recordset") thirsql="SELECT COUNT(*)AS thircount FROM Websen_Class_3 WHERE typeid="&rstype("typeid") thirrs.Open thirsql,conn,1,1 If thirrs.Eof Then seCount_sale="" End If If not thirrs.Eof Then If thirrs("thircount")<=0 Then seCount_sale="" Else seCount_sale="("&thirrs("thircount")&")" End If thirrs.close End If '^^^^^^^^^^^^^^^^^^^^^^^^^ end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_type=HOPE_type&"
" HOPE_type=HOPE_type&""&rstype("typename")&" "&seCount_sale&"" HOPE_type=HOPE_type&" " If j MOD 5 = 0 Then HOPE_type=HOPE_type&"
" End If rstype.Movenext j=j+1 Loop Set rstype=Nothing End If HOPE_type=HOPE_type&"

" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '************** 开始读取内容开始 *************** HOPE_body=HOPE_body&"" If rs.Eof Then HOPE_body=HOPE_body&"
此类暂无公司信息
" Else 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 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 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 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '企业推荐榜：属于该行业的网盛通企业(显示5个作为网盛通指数最高的)^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Cor=HOPE_Cor&"

"&VbCrLf sql="select top 5 id,qymc,[user],sf,city from Websen_corporation where sortid="&sortid&" and flag=1 order by trust_score desc,id desc" Set rs= Server.CreateObject("ADODB.RecordSet") rs.Open sql,conn,1,1 If rs.Eof Then HOPE_Cor=HOPE_Cor&"
"&VbCrLf Else comi=1 Do While Not rs.Eof If is2weburl=1 Then HOPE_Cor=HOPE_Cor&"
·"&rs("qymc")&" 所属区域："&rs("sf")&""&rs("city")&"
"&VbCrLf Else HOPE_Cor=HOPE_Cor&"
·"&rs("qymc")&" 所属区域："&rs("sf")&"-"&rs("city")&"
"&VbCrLf End If HOPE_Cor=HOPE_Cor&"
"&VbCrLf If comi=5 Then exit do comi=comi+1 rs.Movenext Loop End If HOPE_Cor=HOPE_Cor&"

"&VbCrLf If totalrec="" Then totalrec=0 End If HOPE_TotalCor=""&totalrec&"" '此类公司数统计 HOPE_DH=totalrec rs.Close HOPE_Title=sortname '页面标题 '执行模版页中的标签替换操作^^^^^^^^^^^^^^^^^^^^^^^^ 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/trade/"&sortid&".html")) fout.Write pencat&"
" fout.Close End If Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/trade/"&sortid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close Else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/trade/"&sortid&".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 %>