PDA

View Full Version : Charter, Please do me a favour.


sid
10-16-2003, 11:32 PM
Charter,
I need to put this message at the top of the result page:
'Try your query on: Google'
but when they click on Google, it takes them to the Google results page with the keyword that the user searched in my search engine, but it will take it into Google's result page, something similar like in the PHPDIG Demo you have there:

Choose your template : phpdig.html black.html simple.html green.html grey.html yellow.html bluegrey.html terminal.html linear.html lightgreen.html newspaper.html corporate.html

So the HTML Source code of the template will do thanks.

Thanks in advance.

Rolandks
10-17-2003, 12:03 PM
Hmm, what is the problem:
$query_string is the keyword.

insert this in your google-Link:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=phpdig&btnG=Google+Search

q=".$query_string."

-Roland-

Charter
10-17-2003, 04:41 PM
Hi. Also, if you want to include the templates like in the demo, this thread (http://www.phpdig.net/showthread.php?threadid=98) should help.

sid
10-17-2003, 04:52 PM
Hi Roland,
I'm not that good at PHP, So I don't know where to put it etc. Please give me a sample template, with that code included because when I try to include q=".$query_string." in the HTML page, it doesn't do it.

druesome
10-17-2003, 11:40 PM
Hi sid, you can try doing the following:

1.) Open up search_function.php, and look for the line:

$search_time = sprintf('%01.2f',$mtime[0]+$mtime[1]-$start_time);

Right under that, insert:

$try_words = str_replace(' ', '+', $query_string);
$try_query = "<p align=\"center\">Try your search on: <a href=\"http://www.google.com/search?sourceid=navclient&q=$try_words\">Google</a></p>";

2.) Then, look for the lines:

if ($template == 'array' || is_file($template)) {
$phpdig_version = PHPDIG_VERSION;

Below that, you can see something like:

$t_mstrings = compact('title_message','phpdig_version','result_message', ....

After 'title_message' insert 'try_query' so it will now look something like:

$t_mstrings = compact('title_message','try_query','phpdig_version','result_message', ....

3. Lastly, open up your template file, and insert:

<phpdig:try_query/>

anywhere you like. If you are using Dreamweaver, make sure you insert it directly into the code or else it will not be recognized. Good luck!

sid
10-18-2003, 03:36 AM
Thanks Druesome!