-
AuthorPosts
-
October 24, 2006 at 12:50 am #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 ModeratorKhanh Le
- Join date:
- November 2013
- Posts:
- 1884
- Downloads:
- 41
- Uploads:
- 31
- Thanks:
- 44
- Thanked:
- 203 times in 131 posts
October 24, 2006 at 9:04 am #211180To 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.
October 24, 2006 at 1:08 pm #211195thank you very much
it works fine !
October 27, 2006 at 12:00 am #211258Same here! It worked like a charm.
Thanks!
December 9, 2006 at 1:15 am #212397I’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
SJanuary 11, 2007 at 9:07 pm #213095Would 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.
-
AuthorPosts
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