生成供应三级分类

<% 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 tradeinfo_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("tradeinfo_type2") 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_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=10 If Request("all")="all" OR Request("all")="update" Then Set rs=Server.CreateObject("adodb.recordset") rs.Open ("select Websen_info.*,Websen_corporation.id,Websen_corporation.msn,Websen_corporation.msn,Websen_corporation.flag as corflag,Websen_corporation.qymc,Websen_corporation.tm,Websen_corporation.gradeid,Websen_corporation.[user],Websen_corporation.country,Websen_corporation.sf,Websen_corporation.city,Websen_corporation.web,Websen_corporation.url,Websen_corporation.trust_score from Websen_Info,Websen_corporation where Websen_info.typeid_2="&ttid&" and Websen_info.type='卖' and Websen_corporation.id=Websen_info.gsid and Websen_info.flag=1 order by Websen_corporation.trust_score desc,Websen_info.dateandtime 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 i=1 'HOPE_body用于显示页面的主题分类信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_body=HOPE_body&"
" If rs.Eof Then HOPE_body=HOPE_body&"
暂无此类具体供应信息
" Else 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 HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf If rs("draw")<>"" Then HOPE_body=HOPE_body&"" HOPE_body=HOPE_body&" " Else 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&"

"&Left(rs("showname"),20)&" ["&rs("dateandtime")&"]
[摘要]"&Left(RemoveHTML(rs("content")),40)&"......
"&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")&"" Else HOPE_body=HOPE_body&""&rs("qymc")&"" End If Else HOPE_body=HOPE_body&""&rs("qymc")&"" end if rsmp.close end if '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '--是否使用的名片页------------------------------------------------------------ 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 '用于二级域名处理^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ end if rsmp1.close end if '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 HOPE_body=HOPE_body&"
"&vbCrlf If rs("tm")<>"" then HOPE_body=HOPE_body&"
" End if If rs("country")="中国" Then HOPE_body=HOPE_body&""&rs("sf")&"省-"&rs("city")&"市" Else HOPE_body=HOPE_body&""&rs("country")&"" 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=rssort2("typename_2")&"" '网页标题头 '所属大类名称^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Sort=""&rssort1("sort")&"" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '所属二类名称^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Type=""&rssort("typename")&"" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '此类供应数统计^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If totalrec="" Then totalrec=0 End If HOPE_TotalRec="("&totalrec&")" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '^导航标签#HOPE_TradeGo#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_TradeGo="首页 > 我要供应 > "&HOPE_Sort&" > "&HOPE_Type&" > "&HOPE_Title&"" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '属于该行业的推荐的网盛通会员的供应信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set rstjy=Server.CreateObject("ADODB.Recordset") sqltjy="select top 15 Websen_Info.showname,Websen_Info.Info_ID,Websen_Info.sortid,Websen_Info.typeid,Websen_Info.typeid_2 from Websen_Info,Websen_corporation where Websen_Info.Gsid=Websen_corporation.id and Websen_corporation.Tjbz like '%0%' and Websen_corporation.flag=1 and Websen_Info.sortid="&sttid&" and Websen_Info.typeid="&tytid&" and Websen_Info.typeid_2="&ttid&" and Websen_Info.type='卖' order by trust_score desc,Websen_info.dateandtime desc" rstjy.Open sqltjy,conn,1,1 If rstjy.Eof Then tjcompany="暂无" End If If Not rstjy.Eof Then tjcompany="" End If If Not rstjy.Eof Then tji=1 tjcompany="" Do While Not rstjy.Eof tjcompany=tjcompany&"．"&rstjy("showname")&"
" If tji=15 Then Exit Do tji=tji+1 rstjy.Movenext Loop rstjy.Close End If HOPE_TjCom=tjcompany '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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&"tradeinfo/offerlist/"&sttid&"-"&tytid&"-"&ttid&".html")) fout.Write pencat&"
" fout.Close End If '生成分页页面^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"tradeinfo/offerlist/"&sttid&"-"&tytid&"-"&ttid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"tradeinfo/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 %>