Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - MOD: Allow Moderators to update user's Group
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MOD: Allow Moderators to update user's Group

 Post Reply Post Reply
Author
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Topic: MOD: Allow Moderators to update user's Group
    Posted: 13 December 2006 at 3:49pm
Hi all, I installed WWF for the first time yesterday on a local test system and have been delving into the code already!

On my site, there is a requirement for moderators to be able to give paid up club members access to a private forum area. As I'd sussed that forum access is done by Groups in WWF, and I found only the Admin can change a user's group, I decided to do this MOD otherwise I'd be the only one able to change a users group!

So, in register.asp:

Find the code at line 1956:
             'Only allow admin to change the member group

             If blnAdmin Then

                    'Get the forum groups from the database so admin can change the members group

                     'Initlise SQL query
                     strSQL = "SELECT " & strDbTable & "Group.Group_ID, " & strDbTable & "Group.Name, " & strDbTable & "Group.Special_rank, " & strDbTable & "Group.Minimum_posts " & _
                     "FROM " & strDbTable & "Group" & strDBNoLock & ";"


Then at line 1965 insert the following code:

            Else

                    'Get the forum groups from the database so moderator can change the members group (limited groups available)

                     'Initlise SQL query
                     strSQL = "SELECT " & strDbTable & "Group.Group_ID, " & strDbTable & "Group.Name, " & strDbTable & "Group.Special_rank, " & strDbTable & "Group.Minimum_posts " & _
                     "FROM " & strDbTable & "Group" & strDBNoLock & " WHERE GROUP_ID > 3;"
            End If     


Finally, at line 2022, remove or comment out the End if statement. That's it!!

To prevent a moderator promitng himself to admin status or any other use to moderator or admin, the new select statement filters out the admin, guest and moderator groups from the dropdown list. If you don't mind a moderator doing promotions to moderator simple change the where clause to GROUP_ID > 2.

Having done a lot of modding in Snitz before, I must say I'm very impressed with the code layout in WWF, very easy to find what you want. Thanks to all those involved in writing it!

Cheers!

Edited by MrMellie - 13 December 2006 at 3:55pm
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.