Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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>    

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
Attachments
UBB.Google Adsense Search.zip (3.83 KB, 7 downloads)
SHA1: 32c736363b6a52f97f7d9ffaac714edcdfc87963


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, My UBB Scripts
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
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...

Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
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.

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
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.

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
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
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Sponsored Links
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
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.


Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
thanx for the work on the nag screens, will test it out a little later.


Link Copied to Clipboard
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
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)