%
If CBool(Sess_Array(35)) Or Sess_Array(48) = Session.SessionID then moderator = True: Else moderator = False: End If
If not nopost then
Dim uSubject, uBody
userID = Sess_Array(29)
If Request.Querystring.Count = 1 then
adID = Request.Querystring.Item(1)
If not isNumeric(adID) Then Response.End
strSQL = "SELECT " & tablUPfx & "User.email," & tablPfx & "Ads.nick," & tablPfx & "Ads.userID," & tablPfx & "Ads.catID," & tablPfx & "Ads.sCatID,"
strSQL = strSQL & tablPfx & "Ads.pdate," & tablPfx & "Ads.edate," & tablPfx & "Ads.price," & tablUPfx & "User.credits," & tablPfx & "Ads.cat3rdID, "
strSQL = strSQL & tablUPfx & "User.paypack, " & tablUPfx & "User.pexpire "
strSQL = strSQL & "FROM " & tablUPfx & "User," & tablPfx & "Ads WHERE (" & tablUPfx & "User.userID = " & tablPfx & "Ads.UserID AND " & tablPfx
strSQL = strSQL & "Ads.status = 2 AND " & tablPfx & "Ads.adID = '" & adID & "');"
set rs = objConn.Execute(strSQL)
sdd = dd(objConn)
If rs.EOF Then
msg = msgNotFound
Else
setLocale server_locale
If not rs(7) = Empty then adPrice = CCur(rs(7)): Else: adPrice = 0
setLocale resetLocale
posteruserID = CLng(rs(2))
Select Case moderator
Case True
repost = True
If CStr(userID) = CStr(posteruserID) Then adOwnerOpt = True
Case False
If CStr(userID) = CStr(posteruserID) Then
adOwnerOpt = True
adOwner = true
repost = True
Else: msg = msgNoperm
End If
End Select
End If
Else
msg = msgInvalid
End If
If repost And isnotfree And Not ispack And adOwnerOpt And Len(Sess_Array(76)) = 0 Then
Sess_Array(75) = userID
UpdateSessions True
Response.Redirect "repost_opt.asp?adID=" & adID
End If
Sess_Array(76) = Empty
If repost and isnotfree and adPrice > 0 and adOwnerOpt and not ispack then
setLocale server_locale
credits = CCur(rs(8))
setLocale resetLocale
If adPrice > credits then
repost = False
msg = msgNoCredits & adPrice & msgNoCredits1
Else
deducted = FormatNumber(credits - adPrice, 2)
Sess_Array(47) = deducted
End If
strSQLrepost = "UPDATE " & tablUPfx & "User SET credits = '" & deducted & "' WHERE userID = " & posteruserID & ";"
objConn.Execute(strSQLrepost)
End If
If repost then
uEmail = CryptText(rs(0), key, True)
uNick = rs(1)
catID = rs(3)
subcatID = rs(4)
cat3rdID = rs(9)
pdate = rs(5)
edate = rs(6)
duration = Round(CDate(edate) - CDate(pdate))
If isnotfree And Not ispack And Len(Sess_Array(10)) > 0 Then duration = CLng(Sess_Array(10))
postExpire = DateAdd("d", duration, Now)
postExpire = ConvDate(postExpire)
packID = CLng(rs(10))
packExp = CDate(rs(11))
If ispack And packID > 0 then
set rsPack = objConn.Execute("SELECT isadexpire, adur FROM " & tablPfx & "Pack WHERE packID = " & packID & ";")
If Not rsPack.EOF then
isExpire = CBool(rsPack("isadexpire"))
If isExpire And postExpire > packExp then
postExpire = ConvDate(packExp)
Else
postExpire = Now + rsPack("adur")
postExpire = ConvDate(postExpire)
End If
End If
rsPack.close
End If
If ispack and not moderator then
set rscat = objConn.Execute("SELECT ID FROM " & tablPfx & "Cat WHERE (catID = " & catID & " AND isfree = 1);")
If not rscat.EOF then
repost = True
Else
If packID = 0 then repost = False
End If
rscat.close
Else
repost = True
End If
If repost then
strSQLrepost = "UPDATE " & tablPfx & "Ads SET status = 1, pdate = " & sdd & ConvDate(Now) & sdd & ", edate = " & sdd & postExpire & sdd
strSQLrepost = strSQLrepost & " WHERE(adID = '" & adID & "' AND status = 2);"
objConn.Execute(strSQLrepost)
Application("cl_marquee" & strUnique) = Empty
Call UpdateList(True, catID, subcatID, cat3rdID)
Call getTemplate("New_Ad_Approved", uEmail, Empty, uNick, Empty, adID)
Call sendEmail(uEmail, notify_email, uSubject, uBody)
msg = msgActive & "" & adID & "" & msgActive1 & uEmail & "
"
Else
msg = strText_NoRepostPack
End If
End If
If Request.Querystring.Count = 1 then rs.close
End If
%>