Previous Thread
Next Thread
Print Thread
Hop To
Joined: Nov 2004
Posts: 198
L
Member
Member
L Offline
Joined: Nov 2004
Posts: 198
I use Google “AdSense for Search” to place a Google Search bar on my message board. This works well for searching large message boards very quickly. (I’ve been using it for years now.)

Google offers several options for displaying the output; the one I use is the option to output search results in one of my own pages. This is preferred because the output will be displayed on a page that has the look and feel of the rest of my site; links to the forums, etc.

The problem is that I’ve not found a nice way to do this since moving to threads from classic. I know you can place the results in HTML, PHP, etc.. because I do it on other sites. On this site, I place the output in a rather ugly static HTML page that doesn’t accurately represent my current web site.

My question is this: How can I have an output region (HTML or PHP) that resides in a construct that looks like my portal page?

Below you wil see my message board complete with the Google Search in the upper right. You will notice the large blank area where I have added a comment. That’s what you get when you use that little gold arrow to hide the forums within a master forum.
This is really the look I’m going for .. how can I write to that big blank area?

[Linked Image from game-master.net]

I’m not married to this particular idea, but I’d like to have a living display area that reflects any changes we make to the board in the way of links, islands, etc..
Ideas? Solutions? Suggestions?


Member since November 2004
Gold Member since Feb 2008
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
Google Ajax search API would allow you to do what you want. smile

Joined: Nov 2004
Posts: 198
L
Member
Member
L Offline
Joined: Nov 2004
Posts: 198
I'm not sure I understand your reply... I don't have a problem with the search, it's the display of the results I'm trying to resolve.

How would Google Ajax search API solve *that* problem?


Member since November 2004
Gold Member since Feb 2008
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
you'd have a div where the results would be displayed to. you can fully style the returned results (either json or xml or html), so it 'fits in' with your current style..

eg:

Code
// web search, open, alternate root
var options = new GsearcherOptions();
options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
options.setRoot(document.getElementById("your_search_results_div"));
searchControl.addSearcher(new GwebSearch(), options);

returned results have the following format (note the css):

HTML
<!-- A collection of web search results in the search control -->
<div class="gsc-results gsc-webResult">

  <!-- A single web result in the search control -->
  <div class="gsc-result gsc-webResult">

    <!-- A single web result, full structure defined below -->
    <div class="gs-result gs-webResult"></div>
  </div>
  ...
</div>

<!-- Similar pattern for local, blog, etc. -->
<div class="gsc-results gsc-localResult"></div>
<div class="gsc-results gsc-blogResult"></div>
  

then your style sheet (extra css section) would have those classes defined and *poof* done..

note: it requires a Google API key (free)

holy moley, i just noticed i'm a 'Pooh Bah' now eek

ps: note '*poof* done' doesn't imply it's as simple as the snippets i pasted.. there's a wee bit more to it, but it's doable wink

Joined: Nov 2004
Posts: 198
L
Member
Member
L Offline
Joined: Nov 2004
Posts: 198
Super.. and congrats on your Pooh Bah'ness laugh

Now.. What file do I insert the results code into to get it to display as shown above?


Member since November 2004
Gold Member since Feb 2008
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
well.. i guess you want search results and the search box to be on all screens ?

what i'd do is add the div right after the opening body tag and set it's inline style to style="display:none; z-index:10000;" also class="search_results_div" kinda dealio..

so it's hidden all of the time.. (until needed)

your extra css section styles the search_results_div to (when it becomes visible) to appear in the middle and the z-index allows it to overlay anything 'underneath' ...

then your ajax (javascript) crapola would do a .show / .hide (appear/fade if you wanna do scriptaculous stuff).. and then invoke the Google API stuff to fill it up..

... soo since it's right after the opening body tag, the file would be header.tpl wink -- forgot to mention it laugh

ps: here is an example of how they did it.. same idea.. just different styles Linky Poo™

Documentation is here

Joined: Nov 2004
Posts: 198
L
Member
Member
L Offline
Joined: Nov 2004
Posts: 198
there we go!
thank you your poo-bah'ness


Member since November 2004
Gold Member since Feb 2008

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)