-
AuthorPosts
-
December 12, 2006 at 12:39 am #117938
It seems that only 2 of the 3 images in the header-deco are randomly displayed.
Is…
$rnd = rand(2, count($files)-1);
on line 99 of index.php correct?
December 18, 2006 at 9:27 pm #212630I have tried changing the parameters in the following code (in index.php of this template)
<?php
$dir = "/images/$ja_color/header-deco/"; //You could change this to the folder store your header images.
$regex = '/(.gif)|(.jpg)|(.png)|(.bmp)$/i'; //Support image type: gif, jpg, png, bmp
$headerimage = "";$abs_path = $ja_template_absolute_path.$dir;
$live_path = $ja_template_path.$dir;
$dh = opendir($abs_path);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
if (count ($files) > 0){
$i = 0;
while (++$i < 10) {
$rnd = rand(2, count($files)-1);
$imgname = $files[$rnd];
if (is_file($abs_path."/".$imgname) && preg_match($regex, $imgname)) {
$headerimage = $live_path."/".$imgname;
break;
}
}
}
?>particularly this line
$rnd = rand(2, count($files)-1);
changing 2 to 3 and -1 to 0 etc… but all it ever seems to display randomly is image header-deco1.gif and header-deco3.gif (never header-deco2.gif) This is really frustrationg and I would really appreciate some help on this… pleeeease 😀
December 21, 2006 at 5:22 pm #212694Just wondering whether folks understand my problem or whether anyone is able to help with this topic. (I can’t be the only one with this problem?)
February 8, 2007 at 7:55 pm #214292I know I’m not making it up… why are only 2 images randomly displayed?
Is it just me or has anyone else noticed this bug? :confused:
Khanh Le ModeratorKhanh Le
- Join date:
- November 2013
- Posts:
- 1884
- Downloads:
- 41
- Uploads:
- 31
- Thanks:
- 44
- Thanked:
- 203 times in 131 posts
February 9, 2007 at 4:51 am #214326Hi easykey,
I have tested this feature carefully and found that it does show random image. Could you provide your live site url so we could tale a look at your site problem.February 9, 2007 at 10:13 am #214346http://www.easykey.net
It should have 3 different loveheartsKhanh Le ModeratorKhanh Le
- Join date:
- November 2013
- Posts:
- 1884
- Downloads:
- 41
- Uploads:
- 31
- Thanks:
- 44
- Thanked:
- 203 times in 131 posts
February 9, 2007 at 10:42 am #214350Hi easykey,
It is quite strange to your site. Please delete the image header-deco2.gif and re-upload it to see if it could fix. Or you could try to rename it to header-deco4.gif to see what happen.February 10, 2007 at 10:45 am #214395This problem does not seem to be unique to this site:
See http://www.thepelhams.net and http://www.thehadhams.comFebruary 10, 2007 at 10:59 am #214396As a test on http://www.thepelhams.net I have uploaded
header-deco1.gif
header-deco2.gif
header-deco3.gif
header-deco4.gif
header-deco5.gif
header-deco6.gifI have numbered the graphic so we can see what’s happening.
I only ever see images 1, 3, 4, and 6 (and never 2 or 5) – very strangeFebruary 10, 2007 at 11:06 am #214398on http://www.easykey.net I re-named header-deco2.gif to header-deco4.gif and it would still only show 1 and 3. BUT… I have now copied header-deco2.gif back again and it now shows
headers 1, 3 and 4 (but not 2)February 10, 2007 at 11:11 am #214399Another strange one:
I renamed all four images on http://www.easykey.net
deco1.gif
deco2.gif
deco3.gif
deco4.gif
(removing “header-” in the filename)
Now it shows, 2, 3, and 4 but never 1)February 10, 2007 at 11:19 am #214400Back to the test on http://www.thepelhams.net I have uploaded
header-deco1.gif
deco2.gif
deco3.gif
deco4.gif
deco5.gif
deco6.gifAnd all 6 are randomly dislayed so…
Going back to the code at the top of this thread is it something to do with “header-” that needs changing? -
AuthorPosts
This topic contains 12 replies, has 2 voices, and was last updated by easykey 17 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum