Author |
Message |
probador
New Member


Joined: Apr 20, 2006
Posts: 24
|
Posted:
Mon Jun 26, 2006 10:49 am |
|
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 !  |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Mon Jun 26, 2006 8:24 pm |
|
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 search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
probador

|
Posted:
Tue Jun 27, 2006 3:22 am |
|
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

|
Posted:
Tue Jun 27, 2006 4:45 am |
|
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

|
Posted:
Tue Jun 27, 2006 4:48 am |
|
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

|
Posted:
Tue Jun 27, 2006 5:55 am |
|
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: 9457
Location: Arizona
|
Posted:
Tue Jun 27, 2006 6:43 am |
|
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! |
|
|
 |
|