Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Restricting info to groups
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Restricting info to groups

 Post Reply Post Reply
Author
djhall View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote djhall Quote  Post ReplyReply Direct Link To This Post Topic: Restricting info to groups
    Posted: 02 April 2003 at 10:54am
If I place all of my members into groups, is it possible to only display the members that are part of thier group in the memberlist/profiles?

Edited by djhall
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2003 at 1:48pm

i take it you are talking about wwg forums V7

to add this feature... around line 230 of members.asp

theres this code

 

 'If this is to show a group the query the database for the members of the group
 If intGetGroupID <> 0 Then
  'Initalise the strSQL variable with an SQL statement to query the database
  strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Homepage, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Active, " & strDbTable & "Group.Name, " & strDbTable & "Group.Stars "
  strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Group "
  strSQL = strSQL & "WHERE " & strDbTable & "Author.Group_ID = " & strDbTable & "Group.Group_ID AND " & strDbTable & "Author.Group_ID=" & intGetGroupID & " "
  strSQL = strSQL & "ORDER BY " & strSortBy & ";"

 'Else get all the members from the database
 Else
  'Initalise the strSQL variable with an SQL statement to query the database
  strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Homepage, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Active, " & strDbTable & "Group.Name, " & strDbTable & "Group.Stars "
  strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Group "
  strSQL = strSQL & "WHERE " & strDbTable & "Author.Group_ID = " & strDbTable & "Group.Group_ID AND " & strDbTable & "Author.Username Like '" & strSearchCriteria & "%'  "
If (blnAdmin = False OR blnModerator = False) Then strSQL = strSQl & " AND tblAuthor.Group_ID =" & intGroupID & ""
  strSQL = strSQL & "ORDER BY " & strSortBy & ";"
 End If

 

the section in red is what would make it so that the results found would be in the same group ... that is when you are searching ( not looking at a group id ie moderatos for a forum ... this code only applys to all members except admin and moderators if you dont want it that way delete the appropriate blnadmin or blnmoderator ..

i haven't tested it but it should work if it doesn't let me know .....

 

 

for got to add the tabkle name



Edited by dj air
Back to Top
djhall View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote djhall Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2003 at 2:23pm

thanks, that works. ( I actually just figured that out a few minutes before your reply...)

Another problem I am having is in the active topics area.

ALL the topics are shown, not just the ones that a user has access to.

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 1:40am

just add the code in red to the SQL where it says where make sure to add it on a new line below the where but above the order by or sort by

that will make it have the same rescriction as the members page....

Back to Top
djhall View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote djhall Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 7:37am
Yea... I tried that, however it doesn't work. It seems to me that in the active topics area there needs to be some type of join to the tblForum and or tblPermissions, because now we are looking for viewable posts by group, and not just members as in the code above. As it works right now, even a newbie can see all the forums and topics in the active topics list, though he cannot read them. The whole idea is that a group member is not aware of the existance of forums that he is not permitted to view.

Edited by djhall
Back to Top
djhall View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote djhall Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 11:00am

after a little thought this seems to work....

 

 If (blnAdmin = False OR blnModerator = False) Then strSQL = strSQl & " AND tblPermissions.Forum_ID = tblForum.Forum_id AND tblPermissions.Group_ID =" & intGroupID & ""

now on to the search area for the same problem....



Edited by djhall
Back to Top
djhall View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Location: United States
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote djhall Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2003 at 12:35pm

I did find one little problem with the active topics solution...

it doesn't list forum topics that are not associated to a group. (ie a forum that is accesible to all registered users)

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.