生成公司二级分类

<% '过滤内容中出现的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 '定义结束。 '接受xmlhttp对象传过来的值^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ id=Replace_Text(Request("id")) '接受xmlhttp对象传过来的值 If id<>"" Then '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^ start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dim fso,fmodify Set fso = YXFSO Set rs=Server.CreateObject("adodb.recordset") rs.Open ("select corporation_type from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1 If Not rs.Eof Then pencat=rs("corporation_type") End If Set rs=Server.CreateObject("adodb.recordset") rs.Open ("SELECT * FROM Websen_class_2 where typeID="&id&""),conn,1,1 If not rs.Eof Then ttid=rs("typeID") sttid=rs("sortID") End If rs.Close If ttid="" Then ttid=0 End If If sttid="" Then sttid=0 End If '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ msg_per_page=15 '查出详细信息只属于该二级分类的产品 ^^^^^^^^^^^^^^^^^^^^^ Set rs=Server.createobject("adodb.recordset") rs.Open ("select * from Websen_corporation where typeID="&ttid&" and flag=1 order by trust_score desc,id desc"),conn,1,1 '对具体的供应信息进行分页^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If not rs.Eof Then totalrec=RS.RecordCount'总记录条数 rs.Pagesize=msg_per_page '每页数 mpage2=rs.Pagecount '得到总页数 rowcount=msg_per_page 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="&ttid&""),conn,1,1 '该二级类别的下级类别的显示处理^^^^^^^^^^^^^^^^^^^^^^^^^ Set rstype=Server.createobject("adodb.recordset") rstype.Open ("select * from Websen_class_3 where typeid="&ttid&""),conn,1,1 If rstype.Eof Then HOPE_Type=HOPE_Type&"" Else HOPE_type=HOPE_type&"
" HOPE_Type=HOPE_Type&"
按分类筛选：

" do while not rstype.Eof '获取属于该类别公司总量^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Com_Count="" Set comrsc=Server.CreateObject("adodb.recordset") comcsql="select count(*) as totalcom from Websen_corporation where typeid_2="&rstype("typeid_2") comrsc.Open comcsql,conn,1,1 If not comrsc.Eof Then If comrsc("totalcom")>0 Then Com_Count="("&comrsc("totalcom")&")" Else Com_Count="" End If comrsc.Close End If '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Type=HOPE_Type&"
"&rstype("typename_2")&"" HOPE_Type=HOPE_Type&" "&Com_Count&" " a=a+1 If a=4 Then HOPE_Type=HOPE_Type&"
" a=0 End If rstype.movenext loop rstype.Close HOPE_Type=HOPE_Type&"

" End If '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '************** 开始读取内容开始 *************** 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(RemoveHTML(rs("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 rsmp1.close 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 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 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=rssort("typename") '网页标题头 HOPE_Sort=""&rssort1("sort")&"" '所属大类名称 HOPE_TradeGo="首页 > 公司库 > "&HOPE_Sort&" > "&HOPE_Title If totalrec="" Then totalrec=0 End If HOPE_TotalCor=""&totalrec&"" '此类公司数统计 rs.Close rssort.Close rssort1.Close '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^ end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If fso.FileExists(server.MapPath(HOPE_InstallDir&"corporation/trade/"&sttid&"-"&ttid&".html")) Then If kindtime<>"0" then Set fmodify = fso.GetFile(server.MapPath(HOPE_InstallDir&"corporation/trade/"&sttid&"-"&ttid&".html")) ShowDateModified = fmodify.DateLastModified dtime=DateDiff("s",ShowDateModified,now()) mtime=dtime/60 If trim(mtime)>=kindtime then pencat=Hope_HtmlResult(pencat) Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/trade/"&sttid&"-"&ttid&".html")) '如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fout.Write pencat&"
" fout.Close End If End If Else pencat=Hope_HtmlResult(pencat) Set foutc = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"corporation/trade/"&sttid&"-"&ttid&".html")) '如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ foutc.Write pencat&"
" foutc.Close End If Set fso = nothing conn.Close Set conn=nothing End If %>