Page 1 of 1

How to extract host site

Posted: Tue May 08, 2007 1:32 pm
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...

How to extract host site

Posted: Tue May 08, 2007 2:45 pm
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...

How to extract host site

Posted: Tue May 08, 2007 3:57 pm
by mark
Where do you print that? Perhaps you want something like
<a href="http://$siteq">$siteq</a>

How to extract host site

Posted: Wed May 09, 2007 9:49 am
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?

How to extract host site

Posted: Wed May 09, 2007 10:25 am
by mark
siteq should already have what you need. Try my previous suggestion.

How to extract host site

Posted: Wed May 09, 2007 10:44 am
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>