<% '#################################### '## Application: Aleza Portal '## File Name: redir.asp '## File Version: 1.1b '#################################### %> <% Dim linkRec Dim catRec Dim link Dim hits Dim catid Dim tree Dim newUrl Dim lday Dim lmonth Set objConn = Server.CreateObject ("ADODB.Connection") Set linkRec = Server.CreateObject ("ADODB.Recordset") Set catRec = Server.CreateObject ("ADODB.Recordset") 'get current link link = request.querystring("link") link = cint(link) tree = Request.QueryString("tree") if tree = "" then tree = 0 end if 'Open database objConn.Open strConnect linkRec.Open "SELECT linktype, url, catid FROM links WHERE linkid = " & link & ";", objConn, 3, 3, 1 if linkRec.EOF then Response.Redirect "default.asp" else catid = linkRec("catid") catRec.Open "SELECT ldayout, lmonthout FROM cats WHERE catid = " & catid & ";", objConn, 3, 3, 1 if linkRec("linktype") = 0 then newUrl = linkRec("url") else newurl = "display" & linkRec("linktype") & ".asp?func=display&resid=" & link & "&tree=" & tree end if '$$$$$$$$$$$$$$$ OUTBOUND TRAFFIC COUNTER $$$$$$$$$$$$$$$$$ lday = catRec("ldayout") lmonth = catRec("lmonthout") if lday = day(now()) then objConn.Execute "UPDATE cats SET dhitsout = dhitsout + 1 WHERE catid = " & catid else objConn.Execute "UPDATE cats SET ldayout = "& day(now()) &", dhitsout = 1 WHERE catid = " & catid end if 'Now the months if lmonth = month(now()) then objConn.Execute "UPDATE cats SET mhitsout = mhitsout + 1 WHERE catid = " & catid else objConn.Execute "UPDATE cats SET lmonthout = "& month(now()) &", mhitsout = 1 WHERE catid = " & catid end if 'And the total hits objConn.Execute "UPDATE cats SET cats.hitsout = cats.hitsout + 1 WHERE catid = " & catid '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ objConn.Execute "UPDATE links SET links.hits = links.hits + 1 WHERE linkid = " & link end if Set linkRec = Nothing Set catRec = Nothing objConn.Close Set objConn = Nothing response.redirect newUrl %>