生成产品二级分类

<% 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 productshow_type 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("productshow_type") 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_2 order by typeID 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_2 Where typeID between "&id1&" and "&id2&" order by typeID 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") sttid=rs("sortID") End If End If rs.Close If ttid="" Then ttid=0 End If If sttid="" Then sttid=0 End If Response.Write "已生成/要生成的二级分类:"¤tPage-1&"/"&mpage&"个" If mpage " Else '商品比较标签#HOPE_BJ(typeid)#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '参数：typeid----1 为横向分单元格显示；0--为纵向分行显示 Function HOPE_BJ(typeid) If typeid<=0 Then typeid=0 Else typeid=1 End If strs="" strs="
" HOPE_BJ=strs End Function '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ msg_per_page=15 If Request("all")="all" or Request("all")="update" Then Set rs=Server.CreateObject("adodb.recordSet") rs.Open ("select Websen_productshow.*,Websen_corporation.id as corid,Websen_corporation.flag as corflag,Websen_corporation.qymc,Websen_corporation.tm,Websen_corporation.[user],Websen_corporation.msn,Websen_corporation.gradeid,Websen_corporation.tm,Websen_corporation.country,Websen_corporation.sf,Websen_corporation.city,Websen_corporation.web,Websen_corporation.url,Websen_corporation.trust_score from Websen_productshow,Websen_corporation where Websen_productshow.typeid="&ttid&" and Websen_corporation.id=Websen_productshow.gsid and Websen_productshow.flag=1 order by Websen_corporation.trust_score desc,websen_productshow.idate 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="&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 If totalrec="" Then totalrec=0 End If HOPE_TotalRec=totalrec '此类求购数统计 '^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Type=HOPE_Type&"
"&rstype("typename_2")&"" HOPE_Type=HOPE_Type&" "&thiCount&" " a=a+1 If a=5 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 jjcom=1 i=1 HOPE_body=HOPE_body&"
" do while not rs.Eof and rowcount > 0 jjcom = jjcom + 1 If jjcom mod 2 =0 Then colors="#FFFFFF" Else colors="#F6F6F6" End If HOPE_body=HOPE_body&"

" HOPE_body=HOPE_body&"
" If rs("picture")<>"../../UploadFile/nopicture.gif" or rs("picture")<>"" Then 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&""&left(rs("Cpmc"),20)&" ["&year(rs("idate"))&"-"&month(rs("idate"))&"-"&day(rs("idate"))&"] [摘要]"&Left(RemoveHTML(rs("xxsm")),40)&"...... " '--是否使用的名片页------------------------------------------------------------ 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 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 rsmp1.close end if '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_body=HOPE_body&" | " HOPE_body=HOPE_body&" | "&vbCrlf HOPE_body=HOPE_body&"" HOPE_body=HOPE_body&" "&vbCrlf HOPE_body=HOPE_body&" | "&rs("trust_score")&" | " If rs("tm")<>"" then HOPE_body=HOPE_body&" "&rs("Cpcd")&"" End if HOPE_body=HOPE_body&"
" HOPE_body=HOPE_body&"

" 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&"
" HOPE_Title=rssort("typename") '网页标题头 HOPE_TradeGo="首页 > 产品库 > "&rssort1("sort")&" > "&HOPE_Title '属于该行业的推荐的网盛通会员的产品^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set rstjy=Server.CreateObject("ADODB.Recordset") sqltjy="select top 15 Websen_productshow.id,Websen_productshow.sortid,Websen_productshow.typeid,Websen_productshow.typeid_2,Websen_productshow.Cpmc from Websen_productshow,Websen_corporation where Websen_productshow.GsID=Websen_corporation.id and Websen_corporation.Tjbz like '%0%' and Websen_productshow.flag=1 and Websen_productshow.sortid="&sttid&" and Websen_productshow.typeid="&ttid&" and Websen_productshow.typeid_2=0 and Websen_corporation.flag=1 order by Websen_corporation.trust_score desc,websen_productshow.idate 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("cpmc")&"
" 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 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&"productshow/trade/"&sttid&"-"&ttid&".html")) fout.Write pencat&"
" fout.Close End If Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"productshow/trade/"&sttid&"-"&ttid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close Else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"productshow/trade/"&sttid&"-"&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 %>