% setLocale server_locale If session("user_logged_moderator" & strSUnique) = true Or Session("admin_loggedin" & strSUnique) = Session.SessionID then moderator = True: Else moderator = False: End If If not nopost then Dim uSubject, uBody userID = session("user_logged_ID" & strSUnique) If Request.Querystring.Count = 1 then adID = Request.Querystring.Item(1) 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 If not rs(7) = Empty then adPrice = CCur(rs(7)): Else: adPrice = 0 posteruserID = CLng(rs(2)) Select Case moderator Case True: repost = True Case False If CStr(userID) = CStr(posteruserID) then adOwner = true repost = True Else: msg = msgNoperm End If End Select End If Else msg = msgInvalid End If If repost and isnotfree and adPrice > 0 and adOwner and not ispack then credits = CCur(session("user_logged_credit" & strSUnique)) If adPrice > credits then repost = False msg = msgNoCredits & adPrice & msgNoCredits1 Else deducted = FormatNumber(credits - adPrice, 2) session("user_logged_credit" & strSUnique) = deducted End If 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) uCredits = CCur(rs(8)) duration = Round(CDate(edate) - CDate(pdate)) 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 adOwner and isnotfree and not ispack then strSQLrepost = "UPDATE " & tablUPfx & "User SET credits = '" & FormatNumber(uCredits - adPrice, 2) & "' WHERE userID = " & posteruserID & ";" objConn.Execute(strSQLrepost) 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 %> <%= strText_Home %>::<%= strText_RepostAd %> <%= msg %><%= msgBack %> <% If not ispack then %> <% End If %>