Ver Mensaje Individual
  #10 (permalink)  
Antiguo 16/05/2010, 16:51
rastro23
 
Fecha de Ingreso: mayo-2010
Mensajes: 7
Antigüedad: 14 años
Puntos: 0
De acuerdo Respuesta: Ayuda - Crear auto-links

Bueno, como prometí les dejo los códigos:

Como bien dijeron, lo del banner se hace con un frame y no es nada complicado.

Tenemos en este caso 2 php, uno que carga el frame (arriba) y el otro el contenido (enlace).


Arriba:

Código PHP:
<html>
<
head>
<
title>TITULO</title>
</
head>
<
body bgcolor="#000080" text="#FFFFFF">
<
p align="center"><strong><font face="Verdana" size="2">---------*********---------ACA PONGO LO QUE QUIERO----------*********----------</font></strong></p>
</
body>
</
html
Enlace:


Código PHP:
<html>
<head>
<title>TITULO</title>
</head>
<frameset framespacing="0" border="false" rows="8%,*" frameborder="0">
<frame name="superior" src="arriba.php" scrolling="no">
<frame name="inferior" src="<?php echo $_GET['sitio'];?>">
<noframes>
<body>
<p>Esta página usa marcos, pero su explorador no los admite.</p>
</body>
</noframes>
</frameset>
</html>

Aquí el generador de enlaces automáticos:



Código PHP:
<?

$txt 
"

<pre>

AQUÍ VAN ALOJADOS TODOS LOS ENLACES QUE QUIERAN. Formato http:// ó ftp://.

LOS PRE Y /PRE SON OPCIONALES, LOS AÑADO PARA QUE QUEDE UN SÓLO ENLACE POR LÍNEA.

</pre>



"
;

$txt preg_replace'/(http|ftp)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i''<a href="AQUÍ PUEDEN PONER ALGO DELANTE DEL ENLACE\0" target="_blank">\0</a>'$txt );

echo 
$txt;

?>
NOTA: Aclaro el sector donde se puede agregar algo antes del enlace. El uso que le dí fue para poder cargar los enlaces en el ejemplo del frame.

Por ejemplo poniendo:

Código PHP:
<?

$txt 
"

<pre>

AQUÍ VAN ALOJADOS TODOS LOS ENLACES QUE QUIERAN. Formato http:// ó ftp://.

LOS PRE Y /PRE SON OPCIONALES, LOS AÑADO PARA QUE QUEDE UN SÓLO ENLACE POR LÍNEA.

</pre>



"
;

$txt preg_replace'/(http|ftp)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i''<a href="http://www.direcciondetuweb.com/directoriodedestino/enlace.php?sitio=\0" target="_blank">\0</a>'$txt );

echo 
$txt;

?>
Estoy direccionando todos los enlaces aquí generados a mi documento enlace.php que a la vez carga un frame.

SAludos y cualquier duda avisen.

Última edición por rastro23; 16/05/2010 a las 17:05