生成品牌二级分类

<% data_path="../../../" 'ACC连接数据库路径，对SQL无效 dir="no" numid="no" %> <% '获取取模板^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set rs=Server.CreateObject("ADODB.Recordset") rs.Open ("select brand_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("brand_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 '处理生成的内容信息每页显示10条信息 msg_per_page=15 If Request("all")="all" or Request("all")="update" Then Set rs=Server.CreateObject("ADODB.Recordset") rs.Open ("select * from Websen_post where type_class2="&ttid&" and flag=1 order by 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="&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&"

" HOPE_Type=HOPE_Type&"

" HOPE_Type=HOPE_Type&"

" HOPE_Type=HOPE_Type&"
" Do while not rstype.Eof HOPE_Type=HOPE_Type&"
"&rstype("typename_2")&"" HOPE_Type=HOPE_Type&" " '用于显示属于该第三级分类中的信息总量 Set prors=Server.CreateObject("ADODB.Recordset") prosql="select count(id)as CountPro from Websen_post where type_class2="&rstype("typeid_2")&" flag=1" prors.Open prosql,conn,1,1 If prors.Eof Then HOPE_Type=HOPE_Type&"" End If If not prors.Eof Then If prors("CountPro")<=0 Then HOPE_Type=HOPE_Type&"" Else HOPE_Type=HOPE_Type&"("&prors("CountPro")&")" prors.Close End If End If HOPE_Type=HOPE_Type&" " 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 '--------------------------循环显示品牌信息-------------------------------------------------------------- HOPE_body=HOPE_body&"
" If rs.Eof Then HOPE_body=HOPE_body&"
此类暂无品牌信息!
" Else HOPE_body=HOPE_body&"
" HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"
"&vbCrlf for i=1 to 10 HOPE_body=HOPE_body&"
" for j=1 to 3 if rs.eof then exit for end if username=rs("username") set rsmp=server.CreateObject("adodb.recordset") sqlmp="select * from Websen_corporation where [User]='"&username&"'" rsmp.open sqlmp,conn,1,1 logo=rsmp("C_logo") rsmp.close set rsmp=nothing HOPE_body=HOPE_body&"

"&vbCrlf HOPE_body=HOPE_body&"

" HOPE_body=HOPE_body&"" HOPE_body=HOPE_body&"
" HOPE_body=HOPE_body&""&left(rs("project"),12)&" " HOPE_body=HOPE_body&"

"&vbCrlf rs.Movenext next i=i+1 HOPE_body=HOPE_body&"

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

"&vbCrlf 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 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 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 If blockPage = 1 Then HOPE_body=HOPE_body&"【←前10页 " Else HOPE_body=HOPE_body&"【←前10页 " End If 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 If blockPage > totalpage Then HOPE_body=HOPE_body&" 后10页→】" Else HOPE_body=HOPE_body&" 后10页→】" End If HOPE_body=HOPE_body&" 直接到第 " HOPE_body=HOPE_body&"
" HOPE_body=HOPE_body&" 页
" Else If blockPage = 1 Then HOPE_body=HOPE_body&"【←前10页 " Else HOPE_body=HOPE_body&"【←前10页 " End If 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 If blockPage > totalpage Then HOPE_body=HOPE_body&" 后10页→】" Else HOPE_body=HOPE_body&" 后10页→】" for i=1 to totalpage HOPE_body=HOPE_body&""&i&"" next 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 HOPE_body=HOPE_body&" 共 "&totalrec&" 条信息 当前显示第 "&Startinfo&" - "&Endinfo&" 条 每页 "&msg_per_page&" 条信息 共 "&mpage2&" 页" 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 HOPE_body=HOPE_body&"

"&vbCrlf '************** 读取内容结束 *************** HOPE_Title=rssort("typename") '网页标题头 '所属大类名称^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_Sort=""&rssort1("sort")&"" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' 导航标签#HOPE_TradeGo#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_TradeGo=""&HOPE_Title&"" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If totalrec="" Then totalrec=0 End If HOPE_TotalRec=totalrec '此类求购数统计 '属于该行业的推荐的网盛通会员的供应信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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="&ttid&" and Websen_Info.typeid_2=0 and Websen_Info.type='卖' order by trust_score 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 ' 替换标签的函数调用 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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&"brand/trade/"&sttid&"-"&ttid&".html")) fout.Write pencat&"
" fout.Close End If Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/trade/"&sttid&"-"&ttid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close Else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/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 %>