PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   Adding the site URL in results page (http://www.phpdig.net/forum/showthread.php?t=668)

lighthouse 03-15-2004 05:22 AM

Adding the site URL in results page
 
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 06:33 AM

You need something like this:
PHP Code:

From website: <phpdig:complete_path/> 

Hope this helps. :)

lighthouse 03-15-2004 06: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 07: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:
PHP Code:

$url eregi_replace("([a-z0-9])[/]+","\\\\1/",$content['site_url'].$content['path'].$content['file']); 

Replace it with the following code:
PHP 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 07:43 AM

Thanks....
that helped a lot....

:)

jerrywin5 03-22-2004 12:37 PM

I think you can you just use <phpdig:limit_links/> as well.


All times are GMT -8. The time now is 12:14 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.