Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • easykey Friend
    #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?

    easykey Friend
    #212630

    I 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 😀

    easykey Friend
    #212694

    Just 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?)

    easykey Friend
    #214292

    I 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 Moderator
    #214326

    Hi 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.

    easykey Friend
    #214346

    http://www.easykey.net
    It should have 3 different lovehearts

    Khanh Le Moderator
    #214350

    Hi 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.

    easykey Friend
    #214395

    This problem does not seem to be unique to this site:
    See http://www.thepelhams.net and http://www.thehadhams.com

    easykey Friend
    #214396

    As 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.gif

    I 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 strange

    easykey Friend
    #214398

    on 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)

    easykey Friend
    #214399

    Another 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)

    easykey Friend
    #214400

    Back to the test on http://www.thepelhams.net I have uploaded
    header-deco1.gif
    deco2.gif
    deco3.gif
    deco4.gif
    deco5.gif
    deco6.gif

    And 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?

Viewing 12 posts - 1 through 12 (of 12 total)

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