<!-- #INCLUDE VIRTUAL="/inc/config.asp" --><!-- #INCLUDE VIRTUAL="/inc/db_open.asp" --><!-- #INCLUDE VIRTUAL="/inc/functions.asp" --><%

SQL = "SELECT TOP 6 tsearch.pagetitle, tsearch.page, tsearch.description, COUNT(tsearch.id) AS Views FROM tsearch INNER JOIN tblWebsiteLog ON { fn CONCAT('/', tsearch.page) } = tblWebsiteLog.PageRef WHERE NOT(tsearch.page LIKE 'index.htm') GROUP BY tsearch.pagetitle, tsearch.page, tsearch.description ORDER BY Views DESC"
Set rsOthersView = Conn.Execute(SQL)

Response.ContentType = "application/xml"

%><?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/rss/styles/news.xsl"?>
<rss version="2.0">
   <channel>
      <title>The Sovereign Group - Popular Destinations</title>
      <link>http://<%= Request.ServerVariables("SERVER_NAME") %>/offshore-news/sovereign-news/latest-news.htm</link>
      <description>Sovereign Group Latest News</description>
      <language>en-gb</language>
<%
	  While (Not(rsOthersView.EOF))
	  		Set objView = Server.CreateObject("Scripting.Dictionary")
			 
			For Each Item In rsOthersView.Fields
			 
			 	strData = ""
			 	strData = Replace(CStr(Item), "-->","")
			   	strData = StringContentToXHTML(strData)
				strData = Replace(strData,"''","'")
				strData = Server.HTMLEncode(CStr(strData)) 
				strData = Replace(strData,VBCRLF, "<br />" & VBCRLF)		  			
				objView.Add Item.Name, strData
			 	
			 Next
			 
			strPage = ""
	  		arrPage = Split(objView("pagetitle"),"-")
	  		strPage = arrPage(Ubound(arrPage) - 1) & " - " & arrPage(Ubound(arrPage))	
%>
      <item>
         <title><%= strPage %></title>
         <guid isPermaLink="true">http://<%= Request.ServerVariables("SERVER_NAME") %>/<% Response.Write(objView("page")) %></guid>
		 <link>http://<%= Request.ServerVariables("SERVER_NAME") %>/<% Response.Write(objView("page")) %></link>
         <description><%= (objView("description")) %>
		 This page has been viewed by others <strong><%= objView("Views") %></strong> times</description>
      </item>
<%
		rsOthersView.MoveNext
	  Wend
%>
   </channel>
</rss>
