[search] Customize search option in search module

Astor

Joined: 2005-12-15
Posts: 154
Posted: Fri, 2007-06-01 08:41

Excuse bad english, I try to explain what I would want .

- Visitor search a key in search engine (Google, Yahoo ...)
- the visitor chooses and enter in my site
- in the search module of my gallery appears the key tried

I have found in italian forum this code php.It finds exact key used for the search (only for Google :-< )

Quote:

//se c'è prendo il referer
$refG=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'';

//proviene da Google?
if (eregi("google", $refG)){
$indirizzo=parse_url($refG);
parse_str($indirizzo['query'], $parsato);
$chiave = $parsato["q"];
echo $chiave;
}

You can help me in order to use this code?


Versione di Gallery = 2.2.1 core 1.2.0.1
Versione PHP = 4.4.4 apache2handler
Webserver = Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7a PHP/4.4.4 FrontPage/5.0.2.2634 mod_perl/2.0.3 Perl/v5.8.5
Database = mysql 4.1.22-standard, lock.system=flock
Strumenti = ArchiveUpload, Exif, Getid3, NetPBM, Thumbnail, Gd, LinkItemToolkit
Accelerazione = none, none
Sistema operativo = Linux roar2.netjaguar.com 2.6.9-42.0.8.EL #1 Tue Jan 30 12:10:22 EST 2007 i686
Tema predefinito = PGtheme
gettext = abilitato
Locale = it_IT
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11