Autor | Zpráva | ||
---|---|---|---|
tonda Profil * |
#1 · Zasláno: 10. 2. 2009, 15:12:12
Mám script PHP-
------------- $images = array( "../image/baner1.gif", "../image/baner2.gif" ); mt_srand(time()); $random_index = mt_rand(1, (count($images))); $random_index--; ------------------ Chtěl bych aby se obrázky střídali po 12 hodinách. Děkuji. |
||
kureal Profil |
#2 · Zasláno: 10. 2. 2009, 16:35:40
Co třeba toto:
$images = array("../image/baner1.gif", "../image/baner2.gif"); $changeInterval = 12*60*60; //perioda zmeny obrazku v sekundach $random_index = hexdec(substr(md5(floor(time()/$changeInterval)), 0, 6))%count($images); $imagesPath = $images[$random_index]; |
||
Časová prodleva: 3 dny
|
|||
tonda Profil * |
#3 · Zasláno: 13. 2. 2009, 11:17:08
kureal-Zkopíroval jsem a není funkční.Můj editor se nějak špatně dívá na -%count-.Jinak děkuji za snahu.
|
||
Časová prodleva: 15 let
|
0