Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/06/2003, 11:30
garridoman
 
Fecha de Ingreso: marzo-2002
Ubicación: la comuna de la florida santiago chile
Mensajes: 71
Antigüedad: 23 años
Puntos: 0
asp

estoy usando asp y javascript
este es el codigo

<%Response.Buffer=True%>
<!-- #include file="../include/connection.asp"-->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="ccs/just.css" type="text/css">

<script type="text/javascript">
<!--
function ReplaceChar(txt) {
out1=" #";
out2="# ";
//add1="<a href='noticialink.asp'>";
add2="</a>";
tmp=""+txt;
while (tmp.indexOf(out1)>-1) {
pos = tmp.indexOf(out1);
tmp = " "+(tmp.substring(0, pos)) + "<a href='noticialink.asp?mostrar='>" + tmp.substring((pos + out1.length), tmp.length);
}
while (tmp.indexOf(out2)>-1) {
pos = tmp.indexOf(out2);

tmp = ""+(tmp.substring(0, pos)) + add2 + tmp.substring((pos + out2.length), tmp.length);
}

}

-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin="0" marginheight="0">
<%
select case request("canal")
case "1"
nombre_canal="td_mujer_saludables"
case "2"
nombre_canal="td_hombre_saludables"
case "3"
nombre_canal="td_ninos_saludables"
case "4"
nombre_canal="td_3ra_saludables"
case "5"
nombre_canal="td_familia_saludables"
case "6"
nombre_canal="td_medicina"
case "7"
nombre_canal="td_psicologia_salud"
case "8"
nombre_canal="td_ciencia_hoy"
case "9"
nombre_canal="td_mascotas_saludables"
end select

%>

<table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
<tr background="imgs_top/fondo_top2.gif">
<td colspan="3">


<!--#include file="top.htm" -->

</td>
</tr>
<tr>
<td width="150" valign="top" background="img_menu_izq/fondo_menu.gif">
<!--#include file="menu_izq.htm" -->
</td>
<td width="470" valign="top">

<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<div align="center"><img src="imgs/<%=nombre_canal%>.gif" width="463" height="34"></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<%
if request("detalle")="" then

dim cont_not
cont_not=0
pbl="s"
sql="select * from noticias where canal_ID="& request("canal")&" and publicar ='" & pbl & "'order by ID_Noticia desc"
set rs=cnSiempresano.execute (sql)
%>
<table width="100%" border="0" cellpadding="4" height="0" cellspacing="0">
<%do while not(rs.eof)
if cont_not < 3 then
%>

<tr>
<td class="justificado" valign="top" width="100%"colspan="2">
<p><b><font color="#3067A0"><%=rs("titulo_noticia")%></font></b><br>
<br>
<div align="justify">
<%if rs("url_imagen")<>"" then%>
<img src="../admin_canales/chicas/<%=rs("url_imagen")%>" width="100" height="100" align="right">
<%end if%>
<%

If InStr(Rs("texto_noticia"),"#") = 0 then
'todo el código que pueda dar error al no aparecer "#" aquí
response.write("manolo<br>")& Rs("texto_noticia")
else

%>
<script type="text/javascript">

txt='<%=Rs.Fields.Item("texto_noticia")%>';
//aqui llamo la funcion ReplaceChar
ReplaceChar(txt);
//aqui muestro lo devuelto de la funcion
document.write (tmp);
</script>
<%
end if
%>
</div><br>
</td>
</tr>
<%else
if cont_not=3 then
response.write("<tr><td colspan='2' class='justificado' valign='top'><b><font color='000066'>Ver noticias anteriores</font></b></td></tr>")
end if
%>


<tr><td colspan="2" class="justificado" valign="top"><b><font color="3067A0">
<a href="noticia.asp?detalle=sip&noticia_id=<%=rs("Id _noticia")%>&canal=<%=request("canal")%>"><%=rs("t itulo_noticia")%></a></font></b></td></tr>
<%
end if
cont_not=cont_not+1
rs.movenext
loop

%>

</table>
<%end if

end if

%>

</div><br>

<%end if%>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center"><input type="button" value="Volver" onclick="javascript:history.back()"></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<!--#include file="index_bass.htm" -->
</td>
</tr>

</table>

</td>
<td valign="top">

<table width="152" border="0" cellspacing="0" cellpadding="0">
<!--#include file="caluga_aviso.asp" -->
</table>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td>
<div align="center"></div>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>