<%
if id<>"" then
sql="SELECT * FROM contenidos WHERE id=" & id & " ORDER BY orden DESC"
set rs=sql_consulta(sql)
else
if id_familia<>"" then
sql="SELECT * FROM contenidos WHERE id_seccion=2 AND id_familia=" & id_familia & " ORDER BY orden DESC"
set rs=sql_consulta(sql)
else
sql="SELECT * FROM contenidos WHERE id_seccion=2 AND id_familia=1 ORDER BY orden DESC"
set rs=sql_consulta(sql)
id_familia=rs("id_familia")
end if
if rs.eof then
id=0
else
id=rs("id")
end if
end if
if not rs.eof then
contenido=rs("contenido")
if contenido<>"" then
contenido=replace(contenido,"src=""../ftp/","src=""ftp/")
end if
%>
<%=rs("titulo")%>
<%=response.Write(contenido)%>
<%
if rs("descarga")<>"" then
ext=ExtensionArchivo("ftp/" & rs("descarga"))
select case ext
case "jpg","jpeg","gif"
imagen="images/imagen.jpg"
case "doc","docx"
imagen="images/word.jpg"
case "xls","xlsx"
imagen="images/excel.jpg"
case "mdb","mdbx"
imagen="images/access.jpg"
case "ppt","pptx"
imagen="images/powerpoint.jpg"
case "pdf"
imagen="images/pdf.jpg"
case else
imagen="images/otros.jpg"
end select
%>
<%end if%>
<%end if%>
<%
set rs=nothing
sql="SELECT * FROM contenidos WHERE id_seccion=2 AND id<>" & id & " AND id_familia=" & id_familia & " ORDER BY orden DESC"
set rs=sql_consulta(sql)
%>