Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Mod: Priv Messages to/from admin will alway work
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mod: Priv Messages to/from admin will alway work

 Post Reply Post Reply
Author
psycotik View Drop Down
Groupie
Groupie


Joined: 27 November 2003
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote psycotik Quote  Post ReplyReply Direct Link To This Post Topic: Mod: Priv Messages to/from admin will alway work
    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.
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
psycotik View Drop Down
Groupie
Groupie


Joined: 27 November 2003
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote psycotik Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Praveen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 December 2005
Location: India
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote Praveen Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.