<% articleid=request("a") zoneid=request("z") print=request("print") nocache=request("nocache") if request.cookies("xlaANMadmin")("lvl")="" then condition="(status=1 or status=4) and " if (articleid="" or not(isnumeric(articleid))) then articleid=0 call getconnection() set conn=server.createobject("ADODB.Connection") conn.open connection if print="" then psql="select articleurl,zoneid,template from vArticlesZones where " & condition & " articleid="&articleid if zoneid<>"" and isnumeric(zoneid) then psql=psql & " and zoneid="&zoneid Set rs = conn.execute(psql) if rs.eof then psql="select articleurl,zoneid,template from vArticlesZones where " & condition & " articleid="&articleid set rs=conn.execute(psql) end if if not(rs.eof) then conn.execute("update articles set clicks=clicks+1 where articleid="&articleid) articleurl=rs("articleurl") zoneid=rs("zoneid") template=rs("template") else rs.close set rs=nothing conn.close set conn=nothing response.redirect siteurl response.end end if rs.close set rs=nothing end if conn.close set conn=nothing '/// Go to the URL if any /// if articleurl<>"" then response.redirect articleurl response.end end if '/// is an ASP Template? /// if lcase(right(template,4))=".asp" then isasp=template &"?articleid="&articleid&"&zoneid="&zoneid response.redirect "templates/"&isasp response.end end if response.buffer=true response.flush '/// Article Cache /// if articlecache<>"" then dim resultfile resultfile="" call getcache("article",nocache) end if call anmviewarticle(articleid,zoneid) %>