News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Adding a link in profile box - only viewable by admin + a group

Started by webou, June 09, 2010, 05:16:17 PM

Previous topic - Next topic

webou

Hello,

I am modifying /Themes/default/Display.template.php because I want to add a link there, only for admins and mods.

So I am using this code :if($context['allow_admin'] || in_array(2, $user_info['groups']))

This makes the link viewable by the admins, but not by the mods (group 2).
This code works on another part of the website (with SSI.php).

I don't really know what's wrong.

Thanks,

Mike

Arantor

Holder of controversial views, all of which my own.


webou

No, not any.

I tried to look for the $user_info array :
echo '<pre>';
print_r($user_info);
echo '</pre>';


But it gives no output, so the array would not exist when displaying a topic ?

Arantor

No, that means it's not in scope. Add $user_info to the list of global variables at the start of the function.
Holder of controversial views, all of which my own.


webou

Excellent that did it ! Thank you for your speed and accuracy :)


Advertisement: