News:

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

Main Menu

help

Started by joshkol, July 31, 2005, 10:31:24 PM

Previous topic - Next topic

joshkol

how do i change the buttons on my template???

Ivan Minic

Just upload new ones to the same location where old ones were...

joshkol

I guess i should have explained better, i want the home button to go to a different link and i want to add a button, where would i add the html part in the script?

Ivan Minic

index.template.php
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.
echo '
<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" target="_blank">', ($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'];
. . . . .

joshkol

i got that whole part but where exactly do i type the url?

Ivan Minic

Well, if you know html, that wouldn't be a problem, it is well explained and documented...
for example for Home, all u need is to change this:
<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>'
Into
<a href="Whatever url you want">', ($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>'
Where "Whatever url you want" represents new url you want to use

joshkol

thank that helped alot but how do i add a button, i got a picture but i dont know the exact html to type.

Ivan Minic

Be specific, where exactly to put what button linked to where in menu....

joshkol

well i linked the home button to the site home page(not the forum home page) and now i want a button that goes to the forum index in the menu next to home(if posible not picky).

Ivan Minic

index.template.php

Find:
// Show the [home] and [help] buttons.
echo '
<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" target="_blank">', ($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'];


Replace:
// Show the [home] and [help] buttons.
echo '
<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> <a href="location you are linking to" target="_blank"><img src="' . $settings['images_url'] . '/button1.gif" alt="alt tex" style="margin: 2px 0;" border="0" /></a> <a href="', $scripturl, '?action=help" target="_blank">', ($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'];

Where:
location you are linking to - actual link
$settings['images_url'] . '/button1.gif - image of new button located in Themes/default/images/
alt tex - short description of that link

joshkol

thx for the help

joshkol

i replaced it with

// Show the [home] and [help] buttons.
   echo '
            <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> <a href="http://www.kyouakujounins.com/forums/" target="_blank"><img src="' . $settings['images_url'] . '/forum.gif" alt="forum index" style="margin: 2px 0;" border="0" /></a> <a href="', $scripturl, '?action=help" target="_blank">', ($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'];</td>';

tell me if thats right plz cause i got an error message

www.kyouakujounins.com/forums/

joshkol

nvm, i got it to work, thx

joshkol

this is probaly not possible but how do i add a second bar(with same buttons(i can change lator)right under the main navigation bar?

www.kyouakujounins.com/forums/

1MileCrash

just put a <BR>, then add your new buttons...it's just plain html
The only thing php can't do is tell you how much milk is left in the fridge.



joshkol

i need to add the bar the buttons are on

joshkol

and where in the index.template would i put this html text?

Advertisement: