Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Darkmatter on April 08, 2008, 06:48:43 PM

Title: Help needed adding a link/button to my SMF header section
Post by: Darkmatter on April 08, 2008, 06:48:43 PM
I recently got a request from members of my forum about adding a link back to my website's home page from the SMF forum.

At first glance I thought the best place to add this feature would be next to the Logout/Login button which appears on every SMF page as follows.

Home Help Search Admin Profile My Messages Calendar Members Logout ReturnToMyWebsite


Where are these buttons loaded (which file) and how easy is it to add a new button next to the Logout/Login button which will enable members to pop back to the splash page of my site. Basically, pressing the ReturnToMyWebsite button will just take them back to my homepage http://www.ABC-XYZ.com

Or is there an easier way to implement this requested feature?
Title: Re: Help needed adding a link/button to my SMF header section
Post by: metallica48423 on April 08, 2008, 07:09:55 PM
which SMF version?
Title: Re: Help needed adding a link/button to my SMF header section
Post by: Darkmatter on April 08, 2008, 08:21:56 PM
I am currently running

SMF 1.1.4
Title: Re: Help needed adding a link/button to my SMF header section
Post by: metallica48423 on April 08, 2008, 08:56:09 PM
http://docs.simplemachines.org/index.php?topic=564.0
Title: Re: Help needed adding a link/button to my SMF header section
Post by: Darkmatter on April 08, 2008, 08:59:00 PM
Thank you ... I will try to implement it.
Title: Re: Help needed adding a link/button to my SMF header section
Post by: HellBent on April 09, 2008, 10:57:26 AM
Here's the code:

// Show [mywebsite] button.

echo '<td><a href="http://www.yourwebsite.com/"  target="_self">Your Website</a></td>';


That works for me anyhow :)
Title: Re: Help needed adding a link/button to my SMF header section
Post by: Darkmatter on April 09, 2008, 11:26:48 AM
One more question. I tried the above and it works great. One of the new  buttons which I added is a TV button.  The only problem with the TV button is it opens up the TV show in the same window as the forum. How do I open a separate window when using the TV button. Below is my code which opens a TV window in the current window..

// Show the [TV] button.
   echo ($current_action=='tv' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'tv' ? 'active_back' : 'back' , '">
               <a href="http://www.jumptv.com/en/channel/cns/">TV</a>
            </td>' , $current_action == 'tv' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: Help needed adding a link/button to my SMF header section
Post by: Darkmatter on April 09, 2008, 12:09:35 PM
Got it ... TARGET="_blank"