Posted on: 12/05/06 06:13pm
By: k74
:helpme: Is it possible to have a google search results box open within a staticpage?
The following code is what was given-
<!-- Google Search Result Snippet Begins -->
<div id="googleSearchUnitIframe"></div>
<script type="text/javascript">
var googleSearchIframeName = 'googleSearchUnitIframe';
var googleSearchFrameWidth = 700;
var googleSearchFrameborder = 0 ;
var googleSearchDomain = 'www.google.com.au';
</script>
<script type="text/javascript"
src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!-- Google Search Result Snippet Ends -->
I just could not get this to work. I have had other feeds open in static pages but this one won't, any suggestions?
Thanks in advance :shakehands:
Re: Can a Google search result page open within a static page?
Posted on: 12/05/06 08:51pm
By: Anonymous (ironmax)
Actually...I think this might work better for you...
Text Formatted Code
<CENTER><!-- Search Google -->
<CENTER>
<FORM action=http://www.google.com/search method=get>
<div align="center">
<center>
<TABLE bgColor=#ffffff>
<TBODY>
<TR>
<TD>
<p align="center"><A href="http://www.google.com/"><IMG align=absMiddle border=0
src="http://www.google.com/logos/Logo_40wht.gif" <ALT="Google" width="128" height="53"></A>
<INPUT maxLength=255 name=q size=31> <INPUT name=btnG type=submit value="Google Search">
</p>
</TD></TR></TBODY></TABLE></center>
</div>
</FORM></CENTER><!-- Search Google -->
Re: Can a Google search result page open within a static page?
Posted on: 12/06/06 05:46pm
By: k74
Thanks Ironmax
I tried what you suggested but found it doing the same thing, it either opens a blank page when php is turnes on in the static page or returns the code in the static page with php turned off. For the moment I am happy to have it open up in a new window, but would gratiously accept any suggestions that may get this google script to work within a static page. I found that this is relatively new for google adsense for search subscribers and the script they give out will not work with all site (eg blogger).
Have a nice day :shakehands:
Re: Can a Google search result page open within a static page?
Posted on: 12/06/06 08:24pm
By: Anonymous (ironmax)
Okay...just so you know its working one my site...goto http://www.spacequad.com/staticpages/index.php/20060124155128403 and you will see all sorts of search engines in action...some may have been broken over time.
Re: Can a Google search result page open within a static page?
Posted on: 12/07/06 07:22am
By: k74
Thanks for the promt rely ironmax. I checked out your site and maybe I may not have explained myself clearly. My mistake.
The code above was for the search results box to open up within my wesite without opening over the site of in a new window. This is a function google now gives you with google adsense for search. I have a search box within my header bar and wanted the results to open within the site.
Sorry for not being clearer, and for not having my site online(hoping this weekend or early next week).
Thanks againg
regards
Kev
Re: Can a Google search result page open within a static page?
Posted on: 12/07/06 08:19am
By: samstone
K74,
The above code is all you need to put in the staticpage, and you need to tell the "search code" to show the result in this staticpage?
You must have the following code at the top of the search code:
Text Formatted Code
<form method="get" action="URL OF YOUR STATIC PAGE" target="_top">
Replace URL OF YOUR STATIC PAGE with the actual url of the staticpage for the result.
Sam
Re: Can a Google search result page open within a static page?
Posted on: 12/07/06 08:37pm
By: k74
:shakehands:
Thanks samstone I will check this over again. I thought I had all that in there but I may have missed something. Working late at night doesn't agree with going through code.
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 09:59am
By: SamF
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 10:19am
By: Anonymous (ironmax)
Quote by: SamF
By the way, Ironmax, the Google search bar on your site doesn't work at all for me -- putting in a test search simply returns me to that page. And the Yahoo and other searches open up in Yahoo, not on your site.
Thats because I was doing some script work trying to get it to open in the same window, otherwise it would have opened in another window. Everything is back to where it was before I started messin with the script.
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 10:28am
By: SamF
Quote by: ironmax
Thats because I was doing some script work trying to get it to open in the same window, otherwise it would have opened in another window. Everything is back to where it was before I started messin with the script.
[/p]
Right, it opens up in Google, just like k74 and my search bar. In theory there's a way for the results to open up in your own site, but I haven't figured out a way to do this with Geeklog yet.
Any more thoughts greatly apopreciated!
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 01:21pm
By: samstone
SamF,
You already have the answer to the question as you read the previous posts. In fact, Google Adsense site has clear instruction for doing that.
Sam
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 02:27pm
By: SamF
Quote by: samstone
You already have the answer to the question as you read the previous posts. In fact, Google Adsense site has clear instruction for doing that.
Hi Sam,
As I mentioned a few posts up, I did this, and it doesn't appear to work for me site.
First I tried doing it with Google Co-op, using the exact code that they recommended. Then I tried modifying the form header code slightly to be the way you posted. Then I tried doing a regular Google search bar, as k74 posted, with your header, and still nothing.
In all cases (as I mentioned), instead of trying to go to the static page I requested, e.g.
http://www.ai-tools.org/staticpages/index.php?page=20061114141536601[*2] , it would try to go to a url like
http://www.ai-tools.org/staticpages/index.php?cx=013555921050100862112 ...[*4] .
Since that page doesn't exit, I would get the message "Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions."
Here's the code I used to try and get Google Co-op to work:
Text Formatted Code
<!-- Google CSE Search Box Begins -->
<form id="searchbox_013555921050100862112:8qjpccdkcia" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601"> // adding method="get" and target="_top" to this makes no difference
<input type="hidden" name="cx" value="013555921050100862112:8qjpccdkcia" />
<input name="q" type="text" size="40" />
<input type="submit" name="sa" value="Search" />
<input type="hidden" name="cof" value="FORID:9" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_013555921050100862112%3A8qjpccdkcia"></script>
<!-- Google CSE Search Box Ends -->
With this on the results page
Text Formatted Code
<!-- Google Search Result Snippet Begins -->
<div id="results_013555921050100862112:8qjpccdkcia"></div>
<script type="text/javascript">
var googleSearchIframeName = "results_013555921050100862112:8qjpccdkcia";
var googleSearchFormName = "searchbox_013555921050100862112:8qjpccdkcia";
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>
<!-- Google Search Result Snippet Ends -->
Since that didn't work, I tried Ironmax's's code, with your header:
Text Formatted Code
<CENTER><!-- Search Google -->
<CENTER>
<form method="get" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601" target="_top">
<div align="center">
<center>
<TABLE bgColor=#ffffff>
<TBODY>
<TR>
<TD>
<p align="center"><A href="http://www.google.com/"><IMG align=absMiddle border=0
src="http://www.google.com/logos/Logo_40wht.gif" <ALT="Google" width="128" height="53"></A>
<INPUT maxLength=255 name=q size=31> <INPUT name=btnG type=submit value="Google Search">
</p>
</TD></TR></TBODY></TABLE></center>
</div>
</FORM></CENTER><!-- Search Google -->
Again, nothing.
If you have figured out a way to actually get the results to show up on your Geeklog site, I'd love to see how you did it. So far, I haven't seen this happen.
Thank you,
Sam
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 02:53pm
By: Chrispcritters
I've got it working on this page: (Regular Google Search)
http://www.whatismyipaddress.com/staticpages/index.php/how-do-I-use-a-proxy-server[*5]
Which when you use the search within the static page, directs the results to another static page.
The code on the source page is:
Text Formatted Code
<form method="get" action="http://www.whatismyipaddress.com/staticpages/index.php/search-results" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<input type="text" name="q" size="31" maxlength="255" value="proxy server list"></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-{removed}"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="{removed}"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399; AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF; T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
The code on the landing page:
Text Formatted Code
<div id="googleSearchUnitIframe"></div>
<script type="text/javascript">
var googleSearchIframeName = 'googleSearchUnitIframe';
var googleSearchFrameWidth = 650;
var googleSearchFrameHeight = 1300;
var googleSearchFrameborder = 0 ;
</script>
<script type="text/javascript"
src="http://www.google.com/afsonline/show_afs_search.js">
</script>
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 04:01pm
By: SamF
Quote by: ChrispcrittersI've got it working on this page: (Regular Google Search)
Hmmm... While I see this works on your page, I've copy-and-pasted it onto my page and it doesn't work.
I replaced your static page url, which was
http://www.whatismyipaddress.com/staticpages/index.php/search-results[*6]
with mine, which is
http://www.ai-tools.org/staticpages/index.php?page=20061114141536601[*2]
When I do a search, the page that tris to open is
http://www.ai-tools.org/staticpages/index.php?q= ...[*7]
which doesn't exist, and so gives me an error.
Now, I'm a php newbie, but am I right in thinking that the source of my troubles is the fact that, while you have a nice static page url (staticpages/index.php/search-results), I have a nastier one (staticpages/index.php?page=...)? It seems to me that Google's PHP is replacing the PHP I need for my page. (This is what I asked about six posts further up, but it was ignored).
If this is the source of my problems, should I try to get nice URLs like you? Is that the tidyURL hack, or whatever it's called?
Thanks,
Sam
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 06:51pm
By: Chrispcritters
Is the URL rewrite used with geeklog.
I'd try to get it working simply first, then added complexity later.
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 07:44pm
By: Anonymous (ironmax)
Quote by: SamFQuote by: ChrispcrittersI've got it working on this page: (Regular Google Search)
Hmmm... While I see this works on your page, I've copy-and-pasted it onto my page and it doesn't work.
Sam
I think you may have missed something here in the directions. What Chrispcritters was trying to say is that you need to make 2 static pages. One for the initial page, below..
Text Formatted Code
<form method="get" action="http://www.ai-tools.org/staticpages/index.php?page=20061114141536601" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<input type="text" name="q" size="31" maxlength="255" value="proxy server list"></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-{removed}"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="{removed}"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399; AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF; T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
Then on the second static page that you create, put the following code below...
Text Formatted Code
<div id="googleSearchUnitIframe"></div>
<script type="text/javascript">
var googleSearchIframeName = 'googleSearchUnitIframe';
var googleSearchFrameWidth = 650;
var googleSearchFrameHeight = 1300;
var googleSearchFrameborder = 0 ;
</script>
<script type="text/javascript"
src="http://www.google.com/afsonline/show_afs_search.js">
</script>
Now of course you will have to change the http://www.whatismyipaddress.com/staticpages/index.php/search-results" in the first box above to reflect your system, which I've done for you. So, in total...you should have 2 static pages for google to work. I hope this helps clarify it for everyone.
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 08:47pm
By: samstone
SamF,
You need to use url rewrite feature. That is to be set in Geeklog's config.php, so that your url won't show a question mark like staticpages/index.php?page=20061114141536601, instead it will show something like staticpages/index.php/20061114141536601.
Hope this helps!
Sam
Re: Can a Google search result page open within a static page?
Posted on: 12/08/06 09:31pm
By: Anonymous (ironmax)
Quote by: samstoneSamF,
You need to use url rewrite feature. That is to be set in Geeklog's config.php, so that your url won't show a question mark like staticpages/index.php?page=20061114141536601, instead it will show something like staticpages/index.php/20061114141536601.
Hope this helps!
Sam
Okay...that makes sense...opps...I missed that one
Re: Can a Google search result page open within a static page?
Posted on: 12/11/06 08:11pm
By: k74
I got it finally working with the code from the google site, I must of been placing the header script incorrectly. Now you can type in your search in the header and get results within a google static page. You can get this code once you register with adsense on google. Thanks for your help. :shakehands:
Re: Can a Google search result page open within a static page?
Posted on: 12/11/06 11:46pm
By: Anonymous (ironmax)
If anyone that knows how to program may want to try the same thing with Yahoo. Here's the information needed to build off of their APIs. http://www.fiftyfoureleven.com/weblog/web-development/programming-and-scripts/apis/yahoo-apis-search-web-services
Re: Can a Google search result page open within a static page?
Posted on: 01/22/07 06:48pm
By: PMW.org
Ok, just to sum all of this up, after spending a couple of hours trying different things and then finally availing myself of these wonderful forums and finding this thread.
If you are trying to get Adsense for Search integrated on your GL site so that the search results open in your site's environment:
1. First, make sure URL_rewrite = true in your config.php. If you are not running URL rewrite, you will not be able to put google search in a static page. If a "?" mark shows up in your static page URLs, you are not using rewrite.
2. Go to Google Adsense for search and generate the code, using the URL of your static page (rewrite enabled).
3. Place Google code in the relevant places in header and in static page.
You should be good to go.
Thanks to all who contributed here.
You can check it out here. . just do a google search:
http://puppymillwatch.org/index.php