Hi, i need to replace the default SMF search with google search,
how do i do this ??
Search the modsite: http://custom.simplemachines.org/mods/
there is none which works with 2.0.7, so i feel im better of editing the template..
can someone help me with editing the template to get google (adsense code) search to replace the default search ??
thanks !
There is actually just 1 MOD that can do that:
http://custom.simplemachines.org/mods/index.php?mod=2566
Not sure if this is what you want...
this one should do it as well http://custom.simplemachines.org/mods/index.php?mod=1634 and it adds a few other features. but it does not disable the default search page
These are good mods if one wants just google search enabled for their forum.
But not good for my purpose. What I want is, to replace the default search completely by google custom search (AdSense for search (https://support.google.com/adsense/answer/9879?hl=en)) code.
If it isn't available with the mods currently on the mod site then you can submit a mod request here: http://www.simplemachines.org/community/index.php?board=79.0
While a mod is being worked upon, IS it possible i can make any changes to the template to achieve this ??
Sure you can manually modify the index.template.php file if you wish.
im using the curve theme, and I need to embed the below search box instead of the default one. Where to put this code ??
<form action="http://www.google.co.in" id="cse-search-box" target="_blank">
<div>
<input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxx:xxxxxxxxxxxxxx" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="55" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.co.in/coop/cse/brand?form=cse-search-box&lang=en"></script>
Am in this situation too any way out?
http://custom.simplemachines.org/mods/index.php?mod=2566
also ADK had a mod that did google search as well (However, they took all their mods off our site and went to their own site a little while ago)
I've just done it.
My coding may not be 'proper' but it works. (Feel free to correct it someone please!)
In Themes/default/index.template.php
about line 274
find this bit:
<div class="news normaltext">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '</form>';
replace with:
<div class="news normaltext">
';
..and above the ';
insert your google search code :
<div class="news normaltext">
<form action="http://www.google.co.uk" id="cse-search-box" target="_blank">
<div>
<input type="hidden" name="cx" value="partner-pub-xxxxxxxx:xxxxxxxxx" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="55" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.co.uk/coop/cse/brand?form=cse-search-box&lang=en"></script>
';
It works for me :
http://www.fuerteventura-forum.com/index.php (http://www.fuerteventura-forum.com/index.php)
I couldn't figure out how to have the results page integrated into my site so I elected for the results on a Google page.
Does anyone know how to implement the integration (one thing deterring me was that the minimum results iframe is 795px - far too wide for my 3 column layout) ?
Did you even bother to look at the mod that I linked or check out the ADK site for their version?
If you mean me - yes, I looked at the mod but from what I gathered it gives you the option to include Goggle or Yahoo searches.
What I wanted - and did - was to have my own Google Adsense Search - which is different to the standard Google Search - it earns me a little.
I had a quick search for the ADK thing but couldn't find it. I wasn't too bothered as I had already managed.