Removing Search from menu

Started by TheListener, November 03, 2011, 09:44:01 PM

Previous topic - Next topic

TheListener

Would doing this have any effect on the search bar on the top right of the forum?

Personally I can't see the point in having both.

The Craw

I don't either. And you can remove the button without affecting the regular search function.

mashby

Depends on what search bar you are referring to. I think the menu search is a general one and the top-right one is contextual depending on what you are viewing at the moment. I also play a doctor on TV.
Always be a little kinder than necessary.
- James M. Barrie

TheListener

The search in the menu bar is the one I want to lose.

Oh and I plaay 5 different characters on a Star Trek rpg.

My Ferengi character is Chief of security on a Starship. We are about to go to war with the Dominion.

mashby

I hope my scalpel is correct. In Sources/Subs.php, find and remove:
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),
Results not guaranteed in Tennessee.
:)
Always be a little kinder than necessary.
- James M. Barrie

TheListener


mashby

Cool. Let us know how your surgery turns out. :)
Always be a little kinder than necessary.
- James M. Barrie

TheListener

foreach ($context['menu_buttons'] as $act => $button)
568:
{
569:
echo '
570:
<li id="button_', $act, '">
571:
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
==>572:    
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
573:    
</a>';

http://xxxxxxxxc/index.php?action=search2
Apply Filter: Only show the errors with the same message
8: Undefined index: title
Apply Filter: Only show the errors from this file
File: /home/xxxxxxxx/index.template.php
Line: 572
    Undefined index: href
Apply Filter: Only show the errors from this file
File: /homexxxxxxxxxx/index.template.php
Line: 571

Now have these 2 errors. These occurred when I tested the top right search again.

The Craw

If you would please attach your Subs.php file, we can fix this. It looks like part of the search button code is still in the menu array.

TheListener

Wouldn't have anything to do with the Enhanced dsearch fdropdown mod?

Ya making me  :-[


live627

What is your cache level? Do yo u have a PHP accelerator?

TheListener

Quote from: live627 on November 04, 2011, 01:54:58 AM
What is your cache level? Do yo u have a PHP accelerator?

Pardon?

Will I find these in my cpanel?

live627

No, it's rather in the SMF admin, rather, under Server Configuration > Cache

TheListener


Mick.

You don't have to remove the entire code.

Just replace $context['allow_search'],

To false,

TheListener

Do I just change allow_search to false?

Mick.

Quote from: Brack1 on November 04, 2011, 01:20:44 PM
Do I just change allow_search to false?
change all of it. What I posted.

May the force be with you Luke.

Clear cache too after.

TheListener

Almost there.

Cleared cache then made a test search.

I now see what is in the attachment plus the same error as posted above.

Oldiesmann

It sounds like you left the "search => array(" and ending ")," in there and just removed the code in between the two lines.
Michael Eshom
Christian Metal Fans

TheListener

'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => false,
'sub_buttons' => array(
),
),


Is what I have.

Advertisement: