<% set rs = server.CreateObject("adodb.recordset") classid = isnumer(safeRequest("classid",0),0) page = isnumer(safeRequest("page",0),1) prov = isnumer(safeRequest("p",0),0) tt = safeRequest("title",0) id = isnumer(safeRequest("id",0),0) trade_no= safeRequest("trade_no",0) code = safeRequest("code",0) ref = safeRequest("ref",0) if ref="" then ref = Request.ServerVariables("HTTP_REFERER") end if tpl.assign "code",code tpl.assign "page",page tpl.assign "prov",prov tpl.assign "tt",tt tpl.assign "ref",ref sql = "select * from channel where id="&classid rs.open sql,conn,1,1 if not rs.eof then father = isnumer(rs("father"),0) tplchr = rs("tplchr") tpllist = rs("tpllist") sons = isnumer(rs("sons"),0) channelid = rs("channel") tpl.assign "channelid",channelid tpl.assign "father",father end if rs.close 'and father=0 if tplchr = "" and sons > 0 then sql = "select top 1 * from channel where father="&classid&" order by serial desc,id asc" rs.open sql,conn,1,1 if not rs.eof then classid = rs("id") tplchr = tpllist end if rs.close end if '设置模版 if father > 0 then tplhtml = getfatherhtml(classid,"tpllist") else tplhtml = tplchr end if template= tpl.cache.read(tplhtml) if id > 0 then sql = "select * from myarticle where id="&id else sql = "select * from myarticle where classid="&classid&" and isdel=0 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 else tpl.assign "classid",classid end if rs.close if channelid=33 then if isnumer(Session(UserId),0)=0 then response.Redirect("list.asp?classid=31") end if sql = "select * from [user] where id="&isnumer(Session(UserId),0) rs.open sql,cns,1,1 if not rs.eof then For i = 0 TO rs.fields.count - 1 tpl.assign "mem"&rs.fields(i).name , rs.fields(i).Value Next end if rs.close end if if classid=38 then if isnumer(Session(UserId),0)=0 then response.Redirect("list.asp?classid=31&ref="&ref) end if end if if classid=42 then sql = "select * from yds where id="&id&" and uid="&isnumer(Session(UserId),0) rs.open sql,cns,1,1 if not rs.eof then For i = 0 TO rs.fields.count - 1 tpl.assign "yd_"&rs.fields(i).name , rs.fields(i).Value Next end if end if '读取模板 call tpl.display(template,true) '关闭数据库 Set tpl = nothing call closedb() %>