Rotacyjna zmiana zdjęć

Szukam  Założony przez  CapitalCity1916.

wersja skryptu MyBB:
adres forum:www.csmiasto.pl
na czym polega problem Poszukuje rotacyjnej zmiany zdjęć tak jak tu http://gocs.pl/ :

To są dwa kody i chce zeby one się zmieniały, później będę dodawał więcej.

<a href="http://csmiasto.pl/"><img src="http://iv.pl/images/06049505441090355872.gif" border="0" alt="CsMiasto" /></a>

<a href="http://csmiasto.pl/"><img src="http://iv.pl/images/49514515672442674061.gif" border="0" alt="CsMiasto" /></a>

Proszę o instrukcję bo ogarniam 5/10 daje "2x+"
W katalogu z obrazkami twojego stylu tworzysz katalog o nazwie rotator. Wrzucasz do niego obrazki, które chcesz losować. Następnie wracasz do katalogu twojego stylu i tworzysz plik rotator.php o treści:
<?php
/*
By Matt Mullenweg > http://photomatt.net
Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
Latest version always at:

http://photomatt.net/scripts/randomimage

*/// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder 'rotator';

// Space seperated list of extensions, you probably won't have to change this.
$exts 'jpg jpeg png gif';

$files = array(); $i = -1// Initialize some variables
if ('' == $folder$folder './';

$handle opendir($folder);
$exts explode(' '$exts);
while (
false !== ($file readdir($handle))) {
foreach(
$exts as $ext) { // for each extension check the extension
if (preg_match('/\.'.$ext.'$/i'$file$test)) { // faster than ereg, case insensitive
$files[] = $file// it's good
++$i;
}
}
}
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand mt_rand(0$i); // $i was incremented as we went along

header('Location: '.$folder.$files[$rand]); // Voila!
?>

Następnie wstawiasz kod html w miejscu, gdzie ma się pojawiać obrazek:
<img src="{$theme['imgdir']}/rotator.php" /> 
:: Akcja DZIĘKUJĘ ZA POMOC ::
Pomocy udzielam jedynie na forum. Wszystkie rzeczy wykraczające poza tą dziedzinę wykonuję odpłatnie.



Użytkownicy przeglądający ten wątek:

1 gości