Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: MordyT on June 03, 2010, 11:19:21 PM

Title: Re: Adding a page to the navbar.
Post by: MordyT on June 03, 2010, 11:19:21 PM
Hello,
I have tried adding a simple tab to the navbar using instructions found here (http://www.simplemachines.org/community/index.php?topic=261880.0), 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
Title: Re: Re: Adding a page to the navbar.
Post by: Sabreā„¢ on June 03, 2010, 11:26:04 PM
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 ;)
Title: Re: Re: Adding a page to the navbar.
Post by: MordyT on June 04, 2010, 12:02:27 AM
Well, truth is I have a donations tab already. But needless to say, I have tried different names, same issue.
Title: Re: Re: Adding a page to the navbar.
Post by: CapadY on June 04, 2010, 03:55:13 AM
Did you add a textstring for 'Sponsors' in your language file(s) ?
Title: Re: Re: Adding a page to the navbar.
Post by: 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?
Title: Re: Re: Adding a page to the navbar.
Post by: 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.
Title: Re: Re: Adding a page to the navbar.
Post by: MordyT on June 04, 2010, 08:31:45 PM
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?
Title: Re: Re: Adding a page to the navbar.
Post by: CapadY on June 05, 2010, 04:38:32 AM
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.

Title: Re: Re: Adding a page to the navbar.
Post by: MordyT on June 06, 2010, 02:18:55 PM
Of course I tried that. No go for me.