Advertisement:

Author Topic: Extra Button for Main Page  (Read 1955 times)

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Extra Button for Main Page
« on: January 05, 2012, 07:11:02 AM »
Hi guys on my main page I have wordpress and under /forum I have smf, I would like a user to be able to navigate back to main page from smf, and would like to add an extra button "Main Page" which will direct to wordpress, how can I do that? If it is with editing smf files, would this stay on the next upgrade?

Thanks,
Anarchy

French

  • Guest
Re: Extra Button for Main Page
« Reply #1 on: January 05, 2012, 07:25:44 AM »
Graphics and Themes go to How to add tabs to themes.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,010
Re: Extra Button for Main Page
« Reply #2 on: January 05, 2012, 07:39:25 AM »
How do I add buttons to SMF 2.0

and yes if you use the package manager to upgrade your change will stay in place.

also this is not a graphics nor templates issue any longer in 2.0.

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Re: Extra Button for Main Page
« Reply #3 on: January 06, 2012, 07:22:29 AM »
I did it successfully for the English lang and current theme in Subs.php, but background of "Home" is highlighted with orange, I want this highlight to be valid or active for "Main Page" button, how can I accomplish this one?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,010
Re: Extra Button for Main Page
« Reply #4 on: January 06, 2012, 07:27:55 AM »
find // Figure out which action we are doing so we can set the active tab.
   // Default to home.

in that file and copy one of the elseif's and edit it to match what you put in your custom button.

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Re: Extra Button for Main Page
« Reply #5 on: January 06, 2012, 07:51:42 AM »
Errm .. sorry but I didnt quite get what you mean ... I copy pasted 'Home' button, changed it to my desired custom button, but only the home is highlighted, can you maybe give an example? Or give the exact code I should be looking for to modify?

Thanks

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,010
Re: Extra Button for Main Page
« Reply #6 on: January 06, 2012, 07:52:31 AM »
can you post the code you added for your button?

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Re: Extra Button for Main Page
« Reply #7 on: January 06, 2012, 08:01:20 AM »
Code: [Select]
        // All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
        if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || ti$
        {
                $buttons = array(
                        'ana' => array(
                                'title' => 'Ana Sayfa',
                                'href' => 'http://www.hababam.biz',
                                'show' => true,
                                'sub_buttons' => array(
                                ),
                                'is_last' => $context['right_to_left'],
                        ),

                        'home' => array(
                                'title' => 'Forum',
                                'href' => $scripturl,
                                'show' => true,
                                'sub_buttons' => array(
                                ),
                //              'is_last' => $context['right_to_left'],
                        ),
                        'help' => array(
                                'title' => $txt['help'],
                                'href' => $scripturl . '?action=help',
                                'show' => true,
                                'sub_buttons' => array(
                                ),
                        ),

Ana Sayfa = My Custom Button
Forum = Home button

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,010
Re: Extra Button for Main Page
« Reply #8 on: January 06, 2012, 08:04:51 AM »
that button cant be set as active as it is not an action that is part of smf, the reason the "home" button is orange is because it is the page the user is currently on.

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Extra Button for Main Page
« Reply #9 on: January 06, 2012, 08:18:19 AM »
Hi, if you are showing that menu bar on the Ana Sayfa page.  Something to try.

In the page for Ana Sayfa, before SSI.php is included, add the following:

 
Code: [Select]
$_GET['action'] = 'ana';

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Re: Extra Button for Main Page
« Reply #10 on: January 06, 2012, 08:30:14 AM »
I thought home was specially highlighted because it is home :) but when I navigated to admin, search etc. I see that they are also highlated, all clear and Ana Sayfa is completely something else, wordpress ... I guess thats why it cant be highlighted, but no problem, the site will survive :) thanks a lot for the replies guys,

Anarchy





Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Extra Button for Main Page
« Reply #11 on: January 06, 2012, 08:45:03 AM »
Yes, that's because Home is the default button.

Are you showing the menu bar on the Ana Sayfa page? It is possible to highlight the button. I've done it before. Just forget how though. ::)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline Anarchy

  • Jr. Member
  • **
  • Posts: 108
    • HaBaBaM.BiZ
Re: Extra Button for Main Page
« Reply #12 on: January 06, 2012, 12:22:00 PM »
No both are separate installations have no bridge or any other connection between, in this case I will put Ana Sayfa button the bottom I guess because doesnt look nice , or I will try other combinations :)