Ver Mensaje Individual
  #11 (permalink)  
Antiguo 14/06/2002, 17:12
Avatar de tunait
tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Problemas con Tablas!!! Ayuda!!

Pues allá va. Por cierto que ahora funciona bién. Creo que el problema lo tenía en el action. El día que lo hice creo que tenía ya las neuronas (las dos) re-tostadas y no supe ver lo que fallaba.

<script language="JavaScript">
var palabro=35
function verificar()
{
texto=document.formu.comentarios.value
texto2=texto.split(/\s/);
largo=texto2.length;
for(m=0;m<largo;m++)
{
if(texto2[m].length>palabro)
{
if(texto2[m].substring(0,5)=="[img]" && texto2[m].substring(texto2[m].length-6,texto2[m].length)=="[/img]")
{continue}
if(texto2[m].substring(0,5)=="http://" && texto2[m].substring(text...ength)=="")
{continue}
if(texto2[m].substring(0,13)=='.substring(texto2[m].length-6,texto2[m].length)=="")
{continue}

longitud=texto2[m].length
texto3=texto2[m].substr(0,palabro)+" "
for(h=palabro;h<longitud;h+=palabro)
{
texto3+=texto2[m].substr(h,palabro-1)+" "
}
texto2[m]=texto3
texto=texto2[0]+" "
for(j=1;j<largo;j++)
{
texto+=texto2[j]+" "
}
document.formu.comentarios.value=texto

}
}
document.formu.submit()
}
</script>

y luego en body:

<form name="formu" action="htt://www.loqusea.com/aplicaciónpertinente.asp" method="post">
<textarea name="comentarios" cols="90" rows="10"></textarea>
<input type="button" value="enviar" onClick="verificar()">
</form>

Aquí lo que habrán de cambiar es la parte en que verifica si la supuesta palabra es una imagen u una url. En este caso verifica que comience por [ img] y termine por [/img], los mismo con url y url=http://. En caso de ser afirmativo pasa de largo la palabra. Si tu foro usa ese código no habrá que cambiarse nada