test
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • phmacfly Friend
    #117458

    is it possible to use an random image with Ja Kruger template in just under the menu
    instead of sh01.jpg / sh02.jpg /…

    if no ? how can we affect the image ( sh01.jpg or another ) in a page of this template ?

    thx in advance ?

    phmacfly

    Khanh Le Moderator
    #211180

    To load random image for Ja Kruger, plese open the template index.php file, find this code:

    [PHP]<div id=”ja-sh” class=”clearfix” style=”background:url(<?php echo “$ja_template_path/images/$ja_color/$ja_headerimg”; ?>) no-repeat top right;”>[/PHP]

    and replace with following code

    [PHP] <?php
    $dir = “/images/headerimages/”; //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 = $mosConfig_absolute_path.$dir;
    $live_path = $mosConfig_live_site.$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;
    }
    }
    }
    ?>
    <div id=”ja-sh” class=”clearfix” style=”background:url(<?php echo $headerimage; ?>) no-repeat top right;”>
    [/PHP]

    In this case, the template will load header image from folder [joomlaroot]/images/headerimages. Therefore, you must copy header images to that folder.

    phmacfly Friend
    #211195

    thank you very much

    it works fine !

    carolin Friend
    #211258

    Same here! It worked like a charm.

    Thanks!

    stefan71a Friend
    #212397

    I’ve installed this script and the random part works as it should but I’ve discovered a problem with that the text colour for texts in the default team seems to have change – so it’s not possible to read the text – headers are still working.

    Any idea about what the problem could be.

    Regards
    S

    imported_ajafar Friend
    #213095

    Would it be possible to utilize the JA Header module with JA Kruger? I’ve been trying to figure it out and have yet to succeed. Thanks guys.

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

This topic contains 6 replies, has 5 voices, and was last updated by  imported_ajafar 17 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum