1
AngeHell
How to detect the user's group
  • 2007/10/22 9:11

  • AngeHell

  • Just popping in

  • Posts: 5

  • Since: 2007/8/29


Hello, I m making a website with some other groups like admin or users and i want to create a theme who detect wich group the user has to use it like a custom interface.

I have try in php, but when I want to use it in theme.html, the file is in html, of course, and if y want to use it in php the XOOPS language is writing and not understand.

2
zyspec
Re: How to detect the user's group
  • 2007/10/22 21:12

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


You can use php code inside of html templates as long as you're using the smarty template engine. Just insert the group detection code inside <{php}> and <{/php}> smarty tags. You can pass variables between smarty and php to get the desired effect using either the get_template_vars or assign statements. You'll have to put together some type of hierarchy since a user can belong to more than one group (even something as simple as an admin belongs to both the admin and the registered users groups).

If you just want something different for the admin group users then you can use the XOOPS smarty <{$xoops_isadmin}> variable to determine if the user is in the admin group.

Login

Who's Online

400 user(s) are online (263 user(s) are browsing Support Forums)


Members: 0


Guests: 400


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