PDA

View Full Version : Adding the site URL in results page


lighthouse
03-15-2004, 06:22 AM
Looking for some help in customising my returned results...

I want to add a "From website: http://relevantsite.com" line inder each of the results - so that the user can quickly see where the search term was found (without having to click on it, or without using the "refine" code)...

I've tried many things, but nothing will show the desired effect...

The code in the template looks like this:

<phpdig:results>
<b><phpdig:page_link/></b>
<br />From website: WHAT-GOES-HERE [Relevance: <phpdig:weight/>%]
<br />
<phpdig:text/>
</phpdig:results>

Any help with "WHAT-GOES-HERE" is appreciated... all I want to do is display the website!

Thanks
Gary

vinyl-junkie
03-15-2004, 07:33 AM
You need something like this:From website: <phpdig:complete_path/>
Hope this helps. :)

lighthouse
03-15-2004, 07:45 AM
hi there,

tried that - but I don't actually want the full path... just the url of the main site:

so instead of "http://domain.com/subdir/file.htm" all i want is "http://domain.com"

Any ideas?

Thanks

vinyl-junkie
03-15-2004, 08:23 AM
Sorry, I misunderstood the question. This is untested, but I'm pretty sure this is what you need to do. Go into libs/search_function.php and find the following code:$url = eregi_replace("([a-z0-9])[/]+","\\\\1/",$content['site_url'].$content['path'].$content['file']); Replace it with the following code:$url = eregi_replace("([a-z0-9])[/]+","\\\\1/",$content['site_url']); Be sure you remove any word wrapping.

Let us know if this helps. :)

lighthouse
03-15-2004, 08:43 AM
Thanks....
that helped a lot....

:)

jerrywin5
03-22-2004, 01:37 PM
I think you can you just use <phpdig:limit_links/> as well.