Google search like here on phpbb.com

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Google search like here on phpbb.com

Post by stokerpiller » Sat Feb 14, 2009 9:48 am

Hello

How can I use google as search engine exactly like here on phpbb.com?
I am asking because google delivers better search results than the phpbb search.

When I do a google site search I allways get what I want listed first.
When I do a phpbb search it is allways last.
I am done with phpBB

stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Google search like here on phpbb.com

Post by stokerpiller » Sat Feb 14, 2009 12:33 pm

I have managed to make a version using google adsense, but first I would like one without adsense, second it seems like the adsense script slows the load a little.
I am done with phpBB

vadi
Registered User
Posts: 91
Joined: Wed May 21, 2008 4:09 pm

Re: Google search like here on phpbb.com

Post by vadi » Mon Mar 02, 2009 10:55 am

is there a mod for this google ajax search like phpbb.com? it would be nice!

stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Google search like here on phpbb.com

Post by stokerpiller » Mon Mar 02, 2009 11:03 am

vadi wrote:is there a mod for this google ajax search like phpbb.com? it would be nice!
You can use the free google adsense version.
Or you could pay google for the service and have an ad free search. I think that is what they use here.
I am done with phpBB

vadi
Registered User
Posts: 91
Joined: Wed May 21, 2008 4:09 pm

Re: Google search like here on phpbb.com

Post by vadi » Tue Mar 03, 2009 12:33 pm

i know that. i need a instruction how to interagte the ajax search form just like here on phpbb.com

PrometheusKZ
Registered User
Posts: 76
Joined: Mon May 08, 2006 9:07 pm
Contact:

Re: Google search like here on phpbb.com

Post by PrometheusKZ » Sun Mar 08, 2009 2:08 pm

This question is also very interesting for me.

Is there any possibility to help other users to integrate same search like in phpbb.com?

Thank you.

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: Google search like here on phpbb.com

Post by stickerboy » Sun Mar 08, 2009 4:59 pm

First thing you need to do is visit here - http://www.google.com/coop/cse/ and set up a custom search for your site. It's quite simple, all the instructions are there, it's just a matter of filling out all the information required :)

Next, create a new page for your search. I have mine in a sub-folder called 'search' so my custom page is like this:

Code: Select all

<?php
/** 
*
* @package phpBB3
* @version $Id: search.php 0002 27/09/2008 18:03 kenny Exp $
* @copyright (c) 2005 phpBB Group 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

// Lets build a page ...
$template->assign_vars(array(
    'L_BACK_TO_TOP'    => $user->lang['BACK_TO_TOP'])
);

page_header("Google Search");

$template->set_filenames(array(
    'body' => 'gsearch_body.html')
);

// Set up the Navlinks for the forums navbar
$template->assign_block_vars('navlinks', array(
            'FORUM_NAME'   => 'Google Search',
            'U_VIEW_FORUM'   => append_sid("{$phpbb_root_path}search/"))
);

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));

page_footer();

?>
I saved this as index.php in the search folder, although you can save it in in the forums folder if you like. just name it something like gsearch.php and change the root path in the file.
Now, create an html file in your template folder. Something like this.

Code: Select all

<!-- INCLUDE overall_header.html -->
<h2>Search Results</h2>

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>
	<div class="content">
	<div style="text-align: center">
<br />
<br />

<!-- Google Search Result Snippet Begins -->
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 600;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<!-- Google Search Result Snippet Ends -->   

<br />

</div>
	</div>
	<span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE overall_footer.html -->
Now, where ever you want the search box to show (overall_header.html maybe?) add the code for the search box in there. Google provides the code for you :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || BandCamp || phpBB Snippets ||
Formerly known as cherokee red

PrometheusKZ
Registered User
Posts: 76
Joined: Mon May 08, 2006 9:07 pm
Contact:

Re: Google search like here on phpbb.com

Post by PrometheusKZ » Sun Mar 08, 2009 6:12 pm

Thanks for advice and tutorial! I'll try it immediately.

PrometheusKZ
Registered User
Posts: 76
Joined: Mon May 08, 2006 9:07 pm
Contact:

Re: Google search like here on phpbb.com

Post by PrometheusKZ » Sun Mar 08, 2009 8:01 pm

I have to ignore gadget which recommended by Custom Search? Which parameters I have to change?

Where I will put ID of personal search?

Can you help me to put in SITE URL url from address bar? I have several domain names on same forum.

Thank you.

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: Google search like here on phpbb.com

Post by stickerboy » Sun Mar 08, 2009 8:06 pm

Go to the "New search engine..." link on the left hand menu and fill out the form. It asks you put the URL in there and tells you how to format it properly
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || BandCamp || phpBB Snippets ||
Formerly known as cherokee red

PrometheusKZ
Registered User
Posts: 76
Joined: Mon May 08, 2006 9:07 pm
Contact:

Re: Google search like here on phpbb.com

Post by PrometheusKZ » Sun Mar 08, 2009 8:16 pm

How can I put in place of URL - like variable which put current DOMAIN NAME to the URL?

Thank you.

nfh
Registered User
Posts: 27
Joined: Tue Nov 08, 2005 11:34 am

Re: Google search like here on phpbb.com

Post by nfh » Sat Jun 26, 2010 4:55 pm

Did you do anything special to improve the indexing of the phpbb.com forums? I'm trying to use the AdSense for search on my website, but there are very few pages that come up in the search results.

King-Nothing
Registered User
Posts: 458
Joined: Sat Oct 06, 2007 6:14 pm

Re: Google search like here on phpbb.com

Post by King-Nothing » Sun Jul 11, 2010 10:21 pm

I would like to use Google search on my forum, but I don`t want any new searchfield. I want to use the searchfield within my style but when the searchresults are presented, it should be a Google-search and not phpBB-search.

Anyone who knows how to fix this?

Valiant
Registered User
Posts: 1
Joined: Thu Jul 15, 2010 7:24 am

Re: Google search like here on phpbb.com

Post by Valiant » Thu Jul 15, 2010 7:28 am

@cherokee red, thanks for the tip, but I have a problem, my board is in lithuanian, so I need people to be able to use "ĄČĘĖĮŠŲŪŽ" letters, but I can't for some reason Encode the index.php to UTF-8 without BOM it just keeps saving it as ANSI. Where there should be "ū" in search results is "Å«" and the search fails. I would be really grateful if you could help me with this :)

BigDrago
Registered User
Posts: 313
Joined: Fri Dec 10, 2004 5:16 pm
Location: Norway

Re: Google search like here on phpbb.com

Post by BigDrago » Sat Mar 05, 2011 1:09 pm

Thanks, I will try this! I have google search on mine, but I would like to integrate it with the style.

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: Yandex [Bot] and 27 guests