Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Does Universal Login work?
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

pharic
Starting Member

14 Posts

Posted - 10 May 2006 :  05:16:59  Show Profile  Reply with Quote
I'm still trying to let onlymembers edit my other pages.
I could write the code to check the FORUM_ALLOWED_MEMBERS table and check if their MEMBER_ID matches the FORUM_ID but this must already be done somewhere else
Does anyone know the variable that allows some members to see some forums and others not to be able to see them?<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 10 May 2006 :  08:22:07  Show Profile  Visit AnonJr's Homepage  Reply with Quote
With the UserGroups MOD you can assign users to a particular group, and then set that groups permissions for a given forum. If you wanted to extend the permissions beyond the forum itself, with a little custom coding you could check for the cookie and see if they are a member of a group that has those permissions. This has been used as a solution to similar problems at other sites.<
Go to Top of Page

pharic
Starting Member

14 Posts

Posted - 10 May 2006 :  10:28:54  Show Profile  Reply with Quote
Thanks again AnonJr but it still seems a really complicated way of doing it. I already have a working forum with an allowed members list on the members forum, so it's hidden to others. I just want to add something to the "If mLev>0" like "And IsMember=Yes". I guess I can code if I have to, I just don't want to!<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 10 May 2006 :  10:50:39  Show Profile  Visit AnonJr's Homepage  Reply with Quote
It is more complex up front, but IMHO its a better solution for the long run since it allows for a little more flexibility. My experience has been that a quick solution for a simple issue almost always grows and expands and if you're not careful can quickly get unmanageable. I try to be as forward-thinking as I can... I'm not always successful at it, but it helps. =/<
Go to Top of Page

pharic
Starting Member

14 Posts

Posted - 10 May 2006 :  20:50:24  Show Profile  Reply with Quote
Thanks again,
I finally got round to sitting down to do some code. I did this at the end of my custom inc_header:

strsql = "SELECT * FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
IsStaff = "No"
Do While (Not rs.Eof)
memID = rs("MEMBER_ID")
If MemberID = memID then
IsStaff = "Yes"
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing

It seems to work (!) but I'm wondering if I'm going to run into trouble if something unexpected happens, I can see what you're saying about it not being forward thinking and it looks pretty rough I admit but it took me only 5 minutes even with my limited skill and brain power.<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 11 May 2006 :  08:34:10  Show Profile  Visit AnonJr's Homepage  Reply with Quote
On first glance, it should work fine ... as long as you don't want to expand this to other FORUM_ID's...

Like I said earlier, its easy to do a quick hack like this - and it works. However, if you ever need to expand on this its going to get more and more labyrinthine each iteration until you go back and set in a more flexible system. Just a friendly piece of advice from someone who's been down that road before.

Also, as a side note, to make your code a little more efficient instead of selecting everything, just grab the MEMBER_ID since that's all you need. It will reduce your Database's workload.

[edit] Guess I should have included what I meant...
Change:
strsql = "SELECT * FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"

To:
strsql = "SELECT MEMBER_ID FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"

Best of luck.<

Edited by - AnonJr on 11 May 2006 08:38:28
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 May 2006 :  08:48:03  Show Profile  Reply with Quote
How are staff members distinguished from other members in your MEMBERS table? You could try doing it the way I did, as explained in this topic.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

pharic
Starting Member

14 Posts

Posted - 12 May 2006 :  09:57:08  Show Profile  Reply with Quote
Thanks guys

Yes, you're right about swapping MEMBER_ID for *, thanks.

Thanks Shaggy, the table I'm using is FORUM_ALLOWED_MEMBERS, all it contains is staff member ID's and forum IDs. As long as the user has access to the members forum, they can change the other members' pages on the site

Cheers for your help. I've just gotta get the header working in vcalendar now!

Pharic<
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07