<% If session("user_logged_moderator" & strSUnique) Or Session("admin_loggedin" & strSUnique) = Session.SessionID then moderator = True If not Request.Form("B1") = Empty then images = Request.Form("strImages") adIDf = Request.Form("adID") objConn.Execute("UPDATE " & tablPfx & "Ads SET images = '" & images & "' WHERE adID = '" & adIDf & "';") If isEvents then Call logEvent("Update Ad", adIDf, session("Subject" & strSUnique), " - Images Updated", Empty, Empty) ClearSession objConn.close If IsCache then Call cacheAds(adIDf) Response.Redirect "viewad.asp?ID=" & adIDf End If If Not IsNumeric(Request("ID")) Or CStr(Request("ID")) = Empty then Response.Write "
Invalid Request " & msgBack msgNoAd = "
Invalid Request! Ad not Found.

" & msgBack adID = Request("ID") If Not moderator And Not Right(CStr(adID), 6) = CStr(session("user_logged_ID" & strSUnique)) then Response.Redirect "viewad.asp?id=" & adID adFound = True If request("clear") = "1" then ClearSession If Len(CStr(Request.Form("flag"))) > 0 then iFlag = CStr(Request.Form("flag")) imgWidth = Request.Form("iwidth") imgHeight = Request.Form("iheight") imgUpload = Request.Form("filename") Select Case iFlag Case "1" Dim imgArray(10,1) For L = 1 to 10 imgArray(L,0) = session("Attach_Image" & strSUnique)(L,0) imgArray(L,1) = session("Attach_Image" & strSUnique)(L,1) Next session("Count_Image" & strSUnique) = session("Count_Image" & strSUnique) + 1 imgArray(session("Count_Image" & strSUnique), 0) = imgUpload imgArray(session("Count_Image" & strSUnique), 1) = imgWidth & "x" & imgHeight session("Attach_Image" & strSUnique) = imgArray Response.Redirect "admin_imgmod.asp?" & Request.Querystring Case "0": objFile.DeleteFile(uploadPATH & imgUpload) End Select End If If session("Subject" & strSUnique) = Empty then Set rs = objConn.Execute("SELECT subject,images,userimagelimit FROM " & tablPfx & "Ads WHERE adID = '" & adID & "';") If rs.EOF then Response.Write msgNoAd adFound = False Else Session("adID" & strSUnique) = adID Session("Subject" & strSUnique) = rs(0) Session("strImages" & strSUnique) = rs(1) If Session("strImages" & strSUnique) = Empty OR IsNull(session("strImages" & strSUnique)) then Session("Count_Image" & strSUnique) = "0" If Not isnotfree Or moderator then Session("Count_Image_Limit" & strSUnique) = imagelimit Else Session("Count_Image_Limit" & strSUnique) = rs(2) End If End If rs.close End If If adFound then display = "" & Session("Subject" & strSUnique) & "" %>
<%= strText_Home %>::<%= strText_EditImages %>::<%= display %>

<% Dim imgDim(10,1) imgAttached = True If Session("Count_Image" & strSUnique) = "0" then Response.Write "
" & strText_NoImagesAttached & "

" imgAttached = False Dim buildSess(10,1) Session("Attach_Image" & strSUnique) = buildSess Session("strImages" & strSUnique) = Empty Else If isArray(Session("Attach_Image" & strSUnique)) then uPA = Session("Attach_Image" & strSUnique) For L = 1 to 10 If not uPA(L,0) = Empty then imgDim(L,0) = CLng(Split(uPA(L,1), "x")(0)) imgDim(L,1) = CLng(Split(uPA(L,1), "x")(1)) If imgDim(L,0) > 100 then koef = imgDim(L,0) / imgDim(L,1) imgDim(L,0) = 100 imgDim(L,1) = Round(100 / koef) End If strImg = strImg & uPA(L,0) & "|" & uPA(L,1) & sf End If Next Session("strImages" & strSUnique) = strImg Else Dim uPA(10,1) adImgArray = Split(Session("strImages" & strSUnique), sf) Session("Count_Image" & strSUnique) = UBound(adImgArray) imgArrayDim = UBound(adImgArray) - 1 For d = 0 to imgArrayDim x = d + 1 uPA(x,0) = Split(adImgArray(d), "|")(0) adSize = Split(adImgArray(d), "|")(1) uPA(x,1) = adSize imgDim(x,0) = CLng(Split(adSize, "x")(0)) imgDim(x,1) = CLng(Split(adSize, "x")(1)) If imgDim(x,0) > 100 then koef = imgDim(x,0) / imgDim(x,1) imgDim(x,0) = 100 imgDim(x,1) = Round(100 / koef) End If Next Session("Attach_Image" & strSUnique) = uPA End IF End If %> <% If imgAttached Then %>
<%= strText_Youmayreplace %>
<% For L = 1 to 10 If Not uPA(L,0) = Empty then If L = 6 then Response.Write "" Response.Write "" End If Next %>

" Response.Write uPA(L,0) & "
" Response.Write " " & strText_willberemoved & "\n\nContinue?')){window.location='filter.asp?url=admin_imgmod.asp?ID=" & adID & "&act=removeimageadmin&img=" & Server.URLEncode(uPA(L,0)) & "'}"">" & strText_Remove & "
" If L = 1 Then If not uPA(L+1,0) = Empty then Response.Write "" ElseIf L = 10 then Response.Write "" Else If L > 1 And uPA(L+1,0) = Empty then Response.Write "" ElseIf Not uPA(L+1,0) = Empty then Response.Write " " Response.Write "" End If End If Response.Write "
<% End If %> <% If CLng(session("Count_Image" & strSUnique)) < session("Count_Image_Limit" & strSUnique) then %>
 
<% End If %>

"> ">
<%= strText_Note %>

<%= strText_Makesuretoclick %> <%= strText_Youmayhave %> <%= Session("Count_Image_Limit" & strSUnique) %> <%= strText_imageattachedto %>"


<% End If Sub ClearSession() session("Subject" & strSUnique) = Empty session("strImages" & strSUnique) = Empty Session("Attach_Image" & strSUnique) = Empty Session("adID" & strSUnique) = Empty session("Count_Image" & strSUnique) = Empty session("Count_Image_Limit" & strSUnique) = Empty End Sub %>