%
Dim totalPage, totalRecords, displayRecords, Opt(20), OptV(20), option_(20), uoption_(7), uOpt_(7)
For I = 1 To 7
If CInt(uOptSearch(I - 1)) > 1 AND Len(uOpt(I-1)) > 0 Then uoption_(I) = True
Next
msgnoAds = "
" & strText_NoAdsSubmitted & msgBack & "
"
msgInvalid = strText_InvalidRequestList
If CBool(Sess_Array(35)) Or Sess_Array(48) = Session.SessionID then moderator = True
If Sess_Array(48) = Session.SessionID and Not listalpha then admin = True: cs = 6: End If
catID = Request("cid")
subcatID = Request("sid")
If isNumeric(catID) AND isNumeric(subcatID) then
If catID > 0 AND subcatID > 0 then
If Request("sa") = "1" then
showAllAds = True
subCatName = strText_ShowAll
Else: isAll = " AND " & tablPfx & "Ads.scatID = " & subcatID
End If
On Error Goto 0
If not Request.Form("B1") = Empty then
Set rs = Server.CreateObject("ADODB.Recordset")
ID = CLng(Request.Form("ID"))
If not ID = Empty then
strsCat = "SELECT sortID,sCatID,CatID FROM " & tablPfx & "Scat WHERE catID = " & subcatID & " ORDER BY sortID;"
rs.CursorLocation = 3
rs.CursorType = 3
rs.Open strsCat, strConn
rc = rs.RecordCount
On Error Resume Next
For c = 1 to rc
If Not rs.EOF then
nextID = CLng(rs("sortID"))
nextcatID = CLng(rs("sCatID"))
If CStr(ID) = CStr(nextID) then
Select Case Request.Form("B1")
Case "▲": rs.MovePrevious
Case "▼": rs.MoveNext
End Select
swapID = CLng(rs("sortID"))
swapcatID = CLng(rs("sCatID"))
Exit For
End If
rs.MoveNext
End If
Next
On Error GoTo 0
rs.close
If not swapID = Empty And Err.Number = 0 then
objConn.Execute("UPDATE " & tablPfx & "Scat SET sortID = " & swapID & " WHERE sCatID = " & nextcatID & ";")
objConn.Execute("UPDATE " & tablPfx & "Scat SET sortID = " & nextID & " WHERE sCatID = " & swapcatID & ";")
UpdateSessions False
Response.Redirect "viewlist.asp?" & Request.Querystring
End If
End If
End If
If Not showAllAds Then
strsCat = "SELECT * FROM " & tablPfx & "Scat WHERE (catID = " & CLng(subcatID) & strSelectCat & ") ORDER BY " & scat_sortorder & ";"
set rs = objConn.Execute(strsCat)
If not rs.EOF then
str3rdCatList = vbcrlf & "
" & vbcrlf
rc = rs.RecordCount
For f = 1 to rc
cat3rdID = rs("sCatID")
cat3rdName = rs("scatName")
cat3rdAds = rs("ads")
sortID = rs("sortID")
sicon = parseScategoryIcon(rs("scatMetaKey"), False)
If f mod catpos = 1 then str3rdCatList = str3rdCatList & "
" & vbcrlf
str3rdCatList = str3rdCatList & "
" & vbcrlf
str3rdCatList = str3rdCatList & "
" & vbcrlf
If admin then
str3rdCatList = str3rdCatList & "
" & vbcrlf
If f = 1 then fd = "disabled": Else: fd = Empty: End If
If f = rc then ld = "disabled"
str3rdCatList = str3rdCatList & "
<%
For I = 1 To 7
If uoption_(I) Then Response.Write "
" & uOpt(I-1) & ":
"
Next
For I = 1 To 20
If option_(I) Then
ind = ((I * 2) - 1) + 10
Opt(I) = ghdata(ind, 0)
If IsNull(Opt(I)) Then Opt(I) = Empty
If len(Opt(I)) > 0 then Response.Write "
" & Opt(I) & ":
"
End If
Next
%>
<%= strText_Views %>:
<% If Sess_Array(29) > 0 or moderator then %>
<%= strText_Action %>:
<% End If %>
<%
For J = 0 to Ubound(ghdata, 2)
adID = ghdata(0, J)
active = CLng(ghdata(6, J))
iDate = FormatDateTime(ghdata(1, J), 2)
subject = ghdata(4, J)
subject = "" & subject & ""
If ghdata(8, J) then subject = " " & subject
userID = ghdata(9, J)
If CStr(Sess_Array(29)) = CStr(userID) then adOwner = True: Else: adOwner = False
nick = ghdata(2, J)
city = ghdata(3, J)
views = ghdata(7, J)
imgStr = displayImage(ghdata(5, J), adID, 0)
If J mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'"
%>
>
<%= iDate %>
<%= subject %>
<%= imgStr %>
<%
For I = 1 To 7
If uoption_(I) Then
uOpt_(I) = ghdata(I + 50, J)
If IsNull(uOpt_(I)) Then uOpt_(I) = Empty
If Len(uOpt_(I)) = 0 Then uOpt_(I) = NA
Response.Write "
" & uOpt_(I) & "
"
End If
Next
For I = 1 To 20
If option_(I) And Len(Opt(I)) > 0 Then
ind = (I * 2) + 10
OptV(I) = ghdata(ind, J)
If IsNull(OptV(I)) Then OptV(I) = Empty
If Len(OptV(I)) = 0 Then OptV(I) = NA
Response.Write "
" & OptV(I) & "
"
End If
Next
%>
<%= views %>
<%
If Sess_Array(29) > 0 or moderator then
%>
<%
If adOwner or moderator then
If active = 2 then
Response.Write "" & strText_Repost & ""
ElseIf active = 1 then
Response.Write "" & strText_Edit & ""
End If
If moderator then
Response.Write " Delete"
If active = 0 then
Response.Write " Activate"
End If
End If
Else: Response.Write "="
End If
%>
<%
End If
%>
<%
Next
Erase ghdata
%>
<% Call Build_List_Bottom() %>
<%
End If
If not showAllAds AND Sess_Array(63) = "1" AND Sess_Array(48) = Session.SessionID then
If Len(Sess_Array(64)) = 0 then
strMover = "Move Ads From This Category"
Else
ccid = Split(Sess_Array(64), "|")(0)
csid = Split(Sess_Array(64), "|")(1)
cat3id = Sess_Array(65)
If Sess_Array(65) = "0" then
view_src = "viewlist.asp?cid=" & ccid & "&sid=" & csid
Else
view_src = "viewsublist.asp?cid=" & ccid & "&sid=" & csid & "&3id=" & Sess_Array(65)
End If
strMover = "View Current Source Category
"
End If
If not showAllAds AND Sess_Array(66) = "1" AND Sess_Array(48) = Session.SessionID then
strMover = "Remove ALL Ads from this Category"
Response.Write "
" & strMover & "
"
End If
Else: Response.Write "
" & msgInvalid & "
"
End If
set rscat = objConn.Execute("SELECT " & tablPfx & "Cat.catName, " & tablPfx & "Cat.catID FROM " & tablPfx & "Cat ORDER BY catName;")
Do while not rscat.EOF
nextCatName = rscat("catName")
nextcatID = rscat("catID")
If nextCatName = catName then
optCat = optCat & ""
Else: optCat = optCat & ""
End If
rscat.MoveNext
Loop
rscat.close
set rscat = Nothing
%>