<% set rs = server.CreateObject("adodb.recordset") id = isnumer(safeRequest("id",0),0) sql = "select * from myarticle where id="&id&" and isdel=0" rs.open sql,conn,1,1 if not rs.eof then classid = rs("classid") tpl.assign "channelid",rs("channel") For i = 0 TO rs.fields.count - 1 tpl.assign rs.fields(i).name , rs.fields(i).Value Next end if rs.close sql = "select * from channel where id="&isnumer(classid,0) rs.open sql,conn,1,1 if not rs.eof then if rs("father") > 0 then tplhtml = getfatherhtml(classid,"tplpage") else tplhtml = rs("tplpage") end if end if rs.close '设置模版 template= tpl.cache.read(tplhtml) '读取模板 call tpl.display(template,true) '关闭数据库 Set tpl = nothing call closedb() %>