Problem with index.template.php file and adding new tab.

Started by Sylystia, October 21, 2009, 09:55:31 PM

Previous topic - Next topic

Sylystia

I am running version SMF 1.1.10 and the theme the Cerberus for 1.1.10.

My php info can be found hxxp:agonysend.org/phpinfo.php [nonactive]

My problem is this:

I went and downloaded the index.template.php file from the /forums/theme/cerberus file on my server. I used the tutorial for Tabs 1.1 from this site and when I try to search for the code that is listed there with find it does not show. I even tried to manually look for each word. I am at a loss as to what I am doing wrong at this point. I am so sorry if there is a simple answer to this question that I have overlooked. I just can not seem to find anything for a problematic index.template.php file.

Thank you in advance.

cme1st2302

I pulled the index.template.php file for the Cerberus from the themes site.  The following is the code for the tabs for that theme. 

// Show the [home] and [help] buttons.
        echo '<b>
                                <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
                                <a href="', $scripturl, '?action=help" >', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

        // How about the [search] button?
        if ($context['allow_search'])
                echo '
                                <a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

        // Is the user allowed to administrate at all? ([admin])
        if ($context['allow_admin'])
                echo '
                                <a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0" />' : $txt[2]), '</a>', $context['menu_separator'];

        // Edit Profile... [profile]
        if ($context['allow_edit_profile'])
                echo '
                                <a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];

        // The [calendar]!
        if ($context['allow_calendar'])
                echo '
                                <a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];

        // If the user is a guest, show [login] and [register] buttons.
        if ($context['user']['is_guest'])
        {
                echo '
                                <a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
                                <a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>&nbsp;&nbsp;&nbsp;';
        }
        // Otherwise, they might want to [logout]...
        else
                echo '
                                <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>&nbsp;&nbsp;&nbsp;';
        echo '</b>';
}


If you want me to help you add a tab just tell me what you want the button to say and the url and I can tell you what to add where.

Chris
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

Sylystia

Thank you for replying Chris. All I'd like to do is replace the help tab with a forum tab. Once again thank you. :)

Button just needs to say Forum

URL is hxxp:www.agonysend.org/forums/index.php?action=forum [nonactive]

Once again thank you. :)

Updated:

Well I added this line of code:

// How about the [forum] button?
if($settings['TPortal_front_type']!='boardindex')
echo '        <a href="', $scripturl, '?action=forum">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forum.gif" alt="Forum Index" style="margin: 2px 0;" border="0" />' : 'Forum Index'), '</a>', $context['menu_separator'];


After this line of code:
How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];



Now I seem to be getting a black border around the Forum Button. I am including my index.template.php file.

I am also having trouble deleting the help button and putting a donate button. But that's for another thread. :)

JimM

Is this issue solved now?  I noticed you have your forum button working in your custom theme.  If this is solved please mark it solved by clicking the Mark Topic Solved link at the bottom left of the page.
Jim "JimM" Moore
Former Support Specialist

Sylystia

No it is not quite resolved, since I am still getting that black border around the Forum button. And I had to just take a lucky guess on where to put the code for the button, so I am sure that is probably the problem and I do not know what to do to rectify it.

JimM

I just took a look at your forum and it appears to be functioning exactly like the rest of the tabs.  The black border indicates the last tab clicked.  Clicking Home places it there, clicking Help places it there, etc. 

I am using FF though and sometimes the browser can make a difference.
Jim "JimM" Moore
Former Support Specialist

Sylystia

My bad someone changed the theme. No worries though. Thank you kindly for all the help.

Advertisement: