vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Google Custom Search, searching on my site problem? (https://vborg.vbsupport.ru/showthread.php?t=150851)

raiderlax 06-28-2007 07:20 AM

Google Custom Search, searching on my site problem?
 
Well I added the google custom search box to my site and I want the results shown on my site, so I created a new template called "gsearch", so I put this code in it:

PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
<!-- 
no cache headers -->
<
meta http-equiv="Pragma" content="no-cache" />
<
meta http-equiv="Expires" content="-1" />
<
meta http-equiv="Cache-Control" content="no-cache" />
<!-- 
end no cache headers -->
$headinclude

</head>
<
body>
$header
$navbar

<br />

<!-- 
Google Search Result Snippet Begins -->
 <
center> <div id="results_000000000000000000000000000000000"></div>
  <
script type="text/javascript">
    var 
googleSearchIframeName "results_000000000000000000000000000gc";
    var 
googleSearchFormName "searchbox_0000000000000000000000000000c";
    var 
googleSearchFrameWidth 600;
    var 
googleSearchFrameborder 0;
    var 
googleSearchDomain "www.google.com";
    var 
googleSearchPath "/cse";
  </
script>
  <
script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script></center>
<!-- 
Google Search Result Snippet Ends -->
          

<
br />

$footer
</body>
</
html

Now when I'm logged into my site I use the google custom search and I see the results perfectly inside my site,

now when I'm logged out and search this comes up:

"Unable to add cookies, header already sent.
File: /home/content/t/h/o/thowkins/html/TALKFITNESS.ORG/gsearch.php
Line: 8"

Please how do I make it so that the results come up both when logged in and out???


Thanks :)

Dismounted 06-28-2007 07:23 AM

Could you post gsearch.php?

raiderlax 06-28-2007 07:30 AM

The code in the first post is gsearch.php, you have to put that google code on the page where you want results shown.

Dismounted 06-28-2007 07:46 AM

You need to build a proper vBulletin-powered page.

https://vborg.vbsupport.ru/showthread.php?t=62164

raiderlax 06-28-2007 08:06 AM

Thanks so much, got it working perfectly logged in and out!

:)

How does it look to you? www.talkfitness.org

Michael Biddle 06-28-2007 08:31 AM

Looks good


All times are GMT. The time now is 05:03 AM.

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.01184 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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