<%@ language="VBSCRIPT" codepage="65001" %> <%option explicit%> <% %> <% ' ANULO INJECTION EN EL QUERYSTRING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! dim known_bad dim ii known_bad = array( "select", "insert", "update", "delete", "drop", "--", "'" ) for ii = lbound( known_bad ) to ubound( known_bad ) if ( instr( 1, request.QueryString, known_bad(ii), 1 ) <> 0 ) then ' si encontró algo de eso, lo mando al carajo: response.Redirect("http://localhost") end if next '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Veo si metio un TAG < en algún Form: dim elemento For Each elemento in Request.form if ( instr( 1, Request.form(elemento), "<", 1 ) <> 0 ) then ' si encontró algo de eso, lo mando al carajo: response.Redirect("http://localhost") end if Next '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! dim fso Set fso = CreateObject("Scripting.FileSystemObject") dim cual_notaId cual_notaID = 0 if (request.QueryString("id") <> "") then if (not isnumeric(request.QueryString("id")) ) then response.Redirect(application("dominio")) else cual_notaId = replace(request.QueryString("id"), "'", " ") cual_notaId = trim(left(request.QueryString("id"), 6)) end if end if dim cual_inicio dim cual_fin function formatoTitulo (cual_titulo) dim el_titulo el_titulo = "" if cual_titulo <> "" then el_titulo = cual_titulo el_titulo = replace(el_titulo, ".", "") el_titulo = replace(el_titulo, "-", "_") el_titulo = replace(el_titulo, chr(34), "") el_titulo = replace(el_titulo, """, "") el_titulo = replace(el_titulo, "”","") el_titulo = replace(el_titulo, "“","") el_titulo = replace(el_titulo, "″", "") el_titulo = Replace(el_titulo, """, "") el_titulo = Replace(el_titulo, "á", "á") el_titulo = Replace(el_titulo, "é", "é") el_titulo = Replace(el_titulo, "í", "í") el_titulo = Replace(el_titulo, "ó", "ó") el_titulo = Replace(el_titulo, "ú", "ú") el_titulo = Replace(el_titulo, "Á", "Á") el_titulo = Replace(el_titulo, "É", "É") el_titulo = Replace(el_titulo, "Í", "Í") el_titulo = Replace(el_titulo, "Ó", "Ó") el_titulo = Replace(el_titulo, "Ú", "Ú") el_titulo = Replace(el_titulo, "ü", "ü") el_titulo = Replace(el_titulo, "Ü", "Ü") el_titulo = Replace(el_titulo, "ñ", "ñ") el_titulo = Replace(el_titulo, "Ñ", "Ñ") el_titulo = Replace(el_titulo, "á", "a") el_titulo = Replace(el_titulo, "é", "e") el_titulo = Replace(el_titulo, "í", "i") el_titulo = Replace(el_titulo, "ó", "o") el_titulo = Replace(el_titulo, "ú", "u") el_titulo = Replace(el_titulo, "Á", "A") el_titulo = Replace(el_titulo, "É", "E") el_titulo = Replace(el_titulo, "Í", "I") el_titulo = Replace(el_titulo, "Ó", "O") el_titulo = Replace(el_titulo, "Ú", "U") el_titulo = Replace(el_titulo, "ü", "u") el_titulo = Replace(el_titulo, "Ü", "U") el_titulo = Replace(el_titulo, "ñ", "n") el_titulo = Replace(el_titulo, "Ñ", "N") el_titulo = replace(el_titulo, ")", "") el_titulo = replace(el_titulo, "(", "") el_titulo = replace(el_titulo, "]", "") el_titulo = replace(el_titulo, "[", "") el_titulo = replace(el_titulo, "?", "") el_titulo = replace(el_titulo, "¿", "") el_titulo = replace(el_titulo, "!", "") el_titulo = replace(el_titulo, "¡", "") el_titulo = replace(el_titulo, "$", "") el_titulo = replace(el_titulo, ";", "") el_titulo = replace(el_titulo, "#", "") el_titulo = replace(el_titulo, "+", "") el_titulo = replace(el_titulo, ",", "") el_titulo = replace(el_titulo, ":", "") el_titulo = replace(el_titulo, "'", "") el_titulo = replace(el_titulo, " ", "-") el_titulo = replace(el_titulo, "%", "") el_titulo = replace(el_titulo, "|", "") el_titulo = replace(el_titulo, "/", "-") el_titulo = replace(el_titulo, "&", "i") el_titulo = replace(el_titulo, "°", "") el_titulo = replace(el_titulo, "--", "-") el_titulo = replace(el_titulo, "__", "-") end if formatoTitulo = el_titulo end function Function RemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "<[^>]*>" RegEx.Global = True 'strText = Replace(LCase(strText), "
", chr(10)) strText = Replace(strText, chr(10), "") strText = Replace(strText, chr(34), "") ' saco comillas RemoveHTML = RegEx.Replace(strText, "") End Function '*************************************************************** 'Arrancamos definiendo cosas: dim cuantas_portada ' El total de notas que muestra en el index cuantas_portada = 48 dim cuantas_principal cuantas_principal = 4 ' Las notas del encabezado mas la principal ' Defino la fecha actual, para solucionar kilombos de páginas guardadas: dim dia, mes, anio 'dia = "" 'mes = "" 'anio = "" dim anterior anterior = false dim cualeslafecha 'cual es el archivo ??? dim nombre_archivo if request.QueryString("n") <> "" then dim matriz_fecha matriz_fecha = split(request.QueryString("n"), "_", -1, 1) anio = matriz_fecha(0) mes = matriz_fecha(1) dia = matriz_fecha(2) nombre_archivo = request.QueryString("n") cualeslafecha = dateserial(anio, mes, dia) if not (cualeslafecha = date) then anterior = true end if else anio = year(date()) mes = month(date()) dia = day(date()) 'cualeslafecha = dateserial(session("anio"), session("mes"), session("dia")) nombre_archivo = session("nombre_archivo") end if cualeslafecha = anio & "/" & mes & "/" & dia dim ultima_actualizacion ultima_actualizacion = "" 'dim rsMasLeidas_nota 'set rsMasLeidas_nota = server.CreateObject("ADODB.recordset") 'rsMasLeidas_nota.ActiveConnection = application("conexion_mdb")'application("conexion")' & session("nombre_archivo") & ".mdb" 'dim rsComentadas_nota 'set rsComentadas_nota = server.CreateObject("ADODB.recordset") 'rsComentadas_nota.ActiveConnection = application("conexion_mdb")'application("conexion")' & session("nombre_archivo") & ".mdb" 'Las consultas: '************************************************************** 'Las consultas: '************************************************************** dim cual_seccion dim cual_subseccion dim cuantas_notas ' cuántas de Agencia de Noticias cuantas_notas = 48 dim cuantas_muestro ' cuántas muestra en grande en la columna izquierda cuantas_muestro = 4 cual_seccion = 4 ' Gacetillas if (request.QueryString("s") <> "") and (request.QueryString("s") <> 0) and (request.QueryString("s") <> 99) then cual_seccion = request.QueryString("s") end if cual_subseccion = 0'4 if request.QueryString("ss") <> "" then cual_subseccion = request.QueryString("ss") end if 'dim cual_pagina 'actualizamos numero de pagina 'If Request.QueryString("pag") <> "" Then ' cual_pagina = Request.QueryString("pag") 'Else ' cual_pagina = 1 'End If 'Session("pagina") = cual_pagina if request.QueryString("s") <> "" then cuantas_muestro = 2 end if dim consulta_principal dim consulta_id_principal if not anterior then consulta_principal = "select notas.volanta, subsecciones.descripcion, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id order by notas.principal, notas.id desc limit 4"'" notas.id, notas.principal, notas.id_seccion, notas.id_subseccion, notas.titulo, notas.bajada, notas.volanta, notas.foto1, notas.foto2, notas.video, notas.epigrafe1, notas.comentarios, notas.fecha, notas.hora, subsecciones.descripcion, subsecciones.orden FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id ORDER BY notas.id DESC" 'where notas.id_subseccion <> 29 consulta_id_principal = "select notas.id FROM notas order by notas.principal, notas.id desc limit 4" else consulta_principal = "select notas.volanta, subsecciones.descripcion, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id and ((fecha < '" & cualeslafecha & "') or (fecha = '" & cualeslafecha & "')) order by notas.principal, notas.id desc limit 4"'" notas.id, notas.principal, notas.id_seccion, notas.id_subseccion, notas.titulo, notas.bajada, notas.volanta, notas.foto1, notas.foto2, notas.video, notas.epigrafe1, notas.comentarios, notas.fecha, notas.hora, subsecciones.descripcion, subsecciones.orden FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id ORDER BY notas.id DESC" 'where notas.id_subseccion <> 29 consulta_id_principal = "select notas.id FROM notas WHERE ((fecha < '" & cualeslafecha & "') or (fecha = '" & cualeslafecha & "')) order by notas.principal, notas.id desc limit 4" end if 'consulta_principal = "select top " & cuantas_portada & " notas.volanta, subsecciones.descripcion, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios, notas.rojo FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id order by notas.principal, notas.id desc"'" notas.id, notas.principal, notas.id_seccion, notas.id_subseccion, notas.titulo, notas.bajada, notas.volanta, notas.foto1, notas.foto2, notas.video, notas.epigrafe1, notas.comentarios, notas.fecha, notas.hora, subsecciones.descripcion, subsecciones.orden FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id ORDER BY notas.id DESC" 'where notas.id_subseccion <> 29 'consulta_id_principal = "select top " & cuantas_portada & " notas.id FROM notas ORDER BY notas.id DESC" '****************************************************************************** %> " /> <% dim cual_link cual_link = application("dominio") & "/" 'nota.asp?id=" dim link_nota %> " /> " /> <%=application("titulo")%> " /> " /> " /> " /> " /> " /> <% dim cual_dia dim cual_mes dim cual_anio cual_dia = day(cualeslafecha) cual_mes = month(cualeslafecha) cual_anio = year(cualeslafecha) if cual_dia < 10 then ' cual_dia = "0" & day(date()) end if if month(cualeslafecha) < 10 then cual_mes = "0" & month(cualeslafecha) end if %> <% Dim foto_grande ' para ver si existe la foto en /small... foto_grande = "no" ' Vamos viendo qué hay : 'dim rscontador 'set rscontador = server.CreateObject("ADODB.recordset") ' 'Empezamos ? dim rsNotas set rsnotas = server.CreateObject("ADODB.recordset") rsNotas.ActiveConnection = application("conexion_sql")'application("conexion") dim por_cual_va dim tamanio_celda dim cual_foto 'ultima_actualizacion = application("hora_actualizacion")'FormatDateTime(rsNotas.Fields("hora"), 4) dim xx dim contador_notas contador_notas = 0 dim cual_aviso_municolon %>
<% dim id(4) dim notas_fila dim cual_imagen%>
<% rsNotas.source = consulta_principal rsNotas.open if not rsnotas.bof then id(0) = rsnotas.fields("id") cual_imagen = "/data/fotos2/bbx_" & trim(rsnotas.fields("foto1")) link_nota = cual_link & formatoTitulo(trim(rsnotas.fields("titulo"))) & "-" & rsnotas.fields("id") %>
<%=trim(rsnotas.fields(" class="imagen_portada" />
"><%=trim(rsnotas.fields("titulo"))%>
<% end if ' rsnotas.close rsnotas.MoveNext %>
<% ' rsNotas.source = "select top 3 notas.id, notas.principal, notas.id_seccion, notas.id_subseccion, notas.titulo, notas.bajada, notas.volanta, notas.foto1, notas.epigrafe1, notas.comentarios, notas.hora, subsecciones.descripcion FROM notas INNER JOIN subsecciones ON notas.id_subseccion=subsecciones.id WHERE notas.id in (select max(id) from notas where (id not in (select id from notas where principal = 0)) group by id_subseccion) ORDER BY notas.id_subseccion" ' rsnotas.Open dim contador_principal contador_principal = 0 while not rsnotas.EOF contador_principal = contador_principal + 1 id(contador_principal) = rsnotas.fields("id") link_nota = cual_link & formatoTitulo(trim(rsnotas.fields("titulo"))) & "-" & rsnotas.fields("id") cual_foto = application("url_fotos") & "bx_" & trim(rsnotas.fields("foto1")) %> <% rsnotas.MoveNext wend rsnotas.close %>
<% dim rsSecciones set rsSecciones = server.CreateObject("ADODB.recordset") rsSecciones.ActiveConnection = application("conexion_sql") rsSecciones.source="Select * from subsecciones where orden < 200 order by orden"'id" rsSecciones.open notas_fila = 0 while not rssecciones.EOF if not anterior then rsnotas.Source = "SELECT notas.volanta, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios FROM notas WHERE principal = 1 and id_subseccion = " & rssecciones.fields("id") & " and id <> " & id(0) & " and id <> " & id(1) & " and id <> " & id(2) & " and id <> " & id(3) & " ORDER BY notas.id DESC LIMIT 5" else rsnotas.Source = "SELECT notas.volanta, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios FROM notas WHERE principal = 1 and ((fecha < '" & cualeslafecha & "') or (fecha = '" & cualeslafecha & "')) and id_subseccion = " & rssecciones.fields("id") & " and id <> " & id(0) & " and id <> " & id(1) & " and id <> " & id(2) & " and id <> " & id(3) & " ORDER BY notas.id DESC LIMIT 5" end if 'response.Write("SELECT notas.volanta, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios FROM notas WHERE principal = 1 and id_subseccion = " & rssecciones.fields("id") & " and id <> " & id(0) & " and id <> " & id(2) & " and id <> " & id(3) & " and id <> " & id(4) & " ORDER BY notas.id DESC LIMIT 5") rsnotas.Open if not rsnotas.bof then %>
<%=trim(rssecciones.fields("descripcion")) %>
<% notas_fila = notas_fila + 1 ' rsnotas.Source = "SELECT TOP 5 notas.volanta, notas.id, notas.fecha, notas.hora, notas.id_seccion, notas.id_seccion as id_tiponota, notas.id_subseccion, notas.titulo, notas.foto1, notas.foto1 as foto, notas.epigrafe1, epigrafe1 as epigrafe, notas.foto2, notas.epigrafe2, notas.bajada, notas.video, notas.texto_video, notas.comentarios, notas.rojo FROM notas WHERE principal = 1 and id_subseccion = " & rssecciones.fields("id") & " ORDER BY notas.id DESC" ' rsnotas.Open ' if rsnotas.fields("id_subseccion") <> 4 then ' rsnotas.MoveNext 'Salteo 1 porque la última ya la puse más arriba 'end if if not rsnotas.eof then link_nota = cual_link & formatoTitulo(trim(rsnotas.fields("titulo"))) & "-" & rsnotas.fields("id") cual_foto = application("url_fotos") & "bbx_" & trim(rsnotas.fields("foto1")) %>
<% cual_imagen = "/data/fotos2/bbx_" & trim(rsnotas.fields("foto1")) link_nota = cual_link & formatoTitulo(trim(rsnotas.fields("titulo"))) & "-" & rsnotas.fields("id") %>
<% rsnotas.MoveNext%>
<% dim kk for kk = 1 to 3 if not rsnotas.EOF then link_nota = cual_link & formatoTitulo(trim(rsnotas.fields("titulo"))) & "-" & rsnotas.fields("id") cual_foto = application("url_fotos") & "bx_" & trim(rsnotas.fields("foto1")) %> <% rsnotas.movenext end if next %>
<% end if %>
<% ' avisos: if notas_fila = 1 then %> <% end if if notas_fila = 2 then %> <% end if end if rsnotas.Close rssecciones.movenext wend ' VIDEOS ''''''''''''''''''''''''''''''''''''''''''''''''''''' %>
Video
<% 'Leo el video Dim video_XML Dim video_ItemList Dim video_Item Set video_XML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.6.0") video_XML.async = False video_XML.setProperty "ServerHTTPRequest", True video_XML.Load("https://www.berissociudad.com.ar/rss_video.asp") If (video_XML.parseError.errorCode <> 0) Then else 'Obtengo los item Set video_ItemList = video_XML.getElementsByTagName("item") Set video_XML = Nothing dim inicio_codigo_video dim cual_texto_mas dim cual_video dim inicio_bajada_video dim cual_bajada_video %>
<% For Each video_Item In video_ItemList ' En el rss viene el código del video con iFrame y la bajada, con esto lo corto: inicio_codigo_video = instr(video_Item.childNodes(2).text, "youtube.com/embed") + 17 cual_texto_mas = trim (right (video_Item.childNodes(2).text, len(video_Item.childNodes(2).text) - inicio_codigo_video) ) cual_video = left(cual_texto_mas, instr(cual_texto_mas, chr(34)) - 1 ) inicio_bajada_video = instr(video_Item.childNodes(2).text, "") + 8 cual_bajada_video = trim (right (video_Item.childNodes(2).text, len(video_Item.childNodes(2).text) - inicio_bajada_video) ) %> <% if instr(video_Item.childNodes(2).text, "facebook") = 0 then%>
<% else cual_bajada_video = replace(cual_bajada_video, "Ver todos los videos", "") %>
<%=video_Item.childNodes(2).text %>
<%end if %> <% Next %>
<% Set video_ItemList = Nothing end if %>
<% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' fin Videos %>
<% if 1 = 2 then%>
La chica NOVA
<% ' dim cont_novashow dim los_muestra_novashow los_muestra_novashow = true Dim novashow_nova_XML Dim novashow_nova_ItemList Dim novashow_nova_Item Set novashow_nova_XML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.6.0") novashow_nova_XML.async = False novashow_nova_XML.setProperty "ServerHTTPRequest", True novashow_nova_XML.Load("https://www.agencianova.com/rss_vidriera.xml") If (novashow_nova_XML.parseError.errorCode <> 0) Then los_muestra_novashow = false end if if los_muestra_novashow then 'Obtengo los item Set novashow_nova_ItemList = novashow_nova_XML.getElementsByTagName("item") Set novashow_nova_XML = Nothing 'cont_novashow = 0 For Each novashow_nova_Item In novashow_nova_ItemList %> <%=novashow_nova_Item.childNodes(0).text%>
<%=novashow_nova_Item.childNodes(2).text%>
<% next Set novashow_nova_ItemList = Nothing end if %>
Un Instante Deportivo
<% dim los_muestra_novadeportes los_muestra_novadeportes = true Dim novadeportes_nova_XML Dim novadeportes_nova_ItemList Dim novadeportes_nova_Item Set novadeportes_nova_XML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.6.0") novadeportes_nova_XML.async = False novadeportes_nova_XML.setProperty "ServerHTTPRequest", True novadeportes_nova_XML.Load("https://www.agencianova.com/rss_instante_deportivo.xml") If (novadeportes_nova_XML.parseError.errorCode <> 0) Then los_muestra_novadeportes = false end if if los_muestra_novadeportes then 'Obtengo los item Set novadeportes_nova_ItemList = novadeportes_nova_XML.getElementsByTagName("item") Set novadeportes_nova_XML = Nothing ' cont = 0 For Each novadeportes_nova_Item In novadeportes_nova_ItemList %> <%=novadeportes_nova_Item.childNodes(0).text%>
<%=novadeportes_nova_Item.childNodes(2).text%>
<% next Set novadeportes_nova_ItemList = Nothing end if %>
<% dim los_muestra_humor los_muestra_humor = true Dim humor_nova_XML Dim humor_nova_ItemList Dim humor_nova_Item Set humor_nova_XML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.6.0") humor_nova_XML.async = False humor_nova_XML.setProperty "ServerHTTPRequest", True humor_nova_XML.Load("https://www.agencianova.com/rss_humor.xml") If (humor_nova_XML.parseError.errorCode <> 0) Then los_muestra_humor = false end if if los_muestra_humor then 'Obtengo los item Set humor_nova_ItemList = humor_nova_XML.getElementsByTagName("item") Set humor_nova_XML = Nothing ' cont = 0 For Each humor_nova_Item In humor_nova_ItemList %>
<%=humor_nova_Item.childNodes(4).text%>
<%=humor_nova_Item.childNodes(0).text%> <% next Set humor_nova_ItemList = Nothing end if %>
<% end if%>
<% ' rsnotas.close set rsnotas = nothing %>