<% On Error Resume Next If Request.Cookies("user_logged_ID" & strSUnique) = Empty then Response.Redirect "register.asp" If Request.Form("catID") = Empty Or Request.Form("subcatID") = Empty then Response.Redirect "post_new1.asp" If isnotfree And Not Request.Cookies("allow_post" & strSUnique) = "True" then Response.Redirect "filter.asp?url=post_new1.asp&act=startOver" If isnotfree then set rs = objConn.Execute("SELECT credits FROM " & tablUPfx & "User WHERE userID = " & CLng(session("user_logged_ID" & strSUnique)) & ";") If not rs.EOF then Session("user_logged_credit" & strSUnique) = FormatNumber(CCur(rs("credits")), 2) rs.close If CCur(Request.Cookies("final_price" & strSUnique)) > CCur(Session("user_logged_credit" & strSUnique)) Then Response.Write strText_NotEnoughCredits Response.End End If End If Dim msg, uSubject, uBody setLocale server_locale sdd = dd(objConn) userID = CLng(Request.Cookies("user_logged_ID" & strSUnique)) postExpire = DateAdd("d", CLng(Request.Form("S1")), Now) postExpire = ConvDate(postExpire) PostPosted = ConvDate(Now) subject = Replace(Request.Form("P1"), chr(34), "''") subject = sq(subject) subject = Replace(Replace(subject, "<", "<"), ">", ">") phone = sq(HTMLEncode(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 nick = Request.Cookies("user_logged_nick" & strSUnique) city = Request.Cookies("user_logged_city" & strSUnique) price = Request.Cookies("final_price" & strSUnique) email = Request.Cookies("user_logged_email" & strSUnique) onlineImg = sq(HTMLEncode(Request.Form("P4"))) catID = CLng(Request.Form("catID")) subcatID = CLng(Request.Form("subcatID")) cat3rdID = Request.Form("cat3rdID") If Not IsNumeric(cat3rdID) Or cat3rdID = Empty Then cat3rdID = 0 descr = Request.Form("P5") If Not Request.Form("html") then descr = Replace(descr, chr(34), "''") descr = Replace(descr, vbcr, "
") Else Set re = new RegExp re.global=true re.ignoreCase=true re.pattern = "(|)" descr = re.Replace(descr, "") End If descr = sq(descr) IP = Request.ServerVariables("REMOTE_ADDR") adID = subcatID & RandomNumber & userID adID = CStr(adID) If moderate then active = 0: Else: active = 1 If len(subject) > 0 and Len(descr) > 0 Then If not Request.Form("imgFile") = Empty then img = sq(Request.Form("imgFile")) imgArray = Split(img, sf) For d = 0 to UBound(imgArray) - 1 imgName = Split(imgArray(d), "|")(0) set rs = objConn.Execute("SELECT " & tablPfx & "Temp.tempimg FROM " & tablPfx & "Temp WHERE tempimg = '" & imgName & "';") If Not rs.EOF then objConn.Execute("DELETE FROM " & tablPfx & "Temp WHERE tempimg = '" & imgName & "';") rs.close Next End If If isnotfree then hotlist = Request.Cookies("hotlist" & strSUnique) 'If Len(img) > 0 then userimglimit = Request.Cookies("image_limit" & strSUnique) 'Else: userimglimit = 0 'End If Else userimglimit = imagelimit hotlist = 0 End If For uo = 0 to 7 nextUserFormText = Request.Form("uO" & uo) If Len(nextUserFormText) = 0 then nextUserFormText = Request.Form("uCOF" & uo) strUserValues = strUserValues & ", '" & sq(HTMLEncode(nextUserFormText)) & "'" strUserFields = strUserFields & ", " & "uopt" & uo + 1 Next For o = 1 to 20 nextFormText = Request.Form("O" & o) If Len(nextFormText) = 0 then nextFormText = Request.Form("COF" & o) nextFormText = Replace(Replace(nextFormText, "<", "<"), ">", ">") nextFormText = sq(HTMLEncode(nextFormText)) strCatValues = strCatValues & ", '" & nextFormText & "'" strCatFields = strCatFields & ", " & "opt" & o Next strSQL = "INSERT INTO " & tablPfx & "Ads(adID, catID, scatID, cat3rdID, userID, pdate, edate, nick, city, subject, phone, web, images, webimage, body, status, IP, adcounter, hotlist, price" strSQL = strSQL & strUserFields & strCatFields & ", userimagelimit) VALUES ('" & adID & "', " & catID & ", " & subcatID & ", " & cat3rdID & ", " & userID & ", " & sdd & PostPosted & sdd & ", " & sdd & postExpire & sdd & ", '" & nick & "', " strSQL = strSQL & "'" & city & "', '" & subject & "', '" & phone & "', '" & URL & "', '" & img & "', '" & onlineImg & "', '" & descr & "', " & active & ", '" & IP & "', " strSQL = strSQL & 0 & ", " & hotlist & ", '" & price & "'" & strUserValues & strCatValues & ", " & userimglimit & ");" objConn.Execute(strSQL) Call updateUserPostData(userID, adID, price, "postnew") If moderate then Call getTemplate("New_Ad_Pending", email, Empty, nick, Empty, adID) Else Call UpdateList(True, catID, subcatID, cat3rdID) Call getTemplate("New_Ad_Approved", email, Empty, nick, Empty, adID) Application("cl_marquee" & strUnique) = Empty Call matchAlerts(adID, catID, subcatID, cat3rdID, subject, descr) End If If IsCache then Call cacheAds(adID) Call sendEmail(email, notify_email, uSubject, uBody) Call getTemplate("Admin_Notify", email, Empty, nick, Empty, adID) Call sendEmail(admin_email, notify_email, uSubject, uBody) If isEvents then Call logEvent("New Ad", adID, subject, Empty, Empty, Empty) Response.Cookies("user_logged_ID" & strSUnique) = Empty Session("image_limit" & strSUnique) = Empty Session("duration_limit" & strSUnique) = Empty Session("hotlist" & strSUnique) = Empty Session("allow_post" & strSUnique) = Empty Session("final_price" & strSUnique) = Empty session("Select_Category" & strSUnique) = Empty session("Select_SubCategory" & strSUnique) = Empty session("Select_CategoryID" & strSUnique) = Empty session("Select_SubCategoryID" & strSUnique) = Empty session("Select_3rdCategory" & strSUnique) = Empty session("Select_3rdCategoryID" & strSUnique) = Empty Session("Attach_Image" & strSUnique) = Empty Set session("Attach_Image" & strSUnique) = Nothing Set session("Temp_UserArray" & strSUnique) = Nothing Session("Count_Image" & strSUnique) = Empty Response.Write "
" & strText_Posted & " " & email & "

" If moderate then Response.Write "
" & strText_Posted1 & "

" End If %>