News:

Wondering if this will always be free?  See why free is better.

Main Menu

Search button removal

Started by TheListener, February 15, 2010, 01:13:47 PM

Previous topic - Next topic

TheListener

I want to get rid of one of the search facilities on the forum.

Either the search button in the menu bar or the unsightly search bar located on the top right of the forum below the slogan.

Can this be done? 

kat

Just thinking out loud, here...


index.template.php


Remove:    <link rel="search" href="' . $scripturl . '?action=search" />


That ought to get rid of one of 'em. (Keep a backup, obviously)

kat

Delete this lot, too?


echo '
<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<form class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<a href="', $scripturl, '?action=search;advanced" title="', $txt['search_advanced'], '"><img id="advsearch" src="'.$settings['images_url'].'/filter.gif" align="middle" alt="', $txt['search_advanced'], '" /></a>
<input type="text" name="search" value="" style="width: 190px;" class="input_text" />&nbsp;
<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>';



TheListener

Thanks Kat.

(passes the toy mouse)

kat

Don't thank me, 'til you're tried it.


I may have sold you a kipper.  ;)

TheListener

Kat wheres that mouse I take it back.

Bad news bud. had an error

kat

* Kat wanders off to his test forum and tries a few things...


Back in a while...

kat

EW!


I didn't get an error, but it sure screwed the graphics!


I'll try a few things. This was sooo much easier to do with v1.1.11.

kat

Not exactly whay you want, but you could always delete Search.template.php....

kat

#9
To get rid of the search box, find and delete this from index.template.php:


        <div class="news normaltext">
            <form id="search_form" style="margin: 0;" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
               <input type="text" name="search" value="" class="input_text" />&nbsp;
               <input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
               <input type="hidden" name="advanced" value="0" />';

      // Search within current topic?
      if (!empty($context['current_topic']))
         echo '
               <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
         // If we're on a certain board, limit it to this board.
      elseif (!empty($context['current_board']))
         echo '
               <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

      echo '</form>';

      // Show a random news item? (or you could pick one from news_lines...)
      if (!empty($settings['enable_news']))
         echo '
            <h2>', $txt['news'], ': </h2>
            <p>', $context['random_news_line'], '</p>';

      echo '
         </div>



That gets rid of the News thingy, too, though. Leave that bit in, if you need that.

TheListener

Almost there.

Was asking for a , on line 302

Nevermind it was only a thought of mine.

( yep I'm a fussy git)

kat

Bugger.


There're two closed divs, at the end. Should only be one...


Amended.  :)

kat

This is a bit dirty, for the other "Search" thing. Not sure if it'll screw anything else...


If you look at index.english.php, in the default theme's languages directory, you can delete this line:


$txt['search'] = 'Search';


That'll get rid of the buttony thing, but leave a small gap, instead.


Not ideal, I'll grant you.


TheListener

Quote from: Kat on February 15, 2010, 04:48:33 PM
Bugger.


There're two closed divs, at the end. Should only be one...


Amended.  :)

Tried to get rid of the search box ( keeping the news fader) had no joy. Gave me an error saying there was a missing , or ; on line 302

kat

I just tried that and got similar.


Wish I knew php...


I'll fart around and see if I can figure it.

TheListener

Make sure ya windows are open first.

;D

kat

Ha!


I prob'ly just need to echo something, but I can't figure it...


Still farting around...

kat

This'll probably make a real coder shudder. But, I just removed these two lines and it seems to work...


<input type="text" name="search" value="" class="input_text" />&nbsp;
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />


TheListener

Woohoo

You have just earned a years supply of catnip.

That did the job just nicely.

kat

Phew!


I really must learn some php...  :)

Advertisement: