<% If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp" adID = Request("id") subject = Request("sbg") strAd = "id=" & adID & "&sbg=" & Server.URLEncode(subject) If lcase(Request.ServerVariables("REQUEST_METHOD")) = "post" And IsNumeric(adID) And Not Request("sd") = "show" then catID = CLng(Request.Form("D1")) scatID = CLng(Request.Form("D2")) cat3rdID = CLng(Request.Form("D3")) If Request.Form("C1") = 1 then cat3rdID = 0 Set rs = objConn.Execute("SELECT status,catID,scatID,cat3rdID FROM " & tablPfx & "Ads WHERE adID = '" & adID & "';") If not rs.EOF then status = rs(0) oldcatID = rs(1) oldscatID = rs(2) oldcat3rdID = rs(3) rs.close If status = 1 then Call UpdateList(True, catID, scatID, cat3rdID) Call UpdateList(False, oldcatID, oldscatID, oldcat3rdID) End If newadID = Replace(adID, Left(adID, 5), scatID, 1) objConn.Execute("UPDATE " & tablPfx & "Ads SET catID = " & catID & ",scatID=" & scatID & ",cat3rdID=" & cat3rdID & ",adID='" & newadID & "' WHERE adID = '" & adID & "';") Application("cl_marquee" & strUnique) = Empty Response.Redirect "viewad.asp?id=" & newadID Else Response.Write "Ad not Found!" rs.close End If End If If isNumeric(Request("cid")) then querycatID = CLng(Request("cid")): Else: querycatID = 0 If isNumeric(Request("sid")) then querysubcatID = CLng(Request("sid")): Else: querysubcatID = 0 If isNumeric(Request("3id")) then query3rdcatID = CLng(Request("3id")): Else: query3rdcatID = 0 If Request("sd") = "show" then Set rs = objConn.Execute("SELECT catID,scatID,cat3rdID FROM " & tablPfx & "Ads WHERE adID = '" & adID & "';") If not rs.EOF then querycatID = rs(0) querysubcatID = rs(1) query3rdcatID = rs(2) End If rs.close End If strCat = "SELECT catID,catName FROM " & tablPfx & "Cat ORDER BY catName;" Set rs = objConn.Execute(strCat) If not rs.EOF then I = 1 Do While Not rs.EOF currentID = rs("catID") currentName = rs("catName") If I = 1 And querycatID = 0 then querycatID = currentID If CStr(querycatID) = CStr(currentID) then optCat = optCat & "" & vbcrlf Else: optCat = optCat & "" & vbcrlf End If I = I + 1 rs.MoveNext Loop End If rs.close strSCat = "SELECT sCatID,scatName,ftype FROM " & tablPfx & "Scat WHERE catID=" & querycatID & " ORDER BY sCatID;" Set rs = objConn.Execute(strSCat) If not rs.EOF then I = 1 Do While Not rs.EOF currentSubID = rs("sCatID") currentSubName = rs("scatName") If I = 1 And querysubcatID = 0 then querysubcatID = currentSubID If CStr(currentSubID) = CStr(querysubcatID) then optSubCat = optSubCat & "" & vbcrlf Else: optSubCat = optSubCat & "" & vbcrlf End If I = I + 1 rs.MoveNext Loop End If rs.close strSCat = "SELECT sCatID,scatName FROM " & tablPfx & "Scat WHERE catID=" & querysubcatID & " ORDER BY sCatID;" Set rs = objConn.Execute(strSCat) If not rs.EOF then I = 1 Do While Not rs.EOF current3rdID = rs("sCatID") current3rdName = rs("scatName") If I = 1 And query3rdcatID = 0 then query3rdcatID = current3rdID If CStr(current3rdID) = CStr(query3rdcatID) then opt3rdCat = opt3rdCat & "" & vbcrlf Else: opt3rdCat = opt3rdCat & "" & vbcrlf End If rs.MoveNext I = I + 1 Loop Else disable3rd = "disabled" End If rs.close %>

Ad Moving Tool
Ad to move: <%= subject %>
<% If len(opt3rdCat) > 0 then %> <% Else: Response.Write "" End If %>
     
Current Category:  type="submit" value="Move Here" name="B3" class="buttons">
Current Subcategory:   
Current 3-rd Level:  - Omit 3-rd level *
Current 3-rd Level:  No 3-rd Level Created  
     
* If checked then Ad is moved directly to subcategory, disregarding 3-rd level.

Note: Be careful while moving ads. If moved ad to a different category which has different options set, then option values specified within the ad might not correspond to the option context anymore. The ad ID might also be changed. If you have this ad in Editor's pick list, then you need to update it.