• Welcome to Simple Machines Community Forum. Please login or sign up.
October 27, 2021, 09:42:58 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Extra Button for Main Page

Started by Anarchy, January 05, 2012, 07:11:02 AM

Previous topic - Next topic

Anarchy

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
www.hababam.biz
www.hababam.biz/forum

French


Illori

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.

Anarchy

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?
www.hababam.biz
www.hababam.biz/forum

Illori

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.

Anarchy

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
www.hababam.biz
www.hababam.biz/forum

Illori

can you post the code you added for your button?

Anarchy

        // 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
www.hababam.biz
www.hababam.biz/forum

Illori

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.

Kays

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:


$_GET['action'] = 'ana';

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

Anarchy

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




www.hababam.biz
www.hababam.biz/forum

Kays

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

Anarchy

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 :)
www.hababam.biz
www.hababam.biz/forum

Advertisement: