TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 378
  • Total: 378

Trying to get Google Search block open in the center to display the results

Started by nokonium, January 02, 2007, 07:06:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

I'm working on this with a co-admin and we are now stumped. We want to open the search results in the center frame, as does SMF search. The best we have achieved so far is to open it in an article. The problem with that is the article will only load if it is the featured article or as an article in a block. A simple link to the article works fine. If you take away target="_top" TP screws up.

We want to do this so that peeps using the Google Search do not go off of the site to display the results, say if you use it for a site search.

This is what we have

The block code
<!-- Search Google -->
<div align="center">
<form method="get" action="http://nokonium.co.uk/Ragmans-Trumpet/index.php?page=19 target="_top">
<table bgcolor="#F7F2E9">
<tr><td nowrap="nowrap" valign="top" align="center" height="32">

<label for="sbi" style="display: none">Enter your search terms</label>
<input type="text" name="q" size="12" maxlength="255" value="" id="sbi"></input>
</td></tr>
<tr><td valign="top" align="center">
<label for="sbb" style="display: none">Submit search form</label>
<input type="submit" name="sa" value="Google Search" id="sbb"></input>
<input type="hidden" name="client" value="############"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="########"></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="flav" value="0000"></input>
<input type="hidden" name="sig" value="#########"></input>
<input type="hidden" name="cof" value="GALT:#993333;GL:1;DIV:#663300;VLC:993333;AH:center;BGC:F7F2E9;LBGC:FFFFCC;ALC:993333;LC:993333;T:993333;GFNT:993333;GIMP:993333;FORID:11"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</div>
<!-- Search Google -->


The article code
<!-- 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.co.uk';
</script>
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!-- Google Search Result Snippet Ends -->

whoflungdoo

How about making a menu item with a link to your article, so when its clicked, the article opens in the center, only the article has an iframe with the src = to your stand alone page?

Nokonium

Quote from: whoflungdoo on February 10, 2007, 04:36:57 PM
How about making a menu item with a link to your article, so when its clicked, the article opens in the center, only the article has an iframe with the src = to your stand alone page?

The google code in the article is for an iframe.

Clicking search on the Google Search block opens the article and fills the iframe with the search result. Even that is not happening for just an article shown on the front page or not in the alpha version that I am testing. I can however still open the article if it is in a block, without a title or frame, so that it is invisible until filled. That works in IE7, FF2 and Opera.

The problem remaining is then to open a selected search link in the search results iframe.

Nokonium

A couple of other bits

_top can be replaced by _parent, _self, but to no avail

<base target="_####"> can be added to the article, it doesn't show as code (I know it should be in the head) but doesn't work either.


Nokonium


tick

I think this would be a pretty cool addition to my site.  I will keep a watch on this to see how it is coming

Nokonium

There are two parts to the problem

Getting an ordinary article to open with the Google search results

Getting the site/page from a link to open in the results i-frame, as it does if you do a Google search on the google site.

tick

I wish I could help, but my  knowledge in coding and such is very limited

Nokonium


This website is proudly hosted on Crocweb Cloud Website Hosting.