Google Adsense Search

Modifications for phpBB3. Try the Mods here and share Your own Mods
There is no support here! Only Read Access!
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Google Adsense Search

Post by Stoker »

Title: Google Adsense Search
Version: 1.0.0
Author: Stoker
MOD description: With this phpBB3 mod installed the standard searchbar in the header will be replaced with a google sitesearch with adsense in the search result page.
Note! Prosilver only
Demo: This site
Attached file:
googlesearch.zip
(1.43 KiB) Downloaded 845 times
Download, unzip and upload the files the their right location.
Installation instructions: The first thing to do is to create a search engine with your adsense account.
If you don't have an adsense account, you can create one here: http://www.google.com/coop/cse/ Its free
You need the code generated by google

Open language/en/common.php
Find:

Code: Select all

'GO'						=> 'Go',
add after, on a new line:

Code: Select all

'GOOGLESEARCH'					    => 'Google Search',
Open styles/prosilver/template/overall_header.html
Find:

Code: Select all

<form action="{U_SEARCH}" method="post" id="search">
				<fieldset>
					<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /> 
					<input class="button2" value="{L_SEARCH}" type="submit" /><br />
					<a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
				</fieldset>
				</form>
Replace with:

Code: Select all

<form action="http://www.your_domain.com/googlesearch.php" id="cse-search-box">
  <fieldset>
    <input type="hidden" name="cx" value="partner-pub-3346231937490093:rf17b3yseht" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" class="inputbox search" name="q" maxlength="128" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /><br />
  <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
  </fieldset>
</form>
In the above code there is 3 things you need to edit so your own adsense code will be used.
Change your domain name in this:

Code: Select all

<form action="http://www.your_domain.com/googlesearch.php" id="cse-search-box">
Change to the code generated by google here:

Code: Select all

<input type="hidden" name="cx" value="partner-pub-3346231937490093:rf17b3yseht" />
The same here:

Code: Select all

<input type="hidden" name="cof" value="FORID:9" />
Open the included template file and insert your search result code

Save, upload and refresh template
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Google Adsense Search

Post by Fire-Fox »

How do i get transparant ?

i have white background color when the search result is displayed

when i do this:

Code: Select all

				<form action="http://www.phpbb3addons.com/googlesearch.php" id="cse-search-box">
  <fieldset>
    <input type="hidden" name="cx" value="partner-pub-013451510553273018505:5kwgbpknx7s" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" class="inputbox search" name="q" maxlength="128" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_GOOGLE_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_GOOGLE_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_GOOGLE_MINI}';" /><br />
  </fieldset>
</form>
i get and error, cannot be found on server ?

when i do:

Code: Select all

				<form action="http://www.phpbb3addons.com/googlesearch.php" id="cse-search-box">
  <fieldset>
    <input type="hidden" name="cx" value="013451510553273018505:5kwgbpknx7s" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" class="inputbox search" name="q" maxlength="128" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_GOOGLE_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_GOOGLE_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_GOOGLE_MINI}';" /><br />
  </fieldset>
</form>
it work?
Last edited by Fire-Fox on 09 May 2010, 15:51, edited 2 times in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Google Adsense Search

Post by Stoker »

You set the bckground color in your adsense account.
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Google Adsense Search

Post by Fire-Fox »

i have tryed, but it dosn't change :(

it's in this link right : https://www.google.com/adsense/colors
Adsense.png
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Google Adsense Search

Post by Stoker »

Then you are not changing the search you are using, or you are not saving.
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Google Adsense Search

Post by Fire-Fox »

Got it working

What is the color text of this in the adsense change color (hr line - marked with red arrows) :
Adsense1.png
FIXED:
Adsense1.png
New issue
search.png
[edit]all issues fixed[/edit]
Last edited by Fire-Fox on 10 May 2010, 22:49, edited 1 time in total.
eVoLuTiOnBOyz
BBCoder II
BBCoder II
Posts: 42
Joined: 02 Apr 2010, 14:54

Re: Google Adsense Search

Post by eVoLuTiOnBOyz »

hey stroker will we earn from this?
if yes then how much $ or cents. per search.
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Google Adsense Search

Post by cisco007 »

eVoLuTiOnBOyz, read here! https://www.google.com/adsense
onel0ve
BBCoder II
BBCoder II
Posts: 10
Joined: 27 Apr 2010, 05:41

Re: Google Adsense Search

Post by onel0ve »

when i am click on search always showing Insert your googlecode here please help me

me already paste my code

Code: Select all

<form action="http://localhost/googlesearch.php" id="cse-search-box">
  <fieldset>
    <input type="hidden" name="cx" value="partner-pub-0887266645916706:5f8lmp-uywf" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" class="inputbox search" name="q" maxlength="128" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
  </fieldset>
</form>
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Google Adsense Search

Post by cisco007 »

are you using this on your localhost? have you tried using this on a live site and creating a adsense code for the live site, and then checking?
Locked