<% On Error Resume Next setLocale server_locale redirURL = Request.Querystring.Item(1) Select Case Request.Querystring.Item(2) Case "sortads": Sess_Array(45) = "sortads": TriggerOrder Case "sortnick": Sess_Array(45) = "sortnick": TriggerOrder Case "sortdate": Sess_Array(45) = "sortdate": TriggerOrder Case "sortcity": Sess_Array(45) = "sortcity": TriggerOrder Case "0": Sess_Array(56) = "0": Sess_Array(27) = Empty Case "1": Sess_Array(56) = "1": Sess_Array(27) = Empty Case "2": Sess_Array(56) = "2": Sess_Array(27) = Empty Case "3": Sess_Array(56) = "3": Sess_Array(27) = Empty Case "4": Sess_Array(56) = "4": Sess_Array(27) = Empty Case "5": Sess_Array(56) = "5": Sess_Array(27) = Empty Case "7": ResetAll Case "8": Sess_Array(56) = "8": Sess_Array(27) = Empty Case "removeimage": remimg(false) Case "removeimageadmin": remimg(true) Case "switchcat" Sess_Array(26) = Empty Sess_Array(41) = Empty Sess_Array(24) = Empty Sess_Array(18) = Empty Sess_Array(39) = Empty Sess_Array(2) = Empty Case "9": page = Request.Querystring.Item(3): Sess_Array(27) = page Case "10": page = Request.Querystring.Item(3): Sess_Array(26) = page Case "11" page = Request.Querystring.Item(3) ipage = "&page=" & page If instr(redirURL, "&page=") <> 0 then redirURL = Left(redirURL, Len(redirURL) - (Len(redirURL) - InStr(redirURL, "&page=") + 1)) & ipage Else: redirURL = redirURL & ipage End If Case "12": page = Request.Querystring.Item(3): Sess_Array(16) = page Case "13" If Sess_Array(48) = Session.SessionID then bName = Request.Querystring.Item(3) On Error Resume Next With CreateObject("Scripting.FileSystemObject") .DeleteFile server.mappath(bnrLocation) & "\" & bName End With On Error Goto 0 End If Case "14": page = Request.Querystring.Item(3): Sess_Array(18) = page Case "15": page = Request.Querystring.Item(3): Sess_Array(0) = page Case "17": addToFavorites Case "18": hotlist(False) Case "19": hotlist(True) Case "20": addToEditorPick Case "32": removeEditorPick Case "21": page = Request.Querystring.Item(3): Sess_Array(13) = page Case "22": page = Request.Querystring.Item(3): Sess_Array(4) = page Case "23": page = Request.Querystring.Item(3): Sess_Array(5) = page Case "24": Sess_Array(7) = Request.Querystring.Item(3): Sess_Array(6) = Request.Querystring.Item(4) Case "25": Sess_Array(6) = 0: Sess_Array(7) = 0 Case "26": page = Request.Querystring.Item(3): Sess_Array(8) = page Case "27": page = Request.Querystring.Item(3): Sess_Array(9) = page Case "30": page = Request.Querystring.Item(3): Sess_Array(22) = page Case "31": page = Request.Querystring.Item(3): Sess_Array(21) = page Case "sortimageup" : Call sortImage("up") Case "sortimagedown": Call sortImage("down") Case "enable": adModify(True) Case "disable": adModify(False) Case "cache": adID = request("id"): Call cacheAdsLight(adID, 0, False) Case "cacheall": Call CacheAll() Case "delcache": catID = request("id"): Call delCache(catID) Case "WY" val = Request.Querystring.Item(3) If val = "true" then Application("WYSIWYG" & strUnique) = "1" Else Application("WYSIWYG" & strUnique) = Empty End If Case "isHTML" val = Request.Querystring.Item(3) If val = "true" then Application("isHTML" & strUnique) = "1" Else Application("isHTML" & strUnique) = Empty End If Case "startOver": clearAll Case "hexpand": Call hExpand(True) Case "hcollapse": Call hExpand(False) Case "hexpandAll": Call hExpandAll(True) Case "hcollapseAll": Call hExpandAll(False) Case "resetelist": Call ResetElist() Case "33": setMover() Case "34": setMover3() Case "faq": Sess_Array(69) = Request.Querystring.Item(3) Case "35": Sess_Array(77) = Request.Querystring.Item(3) Case "36": Sess_Array(77) = Empty Case "37": page = Request.Querystring.Item(3): Sess_Array(78) = page End Select UpdateSessions True Response.Redirect redirURL Sub setMover() If Not Sess_Array(48) = Session.SessionID then Exit Sub Sess_Array(64) = Request.Querystring.Item(3) Sess_Array(65) = "0" redirURL = redirURL & "?cid=" & Split(Sess_Array(64), "|")(0) & "&sid=" & Split(Sess_Array(64), "|")(1) End Sub Sub setMover3() If Not Sess_Array(48) = Session.SessionID then Exit Sub Sess_Array(64) = Request.Querystring.Item(3) Sess_Array(65) = Split(Sess_Array(64), "|")(2) redirURL = redirURL & "?cid=" & Split(Sess_Array(64), "|")(0) & "&sid=" & Split(Sess_Array(64), "|")(1) & "&3id=" & Sess_Array(65) End Sub Sub TriggerOrder() If Sess_Array(26) = 1 then Sess_Array(26) = 0 Else Sess_Array(26) = 1 End If End Sub Sub ResetAll() Sess_Array(56) = Empty Sess_Array(52) = Empty Sess_Array(27) = Empty End Sub Sub remimg(delete) imgName = CStr(Request.Querystring.Item(3)) imgStr = Sess_Array(36) imgArray = Split(imgStr, sf) For L = 0 to Ubound(imgArray) - 1 nextImgName = CStr(Split(imgArray(L), "|")(0)) If not nextImgName = imgName then newImgStr = newImgStr & imgArray(L) & sf End If Next Sess_Array(36) = newImgStr Sess_Array(2) = Sess_Array(2) - 1 If delete then On Error Resume Next Set objFile = Server.CreateObject("Scripting.FileSystemObject") objFile.DeleteFile(Server.Mappath(upload & imgName)) objFile.DeleteFile(Server.Mappath(upload & gettf(imgName))) On error goto 0 End If End Sub Sub sortImage(act) markImgName = CStr(Request.Querystring.Item(3)) imgStr = Sess_Array(36) imgArray = Split(imgStr, sf) For I = 0 to Ubound(imgArray) - 1 nextRec = imgArray(I) nextImgName = CStr(Split(nextRec, "|")(0)) If nextImgName = markImgName then Select Case act Case "up" downImg = imgArray(I-1) imgArray(I-1) = nextRec imgArray(I) = downImg newImgStr = Join(imgArray, sf) Case "down" upImg = imgArray(I+1) imgArray(I+1) = nextRec imgArray(I) = upImg newImgStr = Join(imgArray, sf) End Select Sess_Array(36) = newImgStr Exit For End If Next End Sub Sub adModify(act) adID = Request.Querystring.Item(3) strSQL = "SELECT catID,scatID,userID,cat3rdID FROM " & tablPfx & "Ads WHERE adID = '" & adID & "';" set rsd = objConn.Execute(strSQL) If not rsd.EOF then catID = CLng(rsd(0)) scatID = CLng(rsd(1)) cat3rdID = CLng(rsd(3)) userID = rsd(2) If Sess_Array(48) = Session.SessionID Or CBool(Sess_Array(35)) Or CStr(userID) = CStr(Sess_Array(29)) then UpdateList act, catID, scatID, cat3rdID If act then status = 1: Else: status = 3 strSQL = "UPDATE " & tablPfx & "Ads SET status = " & status & " WHERE adID = '" & adID & "';" objConn.Execute(strSQL) End If End If rsd.close Application("cl_marquee" & strUnique) = Empty End Sub Sub addToFavorites() userID = CStr(Sess_Array(29)) adID = request("id") If Len(userID) < 6 Or Not isNumeric(userID) then Exit Sub favor = objConn.Execute("SELECT favor FROM " & tablUPfx & "User WHERE userID = " & CLng(userID) & ";")(0) strSQL = "UPDATE " & tablUPfx & "User SET favor = '" & favor & " " & adID & "' WHERE (userID = " & CLng(userID) & ") AND (favor IS NULL OR favor NOT LIKE '%" & adID & "%');" objConn.Execute(strSQL) End Sub Sub hotlist(act) If Not Sess_Array(48) = Session.SessionID then Exit Sub adID = Request.Querystring.Item(3) If act then hlist = 1: Else: hlist = 0 strSQL = "UPDATE " & tablPfx & "Ads SET hotlist = " & hlist & " WHERE adID = '" & adID & "';" objConn.Execute(strSQL) End Sub Sub addToEditorPick() If Not Sess_Array(48) = Session.SessionID then Exit Sub adID = request("id") objConn.Execute("UPDATE " & tablPfx & "Ads SET epick = 1 WHERE adID = '" & adID & "';") End Sub Sub removeEditorPick() If Not Sess_Array(48) = Session.SessionID then Exit Sub adID = request("id") objConn.Execute("UPDATE " & tablPfx & "Ads SET epick = 0 WHERE adID = '" & adID & "';") End Sub Sub CacheAll() End Sub Sub delCache(ID) If Not Sess_Array(48) = Session.SessionID then Exit Sub Server.ScriptTimeout = 20000 Set objFile = Server.CreateObject("Scripting.FileSystemObject") Set fld = objFile.GetFolder(Server.Mappath(ad_cache)) Set subf = fld.SubFolders Set fc = fld.files ID = CStr(ID) Select Case ID Case "0" For each fl in fc objFile.DeleteFile(fl) Next For Each sfolder in subf objFile.DeleteFolder(sfolder) Next Case Else For Each sfolder in subf nextSubName = sfolder.Name If Right(nextSubName, 5) = ID Then objFile.DeleteFolder sfolder If objFile.FileExists(fld & "\" & nextSubName & ".asp") Then objFile.DeleteFile fld & "\" & nextSubName & ".asp" Exit For End If Next End Select End Sub Sub clearAll() Sess_Array(14) = Empty Sess_Array(10) = Empty Sess_Array(12) = Empty Sess_Array(1) = Empty Sess_Array(46) = Empty Sess_Array(2) = Empty End Sub Sub hExpand(act) ID = CLng(Request.Querystring.Item(3)) If act then isexpand = 1: Else: isexpand = 0 strSQL = "UPDATE " & tablPfx & "Help SET isexpand = " & isexpand & " WHERE ID = " & ID & ";" objConn.Execute(strSQL) End Sub Sub hExpandAll(act) If act then isexpand = 1: Else: isexpand = 0 strSQL = "UPDATE " & tablPfx & "Help SET isexpand = " & isexpand & ";" objConn.Execute(strSQL) End Sub Sub ResetElist() objConn.Execute("UPDATE " & tablUPfx & "User SET issent = 0;") Application("Sent_Elist" & strUnique) = Empty Application("Total_Elist" & strUnique) = Empty End Sub Response.Write databaseType & rcver %>