News:

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

Main Menu

Re: Adding a page to the navbar.

Started by MordyT, June 03, 2010, 11:19:21 PM

Previous topic - Next topic

MordyT

Hello,
I have tried adding a simple tab to the navbar using instructions found here, but have had no luck.
I am using SMF 2.0RC3 with EOTSDZINE Call of Duty Fluid style.
Here is what I added:
  'sponsors' => array(
            'title'  => $txt['sponsors'],
            'href' => 'http://rvoclan.info/index.php?page=donations',
            'show'  => true,
            'sub_buttons' => array(
            ),
         ),


My subs.php file looks like (in short)
All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
    if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
    {
        $buttons = array(
            'home' => array(
                'title' => $txt['home'],
                'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
                'show' => true,
                'sub_buttons' => array(
                ),
                'is_last' => $context['right_to_left'],
                // 'target' => '_blank',
            ),
            'forum' => array(
                'title' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
                'href' => $scripturl . ($modSettings['sp_portal_mode'] == 1 && empty($context['disable_sp']) ? '?action=forum' : ''),
                'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']),
                'sub_buttons' => array(
                ),
            ),
            'help' => array(
                'title' => $txt['help'],
                'href' => $scripturl . '?action=help',
                'show' => true,
                'sub_buttons' => array(
                ),
            ),
            'custom' => array(
                'title' => !empty($modSettings['custom_tab_label']) ? $modSettings['custom_tab_label'] : $txt['custom_tab_label_default'],
                'href' => !empty($modSettings['custom_tab_execute_url']) ? $modSettings['custom_tab_execute_url'] : $scripturl,
                'show' => $user_info['is_guest'] ? !empty($modSettings['custom_tab_enable_guest_access']) : !empty($modSettings['custom_tab_enable_member_access']),
                'sub_buttons' => array(
                ),
            ),
            'arcade' => array(
                'title' => $txt['arcade'],
                'href' => $scripturl . '?action=arcade',
                'show' => $context['allow_arcade'],
                'sub_buttons' => array(
                ),
            ),
            'search' => array(
                'title' => $txt['search'],
                'href' => $scripturl . '?action=search',
                'show' => $context['allow_search'],
                'sub_buttons' => array(
                ),
            ),
            'sponsors' => array(
            'title' => $txt['sponsors'],
            'href' => 'http://rvoclan.info/index.php?page=donations',
            'show' => true,
            'sub_buttons' => array(
            ),
            ),
            'teampage' => array(
                'title' => (!empty($txt['team']) ? $txt['team'] : 'Team'),
                'href' => $scripturl . '?action=teampage',
                'show' => true,
                'sub_buttons' => array(
                ),
            ),

As soon as I add the code right before teampage, I start getting errors in the error log...

http://rvoclan.info/index.php?pretty;action=forum
8: Undefined index:  sponsors
File: /home/removedforsecuirty/public_html/rvoclan.info/Sources/Subs.php
Line: 3966


I am guessing this has to do with PrettyURLs
Want to see SMF in action? Head over to RvOClan.info

Sabre™

I have no idea why mate, Im just dosing off to sleep so not thinking correct, but as a short suggestion, try renaming 'sponsors' => array(     to     'donations' => array(
It might blow up your forum, but is worth a try ;)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


MordyT

Well, truth is I have a donations tab already. But needless to say, I have tried different names, same issue.
Want to see SMF in action? Head over to RvOClan.info

CapadY

Did you add a textstring for 'Sponsors' in your language file(s) ?
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

MordyT

Quote from: capady on June 04, 2010, 03:55:13 AM
Did you add a textstring for 'Sponsors' in your language file(s) ?
I think I did, /themes/default/index.english.php at the bottom...
But I may not have, I will check...

I thought you only needed to do that if you had multiple different languages?
Want to see SMF in action? Head over to RvOClan.info

Liam.

Quote from: MordyT on June 04, 2010, 07:15:07 PM
Quote from: capady on June 04, 2010, 03:55:13 AM
Did you add a textstring for 'Sponsors' in your language file(s) ?
I think I did, /themes/default/index.english.php at the bottom...
But I may not have, I will check...

I thought you only needed to do that if you had multiple different languages?

Well it should be there. You could use this instead:

            'title'  => 'Sponsors',

But otherwise, you need it in your language files using $txt. To be honest, what did you want it to say, "Sponsors"? If so, where do you think it'd get it from?

Ultimately, add it to index.english.php or modifications.english.php and it will work alot easier.

MordyT

Quote from: Liam. on June 04, 2010, 08:16:12 PM
Quote from: MordyT on June 04, 2010, 07:15:07 PM
Quote from: capady on June 04, 2010, 03:55:13 AM
Did you add a textstring for 'Sponsors' in your language file(s) ?
I think I did, /themes/default/index.english.php at the bottom...
But I may not have, I will check...

I thought you only needed to do that if you had multiple different languages?

Well it should be there. You could use this instead:

            'title'  => 'Sponsors',

But otherwise, you need it in your language files using $txt. To be honest, what did you want it to say, "Sponsors"? If so, where do you think it'd get it from?

Ultimately, add it to index.english.php or modifications.english.php and it will work alot easier.

Ok, I know I did try it with 'title'  => 'Sponsors',, and still couldn't get it to show.

What do I need to do with modifications.english.php?
Want to see SMF in action? Head over to RvOClan.info

CapadY

Quote from: MordyT on June 04, 2010, 08:31:45 PM
Ok, I know I did try it with 'title'  => 'Sponsors',, and still couldn't get it to show.

What do I need to do with modifications.english.php?

And did you also empty the forum cache when you tried that ?

After any change of text, just empty the forumcache.

Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

MordyT

Of course I tried that. No go for me.
Want to see SMF in action? Head over to RvOClan.info

Advertisement: