How to extract host site

Post Reply
edev
Posts: 127
Joined: Wed Sep 14, 2005 5:10 pm

How to extract host site

Post by edev »

Hi,

I'm trying to make use of the group-by script, and make the "Parent site" link into a link for the host site. So when users see "more results from www.site.com", and they can click on "parent site" and it will take them to the host site "www.site.com".

The other task is that when users click on "more results from www.site.com", they will see in the summary on top of page "results for query site: www.site.com", is there any way to extract "www.site.com" and make it into a link inside the summary, so users can click on it and it will take them to the host site?

I tried using $site and $siteq from <init> but neither worked. Any help would be appreciated...
edev
Posts: 127
Joined: Wed Sep 14, 2005 5:10 pm

How to extract host site

Post by edev »

Ok I managed to get the host site from doing a rex from $Url, so my "parent site" now takes users to www.site.com.
So the first problem is solved. I still can't figure out how to make "www.site.com" in "results for query site:www.site.com" a link to the host site itself...
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

How to extract host site

Post by mark »

Where do you print that? Perhaps you want something like
<a href="http://$siteq">$siteq</a>
edev
Posts: 127
Joined: Wed Sep 14, 2005 5:10 pm

How to extract host site

Post by edev »

I want to print it inside <summary>, where I modified it to display a line above results saying "results for $query 1 - 10 of x results". The user query $query after user clicks on the "more results from www.site.com" changes to "query site:www.site.com", and I want to extract from $query the host site "www.site.com" and make it a link. So something like this:

results for query site:<a href="http://$site>www.site.com</a>

Essentially, if I can find withing $query the substring "site:", and extract whatever is after "site:", make it into a link. I'm just not sure how to make a partial string a link. Help?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

How to extract host site

Post by mark »

siteq should already have what you need. Try my previous suggestion.
edev
Posts: 127
Joined: Wed Sep 14, 2005 5:10 pm

How to extract host site

Post by edev »

Thanks Mark! The trick was to use $txtquery instead of $query. I did what you said and it worked!

Results for <b>$txtquery<b> <IF $siteq neq ''><b>site:</b><a http://$siteq" target="_blank">$siteq</a></IF>
Post Reply