Page Index Toggle Pages: 1
There are no actions to perform.
Hot Topic (More than 10 Replies) Adding Google Custom Search (Read 3,643 times)
Tysonmm
YaBB Newcomer
*
Offline



Posts: 44
Adding Google Custom Search
May 16th, 2012 at 3:59am
There are no actions to perform.
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
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: Adding Google Custom Search
Reply #1 - May 16th, 2012 at 1:34pm
There are no actions to perform.
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
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 4,231
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: Adding Google Custom Search
Reply #2 - May 16th, 2012 at 1:58pm
There are no actions to perform.
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 #3 - May 16th, 2012 at 2:18pm
There are no actions to perform.
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
 
Bill Myers
God Member
Beta Testers
*****
Offline



Posts: 1,866
Location: Los Angeles

YaBB 2.4
Re: Adding Google Custom Search
Reply #4 - May 16th, 2012 at 3:50pm
There are no actions to perform.
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: Like most others, this forum doesn't allow 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
 
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
There are no actions to perform.
Global template tags should really be placed in Subs.pl under the template sub, rather than language files.
  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,556
Location: Earth

YaBB 2.6.1
Re: Adding Google Custom Search
Reply #6 - Aug 10th, 2012 at 4:15pm
There are no actions to perform.
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
 
Chess Publishing
Full Member
***
Offline



Posts: 133
Re: Adding Google Custom Search
Reply #7 - Jul 3rd, 2017 at 11:09am
There are no actions to perform.
I used to have a Google search instead of the (fairly useless) YaBB search at the very top right of each page, but somewhere along the line it stopped working.
Anyway, I tried setting up the custom Google search anew and it offered me some code. I tried putting it directly into the Forum header (default.html) instead of {yabb searchbox} and it worked very nicely, but the problem was that the Google search box was very big. I suppose there must be a neater way of doing this, can anyone help me replace the current 'YaBB search box' code with the Google one?
  
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,556
Location: Earth

YaBB 2.6.1
Re: Adding Google Custom Search
Reply #8 - Jul 5th, 2017 at 5:47pm
There are no actions to perform.
You should be able to add custom css formatting to your .css file to make the Google box smaller.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Chess Publishing
Full Member
***
Offline



Posts: 133
Re: Adding Google Custom Search
Reply #9 - Jul 6th, 2017 at 8:48pm
There are no actions to perform.
Dandello wrote on Jul 5th, 2017 at 5:47pm:
You should be able to add custom css formatting to your .css file to make the Google box smaller.


Ok, I'm afraid I haven't a clue what to change and how to do it! Embarrassed
  
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,556
Location: Earth

YaBB 2.6.1
Re: Adding Google Custom Search
Reply #10 - Jul 7th, 2017 at 1:03am
There are no actions to perform.
You'll want to look at css resources. But in a nutshell - you can style elements like tables and paragraphs by adding a style="style here" to the tag itself.

Code
Select All
<p style="font-size:90%"> 



These have to be fairly precise, but the styling will override whatever style has been assigned elsewhere.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Chess Publishing
Full Member
***
Offline



Posts: 133
Re: Adding Google Custom Search
Reply #11 - Jul 19th, 2017 at 11:51am
There are no actions to perform.
Dandello wrote on Jul 5th, 2017 at 5:47pm:
You should be able to add custom css formatting to your .css file to make the Google box smaller.


Thanks, I got some advice from a programmer who told me to add

Code (CSS)
Select All
.gsc-control-cse {padding:0 !important}  


to the default/css file, and this seems to work well (see http://www.chesspub.com/cgi-bin/chess/YaBB.pl)
« Last Edit: Jul 19th, 2017 at 11:51am by Chess Publishing »  
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,556
Location: Earth

YaBB 2.6.1
Re: Adding Google Custom Search
Reply #12 - Jul 19th, 2017 at 7:48pm
There are no actions to perform.
Having programmer friends is always a good thing.  Wink
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
There are no actions to perform.