Author |
Topic |
pharic
Starting Member
14 Posts |
Posted - 10 May 2006 : 05:16:59
|
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?< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 10 May 2006 : 08:22:07
|
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.< |
|
|
pharic
Starting Member
14 Posts |
Posted - 10 May 2006 : 10:28:54
|
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!< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 10 May 2006 : 10:50:39
|
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. =/< |
|
|
pharic
Starting Member
14 Posts |
Posted - 10 May 2006 : 20:50:24
|
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.< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 11 May 2006 : 08:34:10
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 11 May 2006 : 08:48:03
|
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.” |
|
|
pharic
Starting Member
14 Posts |
Posted - 12 May 2006 : 09:57:08
|
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< |
|
|
Topic |
|