生成专项商机所有内容页

<% data_path="../../../" 'ACC连接数据库路径，对SQL无效 dir="no" numid="no" %> <% Set rs=Server.CreateObject("adodb.recordSet") rs.Open ("select vipinfo_detail 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("vipinfo_detail") 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("TopNew")>"" Then If ChkRequest(Request("TopNew")) Then TopNew=Request("TopNew") Else Response.Redirect (HOPE_InstallDir&"login/chklogin.asp?login=4") End If End If MaxPerPage=1 Set rs=Server.CreateObject("adodb.recordSet") If Request("all")="all" Then rs.Open ("select vipinfo_id,viptype from Websen_vipinfo order by dateandtime desc"),conn,1,1 ElseIf Request("all")="update" Then If Request("schtml")="开始生成从未生成的" Then rs.Open ("select vipinfo_id,viptype from Websen_vipinfo where html_pass=0 order by dateandtime desc"),conn,1,1 Else id1=replace(Request("id1"),"'","") id2=replace(Request("id2"),"'","") If Isnumeric(id2)=false or Isnumeric(id2)=false Then Response.Write " " :Response.End rs.Open ("select vipinfo_id,viptype from Websen_vipinfo where vipinfo_id between "&id1&" and "&id2&" order by dateandtime desc"),conn,1,1 End If End If If not rs.Eof Then rs.Pagesize=MaxPerPage mpage=rs.Pagecount '得到总条数 If currentPage>mpage Then Response.Write "生成完成，完成时间"&Now()&" " Response.End End If If TopNew>"" Then currentPage=mpage-TopNew rs.Move (currentPage-1)*MaxPerPage If mpage>=currentPage Then ttid=rs("vipinfo_id") typeid=rs("viptype") End If Else Response.Write "没有要生成的信息" Response.End End If rs.Close If typeid="" Then Response.Write "没有要生成的信息" Response.End End If HOPE_Sort="" sorttype="select * from Websen_vipinfo_class where typeid="&typeid&"" Set rssorttype=Server.CreateObject("adodb.recordSet") rssorttype.Open sorttype,conn,1,1 If not rssorttype.Eof Then HOPE_Sort=HOPE_Sort&""&rssorttype("type")&"" ttname=rssorttype("type") rssorttype.Close End If Set rs=Server.CreateObject("adodb.recordSet") rs.Open ("select * from Websen_vipinfo where vipinfo_id="&ttid&""),conn,1,1 dateandtime=rs("dateandtime") period=rs("vipperiod") Hope_Gsmc=rs("gsmc") Hope_Lxr=Hope_Lxr&"
"&rs("lxr")&"
email:"&rs("email")&"
电话:"&rs("phone")&"
公司地址:"&rs("gsdz")&"
传真:"&rs("fax")&"
邮编:"&rs("post")&"
" select case period case "一周" period=7 case "半月" period=15 case "一个月" period=30 case "三个月" period=90 case "六个月" period=180 case "一年" period=365 case "长期" period=1000 end select '标志此条信息为已经生存HTML conn.execute("update Websen_vipinfo set html_pass=1 where vipinfo_id="&ttid&"") HOPE_CountInfo=HOPE_CountInfo&""&changechr(rs("vipcontent"))&"" HOPE_AddTime=HOPE_AddTime&""&FormatDate(dateandtime,1)&"" HOPE_EndTime=HOPE_EndTime&""&FormatDate(dateandtime+period,1)&"" HOPE_AskId=ttid HOPE_TradeInfoID=ttid HOPE_Pic="" If rs("picture")<>"nopicture.gif" Then HOPE_Pic=" " Else HOPE_Pic="
无图
" End If HOPE_InfoPicTure=HOPE_InfoPicTure&"

" HOPE_InfoPicTure=HOPE_InfoPicTure&"
" HOPE_InfoPicTure=HOPE_InfoPicTure&"
" If rs("picture")<>"nopicture.gif" Then HOPE_InfoPicTure=HOPE_InfoPicTure&"650){this.width=650 }"" border=0>" Else HOPE_InfoPicTure=HOPE_InfoPicTure&" 无图 " End If HOPE_InfoPicTure=HOPE_InfoPicTure&" " HOPE_InfoPicTure=HOPE_InfoPicTure&"
" HOPE_InfoPicTure=HOPE_InfoPicTure&"

" Response.Write "
已生成/要生成的页面条数:"¤tPage-1&"/"&mpage&"个" If mpage " Else HOPE_TradeInfo="["&ttname&"]"&rs("vipshowname")&"" '页面标题 HOPE_Quyu=rs("country")&" > "&rs("city")&"" HOPE_JiaGe=rs("vippricetems")&"" ' 导航标签#HOPE_TradeGo#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HOPE_TradeGo="首页 > 专项商机 > "&HOPE_Sort pencat=Hope_HtmlResult(pencat) Set fso =YXFSO Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"vipinfo/offerdetail/"&typeid&"-"&ttid&".html")) sort_save.Write pencat sort_save.Close Response.Write "" End If rs.Close Set rs=nothing conn.Close Set conn=nothing Function changechr(fString) If Not IsNull(fString) Then fString = trim(fString) fString = replace(fString, "--", "——") fString = replace(fString, "%20", "") fString = replace(fString, "==", "") fString = replace(fString, ">", ">") fString = replace(fString, "<", "<") fString = Replace(fString, CHR(32), " ") fString = Replace(fString, CHR(9), " ") fString = Replace(fString, CHR(39), "'") fString = Replace(fString, CHR(13), "") fString = Replace(fString, CHR(10) & CHR(10), "

") fString = Replace(fString, CHR(10), "
") changechr = fString End If End Function %>