![]() |
Search Results
Hello,
Instead of having my search results displayed in the traditional "php dig template page" - I wanted to have the search results placed into a page on my website that matches the "look and feel" or "design" of my website more accurately. Would anyone be able to assist me in how I can go about doing so? Thanks in advance. |
Hi. There is a tutorial here on how to include files in the templates, but if you want to have your own page from scratch, just do the following.
In search.php use 'array' rather than $template, assigning the output from phpdigSearch to a variable, like so: PHP Code:
PHP Code:
|
When I'm replacing the $template variable with 'array' -- do I just leave it as 'array', or do modify the 'array'?
I tried using your code as-is, and something is going wacko. |
Hi. Just leave it as posted, and then after doing a search, you'll see key value pairs that you can use in a custom page. For example, searching for the word test would produce a similar key value pair as the following, assuming the word test is a keyword in your table:
[result_message] => Results 1-9, 9 total, on "test" (0.32 seconds) To display the 'Results 1-9, 9 total, on "test" (0.32 seconds)' result message in a custom page, just use the following: PHP Code:
PHP Code:
PHP Code:
Results 1-9, 9 total, on "test" (0.32 seconds) If you were to replace: PHP Code:
PHP Code:
|
I'm doing something wrong, but here's my stab at it -- tell me what's wrong....
PHP Code:
|
Hi. Try checking the HTML source and then order the $output['key'] variables so that they make correct HTML output.
|
Hi. Here's more info...
PHP Code:
PHP Code:
|
Quote:
|
Hi. The eregi function is a defined function. Check the custom_search_page.php for extra or missing characters, and for incorrect code wrapping. Also, when doing copy paste, do the paste into a text only editor, and then save the file.
|
Worked great! Thanks, Charter!
|
Highlighted text extract or summary
I'm using the same method to customise the output.
But I find that using $output['text'] on my site just outputs the metatag description. If I use the template output included, the output is an extract of the page eg. blah blah blah keyword blah... keyword blah blah... etc... How do I output the ['text'] so that it appears as in the template? Many thanks! |
Hi. Are you using the code in this post?
|
Yeah!
I realised I set the config to not do context searches (CONTENT_TEXT = 0), as I couldn't index on my server. I'm now doing it locally. I've set the flag back to 1 and it's working now! Doh! Thanks |
Hope I am not intruding...
Hello,
This thread was exactly what I was looking for. It worked great. Could I bother you for some idea of how to add the keyword highlighting to your custom code above? Thanks. |
I used Charters code posted 03-26-2004 06:16 AM
this is how I made my highlighting. not perfectet it thou. Add this function to your custom_search_page.php PHP Code:
PHP Code:
|
All times are GMT -8. The time now is 09:38 PM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.