<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/basededatos.asp" -->

<%
Dim Datos
Dim Datos_cmd
Dim Datos_numRows

Set Datos_cmd = Server.CreateObject ("ADODB.Command")
Datos_cmd.ActiveConnection = MM_basededatos_STRING
Datos_cmd.CommandText = "SELECT * FROM noticias WHERE (Categoria = 1) OR (Categoria = 2) ORDER BY Fecha DESC" 
Datos_cmd.Prepared = true

Set Datos = Datos_cmd.Execute
Datos_numRows = 0
%>
<%
CurrDate = Now()
CurrHour = Hour(CurrDate)
if CurrHour < 10 then CurrHour = "0" & CurrHour
CurrMin = Minute(CurrDate)
if CurrMin < 10 then CurrMin = "0" & CurrMin
CurrSec = Second(CurrDate)
if CurrSec < 10 then CurrSec = "0" & CurrSec
CurrDateT = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & _
MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & _
CurrHour & ":" & CurrMin & ":" & CurrSec & " GMT" 

Encabezado = "<?xml version='1.0' encoding='ISO-8859-1'?>" & vbCrlf
Encabezado = Encabezado & "<?xml-stylesheet type=""text/xsl"" href=""http://www.bolivia4x4.com/rss.asp"" ?>" & vbCrlf
Encabezado = Encabezado & "<rss version=""2.0"" xmlns:content=""http://purl.org/rss/1.0/modules/content/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"">" & vbCrlf & vbCrlf

Encabezado = Encabezado & "<channel>" & vbCrlf
Encabezado = Encabezado & "<title>Viajes 4x4 en Bolivia, Turismo Aventura, Off Road travels in Bolivia</title>" & vbCrlf
Encabezado = Encabezado & "<link>http://www.bolivia4x4.com/</link>" & vbCrlf
Encabezado = Encabezado & "<description>Somos un grupo de amigos que disfrutamos de viajes a medida en Bolivia, expediciones en 4x4. Desiertos del altiplano, Salar de Uyuni, Parque Sajama, Lipez, itinerario y turismo exclusivo</description>" & vbCrlf
Encabezado = Encabezado & "<lastBuildDate>"  & CurrDateT & "</lastBuildDate>" & vbCrlf
%>
<%
Response.ContentType = "text/xml"
Response.Write(Encabezado)
Response.Write("<language>es-ES</language> " & vbcrlf) 
Response.Write("<copyright>COPYRIGHT 2011 Khainata - Web Designers</copyright>" & vbcrlf & vbcrlf) 
%>
<%
i = 1
While i < 101 AND Not Datos.EOF
%>
<%
NuevoLink = "http://www.bolivia4x4.com/noticias_proc.asp?ID=" & (Datos.Fields.Item("ID").Value)

CurrDate = (Datos.Fields.Item("Fecha").Value)
CurrHour = Hour(CurrDate)
if CurrHour < 10 then CurrHour = "0" & CurrHour
CurrMin = Minute(CurrDate)
if CurrMin < 10 then CurrMin = "0" & CurrMin
CurrSec = Second(CurrDate)
if CurrSec < 10 then CurrSec = "0" & CurrSec
CurrDateT = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & _
MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & _
CurrHour & ":" & CurrMin & ":" & CurrSec & " GMT" 

%>
<%
   response.write "<item>"
   response.write "<title>" & (Datos.Fields.Item("Titular").Value) & "</title>"
   response.write "<link>" & NuevoLink & "</link>"
   response.write "<pubDate>" & CurrDateT & "</pubDate>"
   response.write "<description><![CDATA[<img src=""http://www.bolivia4x4.com/archivos/" & Datos("Foto") & ".jpg"" alt=""" & Datos("Titular")& """ title=""" & Datos("Titular") & """ hspace=""2"" align=""right"" />" & (Datos.Fields.Item("Resumen").Value) &"...]]></description>"
   response.write "</item>"  & vbcrlf  & vbcrlf
%>
<%
i = i + 1
Datos.Movenext
Wend
%>
<%
Response.Write( vbcrlf & "</channel>" & vbcrlf & "</rss>")
%>
<%
Datos.Close()
Set Datos = Nothing
%>
