Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.3
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 1 No
Flag it:
Contact Reason [ ? ]

google_hilite

What is It?

When applied to a page arrived at via Google, this function will highlight the terms used for the Google search wherever they appear.

To see Google Hilite in action, click through the first result on this Google search (after the ‘sponsored link’) or the fifth (!) result for Verisign.

How to Install

1. Download and extract google_hilite.zip.

2. Upload google_hilite.php to your server

3. Add a style to your CSS:

.hilite { background-color: #FF9; }

By all means change the colour.

4. Place this on your pages or template, right after <body>

<?php
$dr = $_SERVER[DOCUMENT_ROOT];
include_once($dr.'/PATH/TO/google_hilite.php');
ob_start("google_hilite");
?>

If you uploaded the file to a directory called ‘includes’ in your web directory, the line above should read
include_once($dr.'/includes/google_hilite.php');

5. Place the following somewhere if you’d like to welcome the google visitor:

<? google_welcome(); ?>

Change Log

0.3 Empty tags were appearing in text containing markup. Fixed. Thanks to Todd Dominey (again).

0.2 This page created, first zip available

0.1 Pull!

(All credit to Jason Levine and Adrian Holovaty, who implemented similar scripts on their sites, making me jealous enough to write my own.)

Article Request Count:
Posted here:
11 Apr 2005

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (4)

ZiQ:
http://textism.com/tools/google_hilite/google_hilite.zip

It works but it shows a text like “php code is deprecated” when I insert the php code into the page.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern