Print Page | Close Window

Restricting info to groups

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1552
Printed Date: 28 March 2026 at 9:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Restricting info to groups
Posted By: djhall
Subject: Restricting info to groups
Date 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?



Replies:
Posted By: dj air
Date 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



Posted By: djhall
Date 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.



Posted By: dj air
Date 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....



Posted By: djhall
Date 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.


Posted By: djhall
Date 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....



Posted By: djhall
Date 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)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net