Page Index Toggle Pages: 1
Topic Tools
Adding Google Custom Search (Read 2,547 times)
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,098
Location: Earth

YaBB 2.6.0
Re: Adding Google Custom Search
Reply #6 - Aug 10th, 2012 at 4:15pm
Post Tools
This Topic was moved here from Non-YaBB Programming and Technical Help [move by] Dandello.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Adding Google Custom Search
Reply #5 - May 17th, 2012 at 2:49am
Post Tools
Global template tags should really be placed in Subs.pl under the template sub, rather than language files.
  
Back to top
 
IP Logged
 
Bill Myers
God Member
Beta Testers
*****
Offline



Posts: 1,551
Location: Los Angeles

YaBB 2.4
Re: Adding Google Custom Search
Reply #4 - May 16th, 2012 at 3:50pm
Post Tools
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!

Note: This forum doesn't allow for us to freely edit our posts or topics to make corrections as needed, so please remember to look for subsequent posts if you see any mistakes or outdated information. Sorry for the inconvenience.
Back to top
IP Logged
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: Adding Google Custom Search
Reply #3 - May 16th, 2012 at 2:18pm
Post Tools
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.
  

   
Back to top
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,768
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Adding Google Custom Search
Reply #2 - May 16th, 2012 at 1:58pm
Post Tools
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.
Back to top
IP Logged
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: Adding Google Custom Search
Reply #1 - May 16th, 2012 at 1:34pm
Post Tools
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}
 

  

   
Back to top
IP Logged
 
Tysonmm
YaBB Newcomer
*
Offline



Posts: 44
Adding Google Custom Search
May 16th, 2012 at 3:59am
Post Tools
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?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top