1
jbaudin
Get the user group !
  • 2004/2/18 7:52

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


I want to know how can i see if a user is in a specified group ?

I want to display one html link (no block or module) if user is in one group not other.

Thank you for your help !


Sorry, i am french and i don't speak english very well !

2
Mithrandir
Re: Get the user group !

You can use $xoopsUser->getGroups() to get an array with the groups, a user belongs to and then see if the desired group is in that array.

If you only have the name of the group and not the ID, you'll have to look into the XoopsGroupHandler::getObjects() method.

3
jbaudin
Re: Get the user group !
  • 2004/2/18 14:45

  • jbaudin

  • Just popping in

  • Posts: 42

  • Since: 2004/1/22


Thank you, but i'm not superman with PHP.

I want to disable link in theme.html
For cutomise my page when a user is connected or not, i use thise code :

<{if $xoops_isuser}>

<{else}>

<{/if}>

How can i do the same thing with group ?
Like this :
<{if $xoops_usergrp='1'}>

<{else}>

<{/if}>

I think i must modified header.php, but i don't know how to do that.
It's just for one group, i want to disable a link.

Thank you !

Login

Who's Online

363 user(s) are online (260 user(s) are browsing Support Forums)


Members: 0


Guests: 363


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits