<% setLocale server_locale If session("admin_loggedin" & strSUnique) = Session.SessionID Or session("user_logged_moderator" & strSUnique) then moderator = True If CStr(session("user_logged_ID" & strSUnique)) = Empty And Not moderator then Response.Redirect "register.asp" userID = CLng(Request.Form("userID")) If Not moderator And Not CStr(session("user_logged_ID" & strSUnique)) = CStr(userID) then Response.Redirect "default.asp" Application("cl_marquee" & strUnique) = Empty Dim uSubject, uBody sdd = dd(objConn) adID = Request.Form("adID") subject = Replace(Request.Form("P1"), chr(34), "''") subject = sq(subject) subject = Replace(Replace(subject, "<", "<"), ">", ">") phone = sq(Request.Form("P2")) URL = sq(HTMLEncode(Request.Form("P3"))) URL = Replace(URL, "http://", "") URL = Replace(URL, "https://", "") If len(URL) > 0 then URL = Request.Form("PP3") & URL onlineImg = sq(Request.Form("P4")) catID = CLng(Request.Form("catID")) subcatID = CLng(Request.Form("subcatID")) descr = Request.Form("P5") Set re = new RegExp re.global=true re.ignoreCase=true re.pattern = "(") End If descr = sq(descr) msgNotAllow = "
" & strText_InvalidRequest & "

" msgUpdated = "
" & strText_AdModified & "

" If moderate and not moderator then active = 0: Else: active = 1 strUpdate = "SELECT " & tablPfx & "Ads.* from " & tablPfx & "Ads WHERE adID = '" & adID & "';" With rs .CursorLocation = 3: .CursorType = 2: .LockType = 3 .Open strUpdate, strConn If rs.EOF then notAllow = True Else status = CLng(rs(15)) Select Case status Case 2: notAllow = True Case 0: active = 0 End Select chkCatID = CLng(rs(2)) chksubCatID = CLng(rs(3)) posted = Cdate(rs(5)) If Not catID = chkCatID Or Not subcatID = chksubCatID then notAllow = True End If .close End With If notAllow then msg = msgNotAllow Else postExpire = DateAdd("d", CLng(Request.Form("S1")), posted) postExpire = DateAdd("h", -timeOffset, postExpire) postExpire = ConvDate(postExpire) strSQL = "UPDATE " & tablPfx & "Ads SET " strSQL = strSQL & "edate = " & sdd & postExpire & sdd & ", " strSQL = strSQL & "subject = '" & subject & "', " strSQL = strSQL & "phone = '" & phone & "', " strSQL = strSQL & "web = '" & URL & "', " strSQL = strSQL & "body = '" & descr & "', " strSQL = strSQL & "IP = '" & Request.ServerVariables("REMOTE_ADDR") & "', " strSQL = strSQL & "webimage = '" & onlineImg & "', " strSQL = strSQL & "status = '" & status & "'" For v = 1 to 20 nextFormText = Request.Form("O" & v) If Len(nextFormText) = 0 then nextFormText = Request.Form("COF" & v) nextFormText = Replace(Replace(nextFormText, "<", "<"), ">", ">") nextFormText = sq(HTMLEncode(nextFormText)) strSQL = strSQL & ", opt" & v & " = '" & nextFormText & "'" Next For u = 1 to 8 nextUserFormText = Request.Form("uO" & u-1) If Len(nextUserFormText) = 0 Then nextUserFormText = Request.Form("uCOF" & u-1) strSQL = strSQL & ", uopt" & u & " = '" & HTMLEncode(sq(nextUserFormText)) & "'" Next strSQL = strSQL & " WHERE adID = '" & adID & "';" objConn.Execute(strSQL) msg = msgUpdated If status = 1 and active = 0 then Call sendEmail(notify_email, notify_email, "Classified Ad was Modified", web_site & "viewad.asp?id=" & adID) End If If isEvents then Call logEvent("Update Ad", adID, subject, " - Content Updated", Empty, Empty) objConn.close If IsCache then session("cached" & strSUnique) = "yes" End If %>
<% Response.Write msg Set session("Temp_UserArray" & strSUnique) = Nothing %>