Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: goldenstudios on June 16, 2020, 01:09:12 PM

Title: moving search box
Post by: goldenstudios on June 16, 2020, 01:09:12 PM

hi how can I put the search bar on the homepage above all threads?
Title: Re: moving search box
Post by: Arantor on June 16, 2020, 01:11:13 PM
On the *homepage* where there are boards, or on the list of topics, above the topics? Or both?

Should the search box have all the same filters it currently does?
Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 01:15:37 PM


I would like to put the search bar just above the top thread list
ex: (https://i.postimg.cc/m2f8s1yc/Immagine.png)

and secondly I would like to improve the search method but this could be done after I moved the block

Title: Re: moving search box
Post by: Arantor on June 16, 2020, 01:37:10 PM
You didn't answer my question but this can't be done without you answering my questions.
Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 01:48:54 PM
only there are boards homepage
Title: Re: moving search box
Post by: Arantor on June 16, 2020, 02:44:34 PM
And what theme are you using?
Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 02:46:09 PM
this:
https://custom.simplemachines.org/themes/index.php?lemma=2631
Title: Re: moving search box
Post by: Arantor on June 16, 2020, 02:55:37 PM
So there's nothing to remove from the index.template.php of the theme, and you'll need to modify the theme's BoardIndex.template.php (the Aqua one, not the Curve one)

Code (find) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Show some statistics if stat info is off.


Code (replace) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 10px auto 20px auto; text-align: center;">
    <input type="text" name="search" class="input_text">
    <input type="submit" name="submit" value="Go" class="button_submit">
</form>';

// Show some statistics if stat info is off.
Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 03:01:18 PM

it works thank you very much  ;) ;)... if I wanted to add a writing next to the box to the left how can I do?
Title: Re: moving search box
Post by: Arantor on June 16, 2020, 04:54:00 PM
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 10px auto 20px auto; text-align: center;">
    My text goes here: <input type="text" name="search" class="input_text">
    <input type="submit" name="submit" value="Go" class="button_submit">
</form>';

// Show some statistics if stat info is off.
Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 07:02:00 PM
thanks a lot man ;) work
if I want to lengthen the search bar?
Title: Re: moving search box
Post by: Sir Osis of Liver on June 16, 2020, 07:26:44 PM


function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 10px auto 20px auto; text-align: center;">
    <input type="text" name="search" class="input_text" size="50">
    <input type="submit" name="submit" value="Go" class="button_submit">
</form>';

// Show some statistics if stat info is off.


Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 07:38:17 PM
thanks, last thing if you want to highlight the edge of the box look in red is it possible?
Title: Re: moving search box
Post by: Sir Osis of Liver on June 16, 2020, 07:42:35 PM


<input type="text" name="search" value="" class="input_text" size="50" style="border: 2px red solid"/>


Title: Re: moving search box
Post by: goldenstudios on June 16, 2020, 07:44:15 PM
thanks a lot ;)