Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
probador
New Member
New Member


Joined: Apr 20, 2006
Posts: 24

PostPosted: Mon Jun 26, 2006 10:49 am Reply with quote

I think the Subject is self-explaining. I have this module and I want to make the ECHO function visible depending of your membership (nsnt groups).

So lets say I have 4 groups, but only one will see this particular paragraph (or ECHO function).

Thanks indeed, the thing is driving me crazy ! Question
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Mon Jun 26, 2006 8:24 pm Reply with quote

If you use NSN Groups, you can set messages, blocks, modules, etc. to only be visible by members of a group, and the groups are also used by the forums.

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
probador
PostPosted: Tue Jun 27, 2006 3:22 am Reply with quote

Yes I know that, but I want to make only this particular lines visible for a specific nsnt group (and not the whole module/block)

Any idea??
 
kguske
PostPosted: Tue Jun 27, 2006 4:45 am Reply with quote

You'll have to put logic wherever the content will appear. I'm not sure where you want the content to appear, but you could use the same logic used for NSN Groups to display it.

If a forum post will work, you can create a forum with access only to that group, and the messages will only appear in a forums block for those in the group.
 
probador
PostPosted: Tue Jun 27, 2006 4:48 am Reply with quote

Yes thats what i thought but i dont seem to find the nsn Groups code that controls whether certain block or module is displayed
 
kguske
PostPosted: Tue Jun 27, 2006 5:55 am Reply with quote

If you look at the instructions for modifying the mainfile.php, you should find a reference to an NSN function called something like in_group() that determines whether or not the current user is in the group that is passed as an argument to that function.

It would probably be easier to use the existing message function anyway, but again, I'm not sure where you want this content to appear.
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Tue Jun 27, 2006 6:43 am Reply with quote

Here is a sample of what I have done in the HTML Newsletter module to address this:

Code:


if ( in_groups( $groups ) ) {

            echo "YOUR TEXT TO SHOW FOR THIS GROUP"

         }


You have to pass it in the $groups variable a "dash separated" string of groups that the user's group list should be checked against. So, for example, lets say you want groups 1, 3, and 4 to be able to see this text. $groups would need to look like this:

$groups = "1-3-4"

Then, in_groups() function will check the logged in user's groups against this list you pass in.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©