<% Response.Buffer = TRUE Response.ContentType = "application/rss+xml" Response.AddHeader "content-disposition", "inline; filename=news-rss.xml" %> <% Const adOpenKeyset=1 Const adOpenStatic = 3 Const adLockOptimistic=3 Const adCmdText=&H0001 Const adCmdTable=&H0002 Const adCmdStoredProc=&H0004 'Type de variable Const adVarchar = 200 Const adInteger = 3 Const adDouble = 5 'Type de parametre Const adParamInput = &H0001 Const adParamOutput = &H0002 'Type de Curseur Const adUseClient = 3 Const adUseServer = 2 %> <% set conn = Server.CreateObject("ADODB.Connection") conn.ConnectionString = "DRIVER={SQL SERVER};server="&Application("SERVER_SQL")&";database="&Application("DataBase")&";uid="&Application("UserName")&";pwd="&Application("UserPswd") conn.Open %> <% sql = "Select * from Mnet_ModeleListe01 oi" sql = sql & " where oi.idoi in (SELECT p.idoi From oi_Periodes p inner join oi_dates d on p.DetailPeriode_id = d.idref and p.oilan=d.oilan AND p.detailperiode_type = '09.01.06' Where datefin >= getdate() AND datedebut <= getdate()+8)" sql = sql & " AND Exists(Select 1 from OI_SelectionsMedianet where idoi=oi.idoi and site='ot-loire-forez' and selection='agenda')" Set rSql = Server.CreateObject("ADODB.RECORDSET") rSql.Open sql,conn,adOpenKeySet,adLockOptimistic,adCmdText response.Write("") response.Write("") response.Write("") response.Write("Loire Forez Tourisme - Les news") response.Write("http://"&request.ServerVariables("HTTP_HOST")&"/_includes/asp/news-RSS.asp") response.Write("Les news en Loire Forez") response.Write("fr") response.Write("Médianet") response.Write("http://"&request.ServerVariables("HTTP_HOST")&"") response.Write("20") do while not rSql.EOF response.Write("") response.Write("<![CDATA["&rSql("title")&" - "&rSql("commune")&"]]>") response.Write("http://"&request.ServerVariables("HTTP_HOST")&"/evenements-loire-forez/detail-forez.asp?idoi="&rSql("idoi")&"&cat=agenda") response.Write("CDate(Right(rsql("dates"),10)) Then response.Write("Du "&CDate(Left(rsql("dates"),10))&" au "&CDate(Right(rsql("dates"),10))&"
") if CDate(Left(rsql("dates"),10))=CDate(Right(rsql("dates"),10)) Then response.Write("Le "&CDate(Left(rsql("dates"),10))&"
") response.write(rSql("description")&"]]>
") response.Write(""&Replace(""&Left(rsql("dates"),10),"/","-")&"") response.Write("
") rSql.movenext loop response.Write("
") response.Write("
") response.Flush() %>