Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Navigation Button/Link

Aloittaja pixeleyes, marraskuu 24, 2010, 12:48:44 AP

« edellinen - seuraava »

pixeleyes

I wanted to create a button in navigation bar, which show only after login.

         ),
         'music' => array(
            'title' => 'Music',
            'href' => 'http://www.yoursite.com/link',
            'show' => true,
            'sub_buttons' => array(
            ),

What will be that code.

Illori


'music' => array(
            'title' => 'Music',
            'href' => 'http://www.yoursite.com/link',
            'show' => !$user_info['is_guest'],
            'sub_buttons' => array(
            ),


that might work, I have not tested it though.

pixeleyes


NanoSector

If you do not want a button to show to admins you can do this:

'show' => !$user_info['is_admin'],

Remove the ! if you only want it to show to admins.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: