Previous Thread
Next Thread
Print Thread
Rate Thread
[7.x] Google Custom (Adsense) Search #318145
08/23/2009 2:34 PM
08/23/2009 2:34 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
VNC Web Design UBB.Google Custom (Adsense) Search by Gizmo (James at VNC Web Design; http://www.virtualnightclub.net/)
This addon allows your users to search Google and have the results display inline on your forum.

Homepage: http://www.virtualnightclub.net/detail/4/ubb-gsearch.php
Support: https://www.ubbdev.com/forums/ubbthreads.php/topics/318145/7_x_Google_Adsense_Search.html

Install Instructions:
Upload the included files to your server (be careful to preserve directory structure) and add a link
to the header.inc.php template file.


Setup:
Be sure to edit the language file (languages/english/google.php), this file contains the configuration options for this script; including your publisher ID which contains your style code ID. This is a requirement as it includes your URL, Publisher ID, Style ID; basicaly everything this script needs.

There is an "advanced" tick in the Script file (/scripts/google.inc.php), basically just affecting how the title is built; for most users this won't need to be adjusted.


Mods:
To add an option in your header:
In /templates/default/header.tpl Find:
Code
<a href="{ubb url="ubb=faq"}">{$lang.FAQ_TEXT}</a>


Add ABOVE:
Code
<a href="{ubb url="ubb=google"}">{$lang.GOOGLE}</a> &nbsp;&nbsp;&nbsp;


In /languages/english/generic.php Find:
Code
$ubbt_lang['FAQ_TEXT'] = "FAQ";


Add AFTER:
Code
$ubbt_lang['GOOGLE'] = "Google";



To have "Using the Google Search" display on the Who's Online:
In /languages/english/online.php Add:
Code
$ubbt_lang['GOOGLE'] = "Using the Google Search";


Files:
/languages/english/google.php
/scripts/google.inc.php
/templates/default/google.tpl

Attached Files

UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Sponsored Links
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318146
08/23/2009 3:04 PM
08/23/2009 3:04 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Extended the instructions with possible modifications people will request ("How do I add to the Who's Online Page?" and "How do I add to my Header?")


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318148
08/23/2009 3:20 PM
08/23/2009 3:20 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
trying it out now!

what would it take to add it to the search drop down menu?

and this still doesn't resolve my original problem, redirecting a google search from another page and having the output in the wrapper..

I have custom error pages, so when someone gets an error 404, they get a window offering them helpful advice, like site navigation, and a search box.. that search box currently has to point to a standalone page to display googles results, I can't get in the wrapper...

Re: [7.x] Google Custom (Adsense) Search [Re: badfrog] #318149
08/23/2009 3:32 PM
08/23/2009 3:32 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
ok, I just removed the google search box from my 404 page and put a link in its place to the the google mod..
not as fancy, but should work just as well.

Re: [7.x] Google Custom (Adsense) Search [Re: badfrog] #318150
08/23/2009 3:50 PM
08/23/2009 3:50 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Adding it to the search dropdown shouldn't be difficult at all, simply open the header.tpl file and then locate the search dropdown code:
Code
{if $search_link}
<div id="search_popup" style="display: none">
	<form method="post" action="{ubb url=""}">
		<input type="hidden" name="ubb" value="dosearch" />
		<input type="hidden" name="daterange" value="0" />
		<input type="hidden" name="where" value="bodysub" />
		<input type="hidden" name="fromsearch" value="1" />
		<input type="hidden" name="checkwords" value="1" />

		<table class="popup_menu">
			<tr>
				<td nowrap='nowrap' class="popup_menu_header">{$lang.SEARCH_HEADER}</td>
			</tr>
			<tr>
				<td class="popup_menu_content noclose">
					<label>
						<input type="text" name="Words" class="form-input" />
						<input type="submit" name="textsearch" value="{$lang.GO_BUTTON}" class="form-button" />
					</label>
				</td>
			</tr>
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=search"}">{$lang.ADVANCED_BUTTON}</a></td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
	registerPopup("search_popup");
</script>
{/if}


Then, add a new line after:
Code
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=search"}">{$lang.ADVANCED_BUTTON}</a></td>
			</tr>


Like:
Code
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=google"}">Google Search</a></td>
			</tr>


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Sponsored Links
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318151
08/23/2009 3:52 PM
08/23/2009 3:52 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
As for your 404 stuff, theres an additional parameter you have to pass (it makes it so the search result stuff only shows when a search is being preformed); so you'd put:

Code
<form action="/forum/ubbthreads.php" id="cse-search-box">
	<input type="hidden" name="ubb" value="google" />
	<input type="hidden" name="process" value="1" />
	<input type="hidden" name="cx" value="partner-pub-5168900358893374:runafbk50ac" />
	<input type="hidden" name="cof" value="FORID:11" />
	<input type="hidden" name="ie" value="UTF-8" />
	<input type="text" name="q" size="31" class="form-input" /> 
	<input type="submit" name="sa" value="Search" class="form-button" />
</form>


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318152
08/23/2009 5:06 PM
08/23/2009 5:06 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
it parses, brings up the mod on the site, but I get..
Code
Google   	 
Error
 

    Not Found
    The requested URL /cse?ubb=google&process=1&cx=partner-partner-pub-1428978494316705%3Ayix18h-jgii&cof=FORID%3A11&ie=UTF-8&q=test&sa=Search&ad=w9&num=10&rurl=http%3A%2F%2Fwww.vannin.com%2Fthreads%2Fubbthreads.php%3Fubb%3Dgoogle%26process%3D1%26cx%3Dpartner-partner-pub-1428978494316705%253Ayix18h-jgii%26cof%3DFORID%253A11%26ie%3DUTF-8%26q%3Dtest%26sa%3DSearch was not found on this server. 

Re: [7.x] Google Custom (Adsense) Search [Re: badfrog] #318153
08/23/2009 5:24 PM
08/23/2009 5:24 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Odd URL... Could you link me to a page that's returning that as a result so i can check it out?


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318154
08/23/2009 5:49 PM
08/23/2009 5:49 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
just trigger a 404 error on my site...


Last edited by badfrog; 08/30/2009 6:54 AM. Reason: removed link so SLURP would stop following it
Re: [7.x] Google Custom (Adsense) Search [Re: badfrog] #318155
08/23/2009 6:18 PM
08/23/2009 6:18 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Wow, thats interesting lol... I'll take a look later on tonight (working on another mod :ahem:)


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Sponsored Links
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318157
08/23/2009 6:40 PM
08/23/2009 6:40 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
another mod? what could that be?! lol

fixing this now is more of a curiosity for me than a necessity.

having the text input box on the 404 page looks better to me.. personal preference I guess.

for now I can just use a link to the the embedded search page since I know that works.


Re: [7.x] Google Custom (Adsense) Search [Re: badfrog] #318158
08/23/2009 6:49 PM
08/23/2009 6:49 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut OP

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
well, the 404 is on google's site; it doesn't like how they pull the fake url into the mix and that's what it's choking on.

I finished v1 of the nag screns.


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.SitemapsJames Corthell
Re: [7.x] Google Custom (Adsense) Search [Re: Gizmo] #318159
08/23/2009 7:18 PM
08/23/2009 7:18 PM
Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
badfrog Offline
Power User
badfrog  Offline
Power User

Joined: Mar 2007
Posts: 94
somewhere on the coast of Main...
thanx for the work on the nag screens, will test it out a little later.


Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with, and recommend, the following Web Hosts:
· Stable Host
· Blue Host
· Interserver.net
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 25,587
Joined: March 2000
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,456
Posts293,497
Members13,800
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,941
Greg Hard 5,533
Top Posters(30 Days)
isaac 7
Gizmo 3
driv 1
Today's Statistics
Currently Online 746
Topics Created 2
Posts Made 5
Users Online 2
Birthdays 23
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.3
(Snapshot build 20180923.dev)
PHP: 5.4.45 DB: MySQLi Page Time: 0.059s Queries: 16 (0.024s) Memory: 3.3462 MB (Peak: 3.5593 MB) Zlib enabled. Server Time: 2018-09-23 21:38:56 UTC