Adding the Search function to the "Info Center"

Started by Bazil Greyson, April 09, 2008, 01:07:38 AM

Previous topic - Next topic

Bazil Greyson

Hello,

I am wondering how to go about adding the search function into the "info Center" on the forum index. To the right of "Users Online" title would be nice. Also, when in a board, I would like it to be above "Jump To" selection. I am not sure how to do this, have tried for hours and only managed to remove the search from the header. Thanks again

-baz

metallica48423

This is the code for the quick search... Basically you'd just need to add it into the relevant templates (BoardIndex.template.php and, i believe, MessageIndex.template.php) wherever you want it.


echo '
        <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
        <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
        <input type="text" name="search" value="" style="width: 190px;" />&nbsp;
        <input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
        <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>';


Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Bazil Greyson

Thank you! Now lets say I wanted to get fancy, and make it so that the "advanced search" was a shrinkable option, much like the collapsible categories in the forums or in the headers.

Changing the magnifying glass icon to the + icon my theme uses was simple, but no matter how I fool around with the <div>s and other upshrink sections of the index, I can't mimic it.

Not a real problem, just me wishing really...

-baz

metallica48423

I can't really be of much assistance there... i don't know javascript... you'd have to grab the advanced search HTML/PHP from Search.template.php and somehow use javascript to switch between them

IMO, itd probably be best to stick with the quick search but, thats my opinion :P
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: