How to add Search Box?

Go down

Solved How to add Search Box?

Post by monarchco on April 19th 2015, 12:25 am

Technical Details


Forum version : phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Screenshot of problem : https://i.imgur.com/U1zNZ9J.png
Who the problem concerns : All members
Forum link : http://www.VFGaming.net

Description of problem

I'd like to know how to add a search box to my forum that is visible on all threads and sections?
I'd like to have it where the blue box I put on the image is. Right above the page numbers.

How would I add this into my forum?

I'd like to have it look like the one used on this forum:

except with red( #FF0000 ) instead of the blue.


Last edited by monarchco on April 19th 2015, 6:45 pm; edited 1 time in total

monarchco
New Member

Posts : 9
Reputation : 1
Language : English

http://www.VFGaming.net

Back to top Go down

Solved Re: How to add Search Box?

Post by Stephen- on April 19th 2015, 6:06 am

Hi @monarchco,

Add this to your CSS stylesheet,

Admin Panel >> Colors >> CSS stylesheet:

Code:
#search-box input.search { transition:750ms }
#search-box input.search:focus { width:250px !important }
avatar
Stephen-
Forum Reviewer
Forum Reviewer

Male Posts : 2473
Reputation : 316
Language : Tagalog, English
Location : Philippines

Back to top Go down

Solved Re: How to add Search Box?

Post by monarchco on April 19th 2015, 7:16 am

I added it but I see no change.

I even double checked to make sure it was added.

monarchco
New Member

Posts : 9
Reputation : 1
Language : English

http://www.VFGaming.net

Back to top Go down

Solved Re: How to add Search Box?

Post by Stephen- on April 19th 2015, 12:19 pm

Try this code, replace what I gave you with this :

Code:
#search-box input#keywords {
  -webkit-transition:750ms;
    -moz-transition:750ms;
      -o-transition:750ms;
          transition:750ms;
}
#search-box input#keywords:focus { width:250px }
avatar
Stephen-
Forum Reviewer
Forum Reviewer

Male Posts : 2473
Reputation : 316
Language : Tagalog, English
Location : Philippines

Back to top Go down

Solved Re: How to add Search Box?

Post by Ange Tuteur on April 19th 2015, 3:16 pm

Hi,

By default, phpbb2 does not have a search box. ( the version you see here is phpbb3 ) So, you'll need to make some modifications to the templates. Go to Administration Panel > Display > Templates > General > overall_header Edit

Find :
Code:
            <table cellspacing="0" cellpadding="0" border="0" align="{MENU_POSITION}">
               <tr>
                  <td align="{MENU_POSITION}"{MENU_NOWRAP}>{GENERATED_NAV_BAR}</td>
               </tr>
            </table>

Replace by :
Code:
            <table cellspacing="0" cellpadding="0" border="0" align="{MENU_POSITION}">
               <tr>
                  <td align="{MENU_POSITION}"{MENU_NOWRAP}>{GENERATED_NAV_BAR}</td>
               </tr>
                                        <tr>
                                          <td align="right">
         <!-- BEGIN switch_search_box -->
         <div id="search-box">
            <form method="get" action="{ACTION_SEARCH}" id="search">
               <p class="nomargin"><input type="text" name="search_keywords" id="keywords" maxlength="128" class="inputbox search" value="{L_SEARCH}..." onclick="if (this.value == '{L_SEARCH}...') this.value = '';" onblur="if (this.value == '') this.value = '{L_SEARCH}...';" />
               {JS_SESSION_ID_INPUT}
               <input class="button2" type="submit" value="{L_SEARCH}" /></p>
            </form>
         </div>
         <!-- END switch_search_box -->
                                          </td>
                                        </tr>
            </table>

save and publish. Add


Note : You must be logged into the founder account to modify the templates.
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: How to add Search Box?

Post by rockzkie on April 19th 2015, 3:26 pm

does this work on invision?
avatar
rockzkie
Forumember

Male Posts : 58
Reputation : 3
Language : Tagalog & English (a little bit)
Location : Philippines

http://darkgamers.forumtl.com

Back to top Go down

Solved Re: How to add Search Box?

Post by monarchco on April 19th 2015, 5:52 pm

Cool thanks @'Ange Tuteur'

How can I get it to align to the right side of the page?

right above:
"View posts since last visit
View your posts
View unanswered posts"


monarchco
New Member

Posts : 9
Reputation : 1
Language : English

http://www.VFGaming.net

Back to top Go down

Solved Re: How to add Search Box?

Post by Ange Tuteur on April 19th 2015, 6:20 pm

@rockzkie wrote:does this work on invision?
Please open your own topic.

Thanks. Smile

@monarchco wrote:Cool thanks @'Ange Tuteur'

How can I get it to align to the right side of the page?

right above:
"View posts since last visit
View your posts
View unanswered posts"

No problem. Smile

I forgot about that. Reopen the overall_header and find the this part of the table :
Code:
<table cellspacing="0" cellpadding="0" border="0" align="{MENU_POSITION}">

adding width="100%" should fix it.
Code:
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="{MENU_POSITION}">

Then just save and publish your template. Wink
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: How to add Search Box?

Post by monarchco on April 19th 2015, 6:45 pm

Thanks Smile Fixed it.

monarchco
New Member

Posts : 9
Reputation : 1
Language : English

http://www.VFGaming.net

Back to top Go down

Solved Re: How to add Search Box?

Post by Ange Tuteur on April 19th 2015, 7:33 pm

You're welcome Mr. Green

Topic archived

Have a nice day. Smile
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum