Imagens linkadas randômicas
Aqui temos um código simples para exibir imagens (que podem ser banners) linkadas de forma aleatória.
PHP:
-
<?php
-
/*
-
Simple randomizer.
-
Roger Johansson, http://www.456bereastreet.com/
-
*/
-
'href' => 'url-1',
-
'title' => 'title-text-1',
-
'src' => 'image-1.jpg',
-
'alt' => 'alt-text-1'
-
),
-
'href' => 'url-2',
-
'title' => 'title-text-2',
-
'src' => 'image-2.jpg',
-
'alt' => 'alt-text-2'
-
),
-
'href' => 'url-3',
-
'title' => 'title-text-3',
-
'src' => 'image-3.jpg',
-
'alt' => 'alt-text-3'
-
),
-
'href' => 'url-4',
-
'title' => 'title-text-4',
-
'src' => 'image-4.jpg',
-
'alt' => 'alt-text-4'
-
),
-
'href' => 'url-5',
-
'title' => 'title-text-5',
-
'src' => 'image-5.jpg',
-
'alt' => 'alt-text-5'
-
)
-
);
-
$numberOfItems = 3; // Change to the number of items you want
-
for ($i = 0; $i <$numberOfItems; $i++) {
-
$item = $arrItems[$randItems[$i]];
-
echo "\t" . '<li class="r' . ($i + 1) . '"><a href="' . $item['href'] . '" title="' . $item['title'] . '"><img src="' . $item['src'] . '" alt="' . $item['alt'] . '"></a></li>' . "\n";
-
}
-
?>
Pesquisa personalizada
rapaz, legal esse script em php…
vou colocar alguns banner que vai mudar sozinho! valeu
forte abraço