integrate google search in phpbb3?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
bizarre12
Registered User
Posts: 4
Joined: Sat Apr 19, 2008 12:47 am

integrate google search in phpbb3?

Post by bizarre12 »

How can i integrate google search into phpbb3 like in this site?
http://www.phpbb.com/search/?q=google
James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: integrate google search in phpbb3?

Post by James N »

Place the following code in overall_header.html in the place you would like it to appear

Code: Select all

<form method="get" action="http://www.google.com/search" target="google_window">
<input type="text" style="color: #000000"   name="q" size="30"maxlength="255"  value=" Search the forum..." onfocus="if(this.value==' Search the forum...')this.value=''" onblur="if(this.value=='')this.value=' Search the forum...'"/>
<input type="submit"  style="color: #000000"  name="sa" value="Search"></input>
<input type="hidden" name="sitesearch" value="myforum.com" checked="checked"><br />
</form>
changing myforum.com to your forums address
bizarre12
Registered User
Posts: 4
Joined: Sat Apr 19, 2008 12:47 am

Re: integrate google search in phpbb3?

Post by bizarre12 »

Thats not exactly the same thing, i meant to adsense search
James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: integrate google search in phpbb3?

Post by James N »

bizarre12 wrote:Thats not exactly the same thing, i meant to adsense search
Unfortunately you didnt ask for a google adsense search

Just add your adsense code in overall_header.html
Darley Dale
Registered User
Posts: 33
Joined: Mon Jul 14, 2008 12:19 pm

Re: integrate google search in phpbb3?

Post by Darley Dale »

Wow, that integrated Google search code is great.

What would I need to do for the results to show within my forum? Would I need to change the target and create some kind of frame or something?
James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: integrate google search in phpbb3?

Post by James N »

TBH I dont know how you would go about that.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22825
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: integrate google search in phpbb3?

Post by Mick »

That has been asked a few times on here because the user is taken to google for the results page just like any other google search results.

I have Adsense on my board and wanted to open a new page within my forum rather than listing in the index page but Google don't like that for some reason or other :shock:
"The more connected we get the more alone we become" - Kyle Broflovski©
dsstrainer
Registered User
Posts: 13
Joined: Tue Apr 27, 2010 2:06 pm

Re: integrate google search in phpbb3?

Post by dsstrainer »

If anyone is interested I added google search nicely inside my forum search page:

1. Goto ACP
2. Under the "Styles" Tab
3. Choose "search_body.html" in the template selector
4. When the file loads, look for:

Code: Select all

<h2 class="solo">{L_SEARCH}</h2>
5. AFTER, ADD:

Code: Select all

<div class="panel bg3">
  <div class="inner">
    <span class="corners-top"><span></span></span>
	<h3>Google Search query</h3>
	<fieldset>
      <dl>
        <dt><label for="q">Google Site Search:</label><br><span>To search a phrase, surround in double quotes ""<br/> To exclude terms, lead with -<br/>  For exact terms, lead with +<br/>For wildcards use * </span></dt>
        <dd>
          <form method="get" action="http://www.google.com/search">
            <input type="text" name="q" size="40" maxlength="255" value="" class="inputbox"/><br/>
            <input type="radio" name="sitesearch" value="forum.mysite.com" checked="checked" /> Forums Only <br/>
            <input type="radio" name="sitesearch" value="www.mysite.com" /> Entire Site<br/>
            <input type="submit" value="Google Search" />
          </form>
        </dd>
	  </dl>
    </fieldset>
  </div>
  <span class="corners-bottom"><span></span></span>
</div>
6. Be sure to change the spots for "mysite.com" to your actual site in the above code.
Attachments
phpbb3google.jpg
phpbb3google.jpg (31.77 KiB) Viewed 7006 times
clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Re: integrate google search in phpbb3?

Post by clight77 »

Thanks :)
Very nice...
I Follow Up On My Posts.
So Should Everybody...
User avatar
Lumpy Burgertushie
Registered User
Posts: 68173
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: integrate google search in phpbb3?

Post by Lumpy Burgertushie »

do NOT do this edit from the admin panel template editor. the changes will disappear the first time you purge the cache.

use your ftp, download the relevant file and to the changes to the actual file. then save it and upload it back.

then, go into the styles tab of the admin panel and refresh the template for your style.

then, hard refresh your browser.


doing it that way will make the change permanent.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Re: integrate google search in phpbb3?

Post by clight77 »

THX for the info :)
I never use ACP I always use FTP ...
I Follow Up On My Posts.
So Should Everybody...
Locked

Return to “[3.0.x] Support Forum”