vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Integration with vBulletin - AusPhotography Google Custom Search (https://vborg.vbsupport.ru/showthread.php?t=266449)

AusPhotography 07-07-2011 10:00 PM

AusPhotography Google Custom Search
 
1 Attachment(s)
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.

Code:

<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('888888888888888888888:kgkgkgkgkgk');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');
  }, true);
</script>


AusPhotography 07-08-2011 02:30 AM

1 Attachment(s)
As it looks on our site...

Attachment 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

Quote:

Originally Posted by MudRacing (Post 2230130)
Good works!!

Thanks!

Quote:

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

Quote:

Originally Posted by snoopytas (Post 2231092)
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

Quote:

Originally Posted by MudRacing (Post 2231458)
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

Quote:

Originally Posted by snoopytas (Post 2231620)
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?
Code:

<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


All times are GMT. The time now is 02:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01170 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete