News:

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

Main Menu

Adding a new button

Started by Anhinga, July 13, 2005, 06:22:50 PM

Previous topic - Next topic

Anhinga

I've just integrated my SMF forum with Coppermine Photo Gallery, and I'd like to add a button linking to the gallery between the "home" and "help" buttons on the main page of the forum.  I know I'll need to alter the index.template.php file in order to do this, but I don't know exactly what the changes are that I'll need to make.

Can anyone tell me what I'll need to alter about the PHP code in order to add a new button like this?

xenovanis

Please use the searchfunction. This has been discussed many times before.

Search for:

add buttons
adding buttons

;)
"Insanity: doing the same thing over and over again and expecting different results."

Anhinga

OK, I've got it now.  Well, thanks anyway.

Anhinga

I have one other question about this that wasn't answered by any of the threads I could find.  The only PHP code I could find for adding a new link button always makes the link relative to the domain it's on.  Normally this isn't a problem, since my forum is www.snakebird.net/polaris and it's linking to snakebird.net/gallery.  However, my forum also has its own subdomain, polaris.snakebird.net, and when I click the "gallery" link on this it sends me to http://polaris.snakebird.net/gallery which doesn't exist.

How do I make the link always take me to the same URL, regardless of the domain or subdomain being linked from?

xenovanis

How does this work for you?


//The Gallery
echo '
<a href="http://www.snakebird.net/gallery"><img src="Themes/default/images/english/gallery.gif" alt="Gallery" style="margin: 2px 0;" border="0" /></a>', $context['menu_separator'];
"Insanity: doing the same thing over and over again and expecting different results."

Anhinga

I had to change the path of the gallery icon, but other than that it works.  Thanks.

reeking

Sorry if im being really stupid

My boards part of a larger site and i want to put another button on it which takes me to the site homepage, i tried using the scripting here and it cmae up with loads of errors..any help?

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

Advertisement: