<% 'Set the buffer for viewing an article Response.Buffer=true Response.Flush %> <% 'Get the values from request articleid = Request.QueryString("a") zoneid = Request.QueryString("z") requestprint = Request.QueryString("print") nocache = Request.QueryString("nocache") 'DO CACHE: If article has cache, show the cache data and stop viewing resultfile="" 'call GetCache("article", nocache) 'If the article is open on the firstime or article's cache has been deleted, 'calculate the article's content and write into the new cache file 'Normalize the ID of article if (articleid="" or not(isnumeric(articleid))) then articleid=0 if articleid=0 then Response.End 'Normalize the ID of zone if (zoneid="" or not(isnumeric(zoneid))) then zoneid=0 'If user doesn't provide the ID of zone, the the first zone that the article belong to if zoneid=0 then 'Get article from database set conn=server.createobject("ADODB.Connection") conn.open connection psql="SELECT zoneid FROM vArticlesZones2 where articles.articleid="&articleid set rs = conn.execute(psql) if not rs.EOF then zoneid=rs("zoneid") rs.close set rs=nothing conn.close set conn=nothing end if 'If no cache, view an article and create the cache file call ViewArticle(articleid, zoneid, nocache) %>