Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/02/2011, 07:41
yooom
(Desactivado)
 
Fecha de Ingreso: enero-2011
Mensajes: 293
Antigüedad: 13 años, 4 meses
Puntos: 4
De acuerdo Aporte: Para que sirve este script randon banner si exite mejor ORDER BY RAND();

Para que sirve este script randon banner si exite mejor ORDER BY RAND();

si colocamos rand seria mas sencillo , o almenos eso pienso yo

Código PHP:

<?

$banners
=@rand("imagen1","imagen2","imagen3",etc...);


echo 
$banners;

?>
Disculpenme pero me gustaria que especificaran por que ponen estos ejemplo de java por realmente me esta incomodando gracias a Dios que me explicaron un poco de el maxleng segun la vercion de html y xhtml pero esto me parece que esta tambien fuera de lugar saludos.


Código HTML:
<html>
<head>
    <title>Selección de Banners Aleatorios</title>
</head>
 
<body>
<SCRIPT LANGUAGE="JavaScript"> 
// Realizado por: Fabian Muller modificado por KarlanKas para forosdelweb.com 
// WebExperto.com - Ayuda al webmaster en español 
// Comienzo 
 
width="468"; //Anchura del banner
height="60"; //Altura del banner
 
banners= new Array();
banners[0]="banner1.gif";
banners[1]="banner2.gif";
banners[2]="banner3.swf";
banners[3]="banner4.gif";
banners[4]="banner5.swf";
 
totalbanners = banners.length;
var ahora = new Date()
var segundos = ahora.getSeconds()
var ad = segundos % totalbanners;
seleccionado=banners[ad];
localizador=seleccionado.lastIndexOf('.');
localizador2=localizador+4
extension=seleccionado.substring(localizador+1,localizador2); 
archivo=seleccionado.substring(0,localizador);
 
document.write("<center>");
if (extension=="swf"){
flash=seleccionado;
document.write('<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=' + width + ' height=' + height + ' CODEBASE=\"http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0\">');
document.write('<PARAM NAME=\"MOVIE\" VALUE=\"' + flash + '\">');
document.write('<PARAM NAME=\"PLAY\" VALUE=\"true\">');
document.write('<PARAM NAME=\"LOOP\" VALUE=\"true\">');
document.write('<PARAM NAME=\"QUALITY\" VALUE=\"high\">');
document.write('<EMBED SRC=' + flash + ' width=' + width + ' height=' + height + ' PLAY=\"true\" LOOP=\"true\" QUALITY=\"high\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi? P1_Prod_Version=ShockwaveFlash\">');
document.write('</EMBED>');
document.write('</OBJECT>');}
else {document.write('<img src='+seleccionado+' width='+width+' height='+height+'>');
document.write('</center>');}
// Fin
 
</SCRIPT>
 
<!-- RESTO DE PÁGINA-->
</body>
</html> 
pero si lo quieren en tiempo real solo basta con hacer :

Código HTML:
<script language="javascript">
 
//Aquí cambia los nombres de las imágenes por las tuyas.
var imagenes=new Array()
 
imagenes[0]=new Image (380,288);
imagenes[0].src="http://img717.imageshack.us/img717/7647/bannerlittle.jpg"
imagenes[1]=new Image (399,291);
imagenes[1].src="http://valhallenlegend.roserver.net//vlro/tops/468x60.jpg"
imagenes[2]=new Image (248,289);
imagenes[2].src="http://img515.imageshack.us/img515/3848/shibusenro.jpg"
imagenes[3]=new Image (215,366);
imagenes[3].src="http://crearbanner.com/banners/10680389497429132.jpg"
 
cont=0
function presImagen()
{
if (document.all){
document.getElementById('foto').filters.blendTrans.apply()
document.getElementById('foto').src=imagenes[cont].src
document.getElementById('foto').filters.blendTrans.play()
}
else
    {
    document.images.foto.src = imagenes[cont].src
    }
if (cont < imagenes.length-1)
{cont ++}
else
{cont=0}
tiempo=window.setTimeout('presImagen()',5000)
 //cada 5000 milisegundos (5 seg.) cambia la imagen.
//cambia la cantidad por el tiempo que quieras que transcurra entre imagen e imagen
}
 
</script>
</head>
 
<body bgcolor="#FFFFFF" text="#000000" onLoad="presImagen()">
<img id="foto" src="http://img717.imageshack.us/img717/7647/bannerlittle.jpg" style="filter:blendTrans(duration=[b]3[/b])">
<!-- la duración de la transición es de 3 segundos. 
Cambia este valor según tus preferencias -->
</body>  




Última edición por yooom; 26/02/2011 a las 07:55