PDA

View Full Version : Integration with vBulletin - AusPhotography Google Custom Search


AusPhotography
07-07-2011, 10:00 PM
www.AusPhotography.net.au Google Custom Search

This product provides a simple way to integrate Google Custom Search into vBulletin V4.1.x.

It is advisable to get the XML site map working and adjust your robots.txt file accordingly.
Don't ask me how to do this, you need to do a little research of your own.

This product is a simple framework for connecting an external function with its own menu tab,
not just Google CSE, i.e. you could easily adapt it for Yahoo or some other function.


Features:
1. Configurable Google CSE code
2. Online/Offline option
3. Only works for logged in users


Requires:
1. A Google CSE for the site (see: http://www.google.com/cse/ )
2. [optional] apnavenhance - AP Navigation Enhancements (if not installed it is ignored)
NB: apneavenhance has not and will not be released to the general public.


Installation:
1. [Important] First!
Create a Google CSE for the site and configure it with the Full-width option in Look & feel
- You need a Google account to do this :)
2. Copy the Google CSE Javascript and CSS code ready to insert via AdminCP
3. Upload the apgoogle.php file to the forum directory
4. Install the product file
5. Configure your google search via AdminCP/Settings/Options
- You need to put your CSE code into the option to make it work
- See the sample below
- Turn it on (installed in off mode by default)

Done!

Enjoy! It will probably work on all vB4.0+ as well.

Kym

Sample Google CSE javascript:
888888888888888888888:kgkgkgkgkgk being the key from your Google CSE
I also changed the width in the first line to 60%, it's 100% from Google.


<div id="cse" style="width: 60%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en', style : google.loader.themes.GREENSKY});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('888888888888888 888888:kgkgkgkgkgk');
customSearchControl.setResultSetSize(google.search .Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse');
}, true);
</script>

AusPhotography
07-08-2011, 02:30 AM
As it looks on our site...

130816

MudRacing
08-06-2011, 03:11 PM
Good works!!

One question: How I can get a box like on the site "AusPhotography"?
(You are unregistered (or not logged in). Australian Photography offers so much more! Please note that much of the site is invisible when logged out. To enjoy the full site experience, please register or log in.)

AusPhotography
08-08-2011, 11:25 PM
Good works!!

Thanks!


One question: How I can get a box like on the site "AusPhotography"?
(You are unregistered (or not logged in). Australian Photography offers so much more! Please note that much of the site is invisible when logged out. To enjoy the full site experience, please register or log in.)

Use a notice and some funky javascript :D

MudRacing
08-09-2011, 06:46 PM
Use a notice and some funky javascript :D

I not found a similar JavaScript, can you help me?
pls

AusPhotography
08-10-2011, 02:24 AM
I not found a similar JavaScript, can you help me?
pls

Right click, view source, and borrow the code from our site :)

MudRacing
08-10-2011, 07:28 AM
Right click, view source, and borrow the code from our site :)

With the permit, but patience please, I'm not very good at these things ...

I'll just take this piece?
<div id="aptopbar">

<table width="100%" class="page" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="99%">
You are unregistered (or not logged in). Australian Photography offers so much more!
Please note that much of the site is invisible when logged out.
To enjoy the full site experience, please <a href="http://www.ausphotography.net.au/forum/register.php"><b>register</b></a> or log in.</td>
<td width="1%"><a onclick="closebar(); return false" href="http://www.ausphotography.net.au/forum">
<img style="float: left" src="http://www.ausphotography.net.au//forum/images/misc/close.gif" border="0"></a>
</td>

</tr>
</table>
</div>
Then I put it in "template \ FORUMHOME" or else?

AusPhotography
08-10-2011, 09:14 AM
No, I'll PM the code to put in a notice