|
So I have a solution for 9.9.5 and yget that works without modifying any php files, just tpl. You can use Google search, have the results on a page on your site, and still have tag search working.
Make sure the configuration for search is NOT set to 4 (Google) -- if you set it to 4 this solution does not work and tag search does NOT work as reported above.
in header.tpl
Change {if $SearchMethod eq 4}
to
{if $SearchMethod eq 4 OR 0 eq "0"}
This forces the search box to have Google search no matter what search method you configure.
Put in your Google search box code
In Pligg.tpl add this code:
=======================
{php}
if (strpos($_SERVER['QUERY_STRING'], "cx=partner-pub") !== false) {
$isFromG = 1;
}
else{
$isFromG = 0;
}
$this->assign('isFromG',$isFromG);
{/php}
============
This gives variable $isFromG to use in the template file. If 1 then the page called is from a google search.
In search_center.tpl
Change:
{if $SearchMethod eq 4}
to
{if $isFromG eq 1}
Put in your Google display search code to display search results
===============
Now Google search will work (set it up to display on your site in the search.php page AND tag search is uneffected.
The reason I did this is because the Pligg search methods are not very good with mulitple words (like this forum) and Google gives better results.
Last edited by ortho; 11-29-2008 at 08:59 PM..
Reason: typo
|