1
elrohir
Add entry to user menu based on group
  • 2007/9/2 13:39

  • elrohir

  • Just popping in

  • Posts: 37

  • Since: 2006/9/14


So I made a few new groups, and I want one of them, with group id 4, to have an extra link anywhere in their user menu.
The only way I see of doing anything similar with the smarty tags is something like
<{if $xoops_isadmin}>
    <
class="menuTop"href="link">
        
Link
    
a>
<{/if}>


But that's for administrators, and I most definitely don't want to make them all admins :/

is there something in the smarty/php that could check for a group id? Say, like

<{if $xoops_isgroup(4)}>
    <
class="menuTop"href="link">
        
Link
    
a>
<{/if}>


or something?

Cheers
-E

2
stefan88
Re: Add entry to user menu based on group
  • 2007/9/2 14:36

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


..

3
elrohir
Re: Add entry to user menu based on group
  • 2007/9/2 14:41

  • elrohir

  • Just popping in

  • Posts: 37

  • Since: 2006/9/14


Thanks, that's just what I'm looking for. Apparently my search terms were a bit too specific...

ta
-E

4
elrohir
Re: Add entry to user menu based on group
  • 2007/9/2 15:16

  • elrohir

  • Just popping in

  • Posts: 37

  • Since: 2006/9/14


well, I f**kd up yet again.
I added the wrong thing to the editor in the adminitrative menu, and now I get

Quote:

This page cannot be displayed due to an internal error.

You can provide the following information to the administrators of this site to help them solve the problem:

Error: Smarty error: [in db:system_block_user.html line 19]: syntax error: variable function call '$in_group' not allowed in if statement (Smarty_Compiler.class.php, line 1386)


I am looking through the template files on the server, but they all look the same as they did before I added the extra bits. The stuff I added was:

<{if $in_group('Styret')}>
[
a link c+v'd from the lines above]
<{/if}>



// Edit //
it's working again. I don't think I actually did anything, but there you are. it works. YAY!

5
Alex_Grey
Re: Add entry to user menu based on group
  • 2007/9/2 15:40

  • Alex_Grey

  • Just popping in

  • Posts: 43

  • Since: 2007/6/16


i was gonna say. the $ shouldnt be there..

Quote:
Error: Smarty error: ...
syntax error: variable function call '$in_group' not allowed in if statement (Smarty_Compiler.class.php, line 1386)


good..
<{if in_group('Styret')}>
[
a link c+v'd from the lines above]
<{/if}>
“There is nothing impossible to him who will try.” ~Alex The Great~
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

6
elrohir
Re: Add entry to user menu based on group
  • 2007/9/2 16:05

  • elrohir

  • Just popping in

  • Posts: 37

  • Since: 2006/9/14


hehe, that too...

How many things is it possible to get wrong with like seven lines of code? XD

At least it works now

Login

Who's Online

352 user(s) are online (275 user(s) are browsing Support Forums)


Members: 0


Guests: 352


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