生成品牌一级分类

<% data_path="../../../" 'ACC连接数据库路径，对SQL无效 dir="no" numid="no" %> <% '读取模板 Set rs1=Server.CreateObject("adodb.recordSet") rs1.Open ("select brand_sort from Websen_worldec_Temp where yx_selected=1"),conn,1,1 If rs1.Eof Then Response.Write("
对不起！该模版不存在！ 关闭") Response.End() End If If Not rs1.Eof Then pencat=rs1("brand_sort") rs1.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 '得到总页数 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&"个" response.Write sortid '^^^^^^^^^^^^^^^^^^^^^^^^^^返回一级分类页面 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If mpage " Else HOPE_type=HOPE_type&"
" HOPE_type=HOPE_type&"

" HOPE_type=HOPE_type&"

" 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 '^^^^^^^^^^^^^^^^^^^^^^^^^ end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '^^^^^^^^^^^^^^^^^^^^^^^^^ 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&"

" '获取替换标签的内容^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ msg_per_page=15 If Request("all")="all" Then Set rs=Server.CreateObject("adodb.recordset") rs.Open ("select * from websen_post where type_class1="&sortid&" 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 %> <% 'HOPE_body用于显示页面的主题分类信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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=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页→】" End If 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 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 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&"brand/trade/"&sortid&".html")) fout.Write pencat&"
" fout.Close End If '生成分页页面^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/trade/"&sortid&"-p"&tttid&".html")) fout.Write pencat&"
" fout.Close '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ else Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/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 %>