YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Page Index Toggle Pages: 1
Topic Tools
 
Adding Google Custom Search (Read 2,056 times)
 May 16th, 2012 at 3:59am
There are no actions to perform.  

Tysonmm 
YaBB Newbie
*
Offline
Posts: 44


None
Adding Google Custom Search
Are there any steps to add the Google Custom Search in place of the default search box?  I mean,  why not try to make a little money to support the costs of the site, RIGHT?
 
 
IP Logged  
 Reply #1 - May 16th, 2012 at 1:34pm
There are no actions to perform.  

BloodyRue 
Junior Member
**
Offline
Posts: 83


YaBB 2.5
Re: Adding Google Custom Search
I have done that. I setup a .lng file with the code for the search in it. Then I put in the main.lng file a yabb tag. Then in the html file you just call the yabb tag.

Alternately, I think just placing the search code directly into the Main.lng file will do the same thing, try these...

Main.lng

Code Select All
$yycustom_search = qq~
<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<div class="cse-branding-right" style="background-color:#330033;color:#ffffff">
  <div class="cse-branding-form">

    <form action="http://www.google.com/cse" id="cse-search-box">
      <div>
        <input type="hidden" name="cx" value="partner-pub-YOURNUMBERSHERE" />
        <input type="hidden" name="ie" value="UTF-8" />
        <input type="text" name="q" size="25" />
        <input type="submit" name="sa" value="Search" />
      </div>
    </form>
  </div>
  <div class="cse-branding-logo">
    <img src="http://www.google.com/images/poweredby_transparent/poweredby_000000.gif" alt="Google" />
  </div>
  <div class="cse-branding-text">
    Custom Search
  </div>
</div>
~;
 




Place this code somewhere in your html file where you want it to appear:

Code Select All
 {yabb custom_search}
 

 
...    ...
WWW MVMB1  
IP Logged  
 Reply #2 - May 16th, 2012 at 1:58pm
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,617
Land of the Blazing Sun!


None
Re: Adding Google Custom Search
Looks like a nice hack!  I'm going to try it...   LOL - once I figure it out!
Shocked

Edited:
hmmm - darned clever!  I need to grok through this
« Last Edit: May 16th, 2012 at 2:03pm by JonB »  
I find your lack of faith disturbing.
 
IP Logged  
 Reply #3 - May 16th, 2012 at 2:18pm
There are no actions to perform.  

BloodyRue 
Junior Member
**
Offline
Posts: 83


YaBB 2.5
Re: Adding Google Custom Search
I have a huge pile of the stuff for my board as yabb tags being called from language files. That way, all I need to do is place the tags in each template and copy paste the main html for that style to all the rest that look like it. I change stuff in the language files and it readjusts it for each template without any major stuff to all of them.
 
...    ...
WWW MVMB1  
IP Logged  
 Reply #4 - May 16th, 2012 at 3:50pm
There are no actions to perform.  

Bill Myers 
God Member
Beta Testers
*****
Offline
Posts: 1,482
Los Angeles


YaBB 2.4
Re: Adding Google Custom Search
BloodyRue wrote on May 16th, 2012 at 2:18pm:
I have a huge pile of the stuff for my board as yabb tags being called from language files. That way, all I need to do is place the tags in each template and copy paste the main html for that style to all the rest that look like it. I change stuff in the language files and it readjusts it for each template without any major stuff to all of them.

Very clever. Maybe YaBB developers can implement this kind of modification as part of their core when the next generation is released so that us normal folk can implement it.

Cool stuff!  Smiley

Meanwhile, I've been doing that kind of thing the old fashioned way since 2002 by simply adding HTML language to our template.

Whatever works!  Roll Eyes

Edited:
Since Derek knows this stuff like the back of his hand ...

Derek Barnstorm wrote on May 17th, 2012 at 2:49am:
Global template tags should really be placed in Subs.pl under the template sub, rather than language files.

« Last Edit: May 17th, 2012 at 7:15am by Bill Myers »  
Morning, noon, or night, have a great one! ...
WWW BillHMyers  
IP Logged  
 Reply #5 - May 17th, 2012 at 2:49am
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Adding Google Custom Search
Global template tags should really be placed in Subs.pl under the template sub, rather than language files.
 
 
IP Logged  
 Reply #6 - Aug 10th, 2012 at 4:15pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: Adding Google Custom Search
This Topic was moved here from Non-YaBB Programming and Technical Help by Dandello.
 
WWW  
IP Logged  
Page Index Toggle Pages: 1
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.