Print Page | Close Window

Mod: Priv Messages to/from admin will alway work

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=20357
Printed Date: 29 March 2026 at 12:41pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mod: Priv Messages to/from admin will alway work
Posted By: psycotik
Subject: Mod: Priv Messages to/from admin will alway work
Date Posted: 19 June 2006 at 2:23pm
Line 150ish

'Initalise the SQL string with a query to read in the dteails of who the PM is to
strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_email, " & strDbTable & "Author.PM_notify " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Author.Username = '" & strToUsername & "';"

Changes to:


'Initalise the SQL string with a query to read in the dteails of who the PM is to
strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_email, " & strDbTable & "Author.PM_notify, " & strDbTable & "Author.Group_ID " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Author.Username = '" & strToUsername & "';"


Line 159ish

If NOT rsCommon.EOF Then

    'Username found so set to true
    blnToUsernameOK = True


Changes to:


If NOT rsCommon.EOF Then
    Dim intAuthorGroupID
    intAuthorGroupID = rsCommon("Group_ID")

    'Username found so set to true
    blnToUsernameOK = True



Line 209ish

    If NOT rsCommon.EOF Then
        If (CInt(rsCommon("CountOfPM")) < intNumPrivateMessages) OR lngLoggedInUserID = 1 OR lngToUserID = 1 Then blnMaxPMsOK = True
    'Else if no records returened they have no pm's set set blnMaxPMsOK to true anyway (it's intilised to false at the top)
    Else
        blnMaxPMsOK = True
    End If


Changes to:


    If NOT rsCommon.EOF Then
        If (CInt(rsCommon("CountOfPM")) < intNumPrivateMessages) OR intAuthorGroupID = 1 OR intGroupID = 1 Then blnMaxPMsOK = True
    'Else if no records returened they have no pm's set set blnMaxPMsOK to true anyway (it's intilised to false at the top)
    Else
        blnMaxPMsOK = True
    End If



This basically makes it so if you're set as an admin your pm's will always go through. Also if a user tries to pm an admin and their box is full, it'll still go through.

This originally works only for user 1 (the creator), this now works off the admin group.



Replies:
Posted By: MadDog
Date Posted: 19 June 2006 at 6:36pm
The forum is already built this way isnt it?

I know with v7 admins will always be able to get PMs as they dont have a limit...


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: psycotik
Date Posted: 20 June 2006 at 8:50am
Previously it only worked with userID 1 (the board founder/admin). If you were a 2nd or 3rd admin it wouldnt allow messages though if your box was full or if the person you're messaging was full.

This changes it so its anyone in the administrators group (group 1) will work.


Posted By: Praveen
Date Posted: 21 June 2006 at 6:04am
Wow, that was cool but I am not able to understand some parts of the code and was showing e with errors.

-------------



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net