News:

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

Main Menu

Having real button trouble here

Started by Cheese-Burger, June 01, 2005, 08:27:09 AM

Previous topic - Next topic

Cheese-Burger

Hi chaps
After searching the forums for adding new buttons, i thought i found the answer, but every time i try i get this error
Template Parse Error!
There was a problem loading the /Themes/deluxe/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


Can anyone enlighten me as to what i`m doing wrong. All i want to do is put a button next to the "home" button, linking it to a conversion chart.

I am getting very frustrated  >:(
Hate code. Love burgers

xenovanis

Can you post the code you are using?
"Insanity: doing the same thing over and over again and expecting different results."

Cheese-Burger

I`m using this
echo '
<a href="http//:www.hamburger-deluxe.cu.uk">', ($settings['use_image_buttons'] ? '<img src="http://www.hamburger-deluxe.co.uk/SMF/Themes/default/images/english/conversionchart.gif " alt="DESCRIPTION OF LINK HERE" style="margin: 2px 0;" border="0" />' : DESCRIPTION OF LINK HERE), '</a>';



This is exactly what i am inserting. The actual code is what i got from searching for adding new buttons. I just inserted my url`s.
Hate code. Love burgers

xenovanis

If you want it to the left of the home-button, you should try something like this:


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

// Go to the desired site
echo '
           <a href="http://www.domain.com" target="_blank"><img src="http://www.yourimagelocation.com/Themes/image.gif" alt="To the site" style="margin: 2px 0;" border="0" /></a>', $context['menu_separator'];

// 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'];
"Insanity: doing the same thing over and over again and expecting different results."

Cheese-Burger

// Go to the desired site
echo '
           <a href="http://www.hamburger-deluxe.co.uk/toppage1.htm" target="_blank"><img src="http://www.hamburger-deluxe.co.uk/SMF/Themes/default/images/english/conversionchart.gif" alt="To the site" style="margin: 2px 0;" border="0" /></a>', $context['menu_separator'];


So i can just copy and paste this right?
Hate code. Love burgers

xenovanis

Yes, this is how it works on my site (using a copy of default theme).
"Insanity: doing the same thing over and over again and expecting different results."

Cheese-Burger

 :D Sweet, that worked. Thanks for taking the time to help me out.
Hate code. Love burgers

Advertisement: