<% '本页的页首,页尾,全部读取后台模版中的系统搜索模版! lm2 =trim(request("lm2")) lm=trim(request("lm")) if lm2="" then lm2=lm if lm="" then lm=lm2 if lm2="" then lm2=0 if (not isNumeric(lm)) then lm=0 end if sql2 = "select * from lm where id="&lm2 Set rs2 = Server.CreateObject("ADODB.RecordSet") rs2.Open sql2,conn,1,1 if rs2.recordcount=0 then sql2 = "select * from lm order by id asc" Set rs2 = Server.CreateObject("ADODB.RecordSet") rs2.Open sql2,conn,1,1 end if if rs2.recordcount <> 0 then mb=trim(rs2("mb")) lmm=rs2("lm")&rs2("lm2")&rs2("lm3") lmmpic = rs2("lmmpic") 'Response.Write lmm if lm2="0" then lmm="所有栏目" '新加功能_默认一级模板==================================================================================== mbid123 = mb if mbid123 = "" or isnull(mbid123) then call lm_mbid(lm) '新加功能_默认一级模板==================================================================================== if mb<>"" then sql3 = "select * from newsmb where id="&clng(mb) Set rs3 = Server.CreateObject("ADODB.RecordSet") rs3.Open sql3,conn,1,1 if rs3.recordcount<>0 then listmb=rs3("listmb") listshu=rs3("list") tb=rs3("tb") lmnameid=rs3("lmname") newstime=rs3("newstime") newshit=rs3("newshit") openwindow=rs3("openwindow") icon=rs3("icon") news_list_model=rs3("newslistmodel") listmb=replace(listmb,"$$栏目名$$",lmm) %> <% listmb=replace(listmb,"$$sitename$$",m_sitname) listmb=replace(listmb,"$$栏目图$$","") listmb=replace(listmb,"$$路径$$",lm_lmpath()) listmb=replace(listmb,"$$LMID$$",lm) else Response.Write "模版设置不正确或已经被删除!" end if if instr(listmb,"$$列表$$")<>0 then nr=split(listmb,"$$列表$$") 'Response.Write lmid response.write nr(0) if news_list_model = "pic" then Response.Write pic_newslist(listshu,tb,lmname,openwindow,icon) elseif news_list_model = "s_pic" then Response.Write s_pic_newslist(listshu,tb,lmname,openwindow,icon) elseif news_list_model = "d_title" then Response.Write d_newslist(listshu,tb,lmname,openwindow,icon) elseif news_list_model = "line_newslist" then Response.Write line_newslist(listshu,tb,lmname,openwindow,icon) else Response.Write newslist(listshu,tb,lmname,openwindow,icon) end if 'Response.Write newslist(listshu,tb,lmnameid,openwindow,icon) Response.Write nr(1) else Response.Write "模版代码不正确,没有找到“$$列表$$”,不知道应该显示在哪里?" end if rs3.close:set rs3=nothing else Response.Write "模版代码不正确或已经被删除!" end if else Response.Write "模版没有找到或者没有设置" end if %> <% conn.close:set conn=nothing '新加功能_默认一级模板==================================================================================== sub lm_mbid(id) Set rs1 = Server.CreateObject("ADODB.RecordSet") rs1.Open "select * from lm where id="&id,conn,1,1 if isnull(rs1("mb")) then Set rs2 = Server.CreateObject("ADODB.RecordSet") rs2.Open "select * from lm where id="&clng(rs1("lmid")),conn,1,1 mb = rs2("mb") if isnull(rs2("mb")) then Set rs3 = Server.CreateObject("ADODB.RecordSet") rs3.Open "select * from lm where id="&clng(rs2("lmid")),conn,1,1 mb = rs3("mb") rs3.close set rs3 = nothing end if rs2.close set rs2 = nothing else mb = id end if rs1.close set rs1 = nothing end sub '新加功能_默认一级模板==================================================================================== %>