![]() |
|
![]() |
#1 |
Green Mole
Join Date: Mar 2004
Posts: 5
|
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. Last edited by kh44na; 03-23-2004 at 09:50 AM. |
![]() |
![]() |
![]() |
#2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
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:
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#3 |
Green Mole
Join Date: Mar 2004
Posts: 6
|
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. |
![]() |
![]() |
![]() |
#4 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
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:
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#5 |
Green Mole
Join Date: Mar 2004
Posts: 6
|
I'm doing something wrong, but here's my stab at it -- tell me what's wrong....
PHP Code:
|
![]() |
![]() |
![]() |
#6 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Try checking the HTML source and then order the $output['key'] variables so that they make correct HTML output.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#7 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Here's more info...
PHP Code:
PHP Code:
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#8 | |
Green Mole
Join Date: Mar 2004
Posts: 6
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#10 |
Green Mole
Join Date: Mar 2004
Posts: 6
|
Worked great! Thanks, Charter!
|
![]() |
![]() |
![]() |
#11 |
Green Mole
Join Date: Mar 2004
Posts: 11
|
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! |
![]() |
![]() |
![]() |
#12 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Are you using the code in this post?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
![]() |
![]() |
![]() |
#13 |
Green Mole
Join Date: Mar 2004
Posts: 11
|
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 |
![]() |
![]() |
![]() |
#14 |
Green Mole
Join Date: Mar 2004
Posts: 11
|
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. |
![]() |
![]() |
![]() |
#15 |
Green Mole
Join Date: Sep 2004
Posts: 7
|
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:
![]() |
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search all indexed pages in search.php | nightrat | How-to Forum | 1 | 09-14-2004 03:52 AM |
Config Problem with Search on different pages. | -ding-dong- | Troubleshooting | 2 | 08-24-2004 10:18 AM |
converted from html pages to php pages now no pages will index!!! help!! | bigals | Troubleshooting | 24 | 04-01-2004 09:34 AM |
Highlighting of words and search pages | rafarspd | Mod Requests | 0 | 12-02-2003 07:13 AM |