<% Dim template ,id,channel Dim i,rs Set rs = Server.CreateObject("adodb.recordset") id = Isnumer( safeRequest("id",0) , 0 ) classid=Isnumer( safeRequest("classid",0) , 0 ) channel = 1 '建模板对像 tpl.cache.Folder = "/" & sitePath & "include/template/" template = tpl.cache.read("encounter.html") '注册系统变量 tpl.assign "SiteName",SiteName tpl.assign "SiteTitle",SiteTitle tpl.assign "SiteAddress",SiteAddress tpl.assign "SiteEmail",SiteEmail tpl.assign "SiteVideo",SiteVideo tpl.assign "SiteBottom",SiteBottom tpl.assign "SitePath",SitePath tpl.assign "classid",classid '查询频道 tpl.assign "channelid" , channel rs.open "select * from channel where id="&channel,conn,1,1 if not rs.eof then For i = 0 TO rs.fields.count - 1 tpl.assign "chr" & rs.fields(i).name , rs.fields(i).Value Next End If Rs.close '查询内容 if id > 0 then sql = "select * from myarticle where isdel=0 and id="&id else sql = "select * from myarticle where isdel=0 and channel="&channel&" order by serial desc,id desc" end if rs.open sql,conn,1,1 if not rs.eof then For i = 0 TO rs.fields.count - 1 tpl.assign rs.fields(i).name , rs.fields(i).Value Next end if Rs.close '读取模板 call tpl.display(template,true) '关闭数据库 Set tpl = nothing call closedb() %>