-
AuthorPosts
-
odpearl Friend
odpearl
- Join date:
- February 2008
- Posts:
- 37
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
November 21, 2008 at 2:13 am #135565Hi,
How do i modify this template:
I have a folder with many pictures , what i want is:
For the background will change
every time someone goes into the website. The background should change randomly from the folder of pictures.How can i do this? and who can explain it to me step by step because I am not a professional.
Thank you.
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
November 24, 2008 at 9:31 am #280105Dear odpearl,
Please view my guide:
+ Open file templates/ja_sanidineii_light/index.php for sanidine ii or templates/ja_sanidine/index.php for sanidine template, at about line 74, find following script:
<?php
//populate background for body
$bodybg = $tmpTools->getParam('ja_bodybg');
if ($bodybg) {
$bodybg = " style="background-image: url(".$tmpTools->templateurl()."/images/background/$bodybg);"";
}
?>and change to:
<?php
//populate background for body
$backgound_folder = 'images/background/'; //Path to background folder
$dir=opendir($backgound_folder);
$files = array();
$k = 0;
while(($file = readdir($dir)) !== false) {
// check extension if you want
if($file != '.' && $file != '..' && !is_dir($backgound_folder.$file)) {
$files[$k] = $file;
$k++;
}
}
closedir($dir);$rd = rand(0,$k - 1);
if(isset($files[$rd])){
$bodybg = $files[$rd];
if ($bodybg) {
$bodybg = " style="background-image: url(images/background/$bodybg);"";
}
} else {
$bodybg = $tmpTools->getParam('ja_bodybg');
if ($bodybg) {
$bodybg = " style="background-image: url(".$tmpTools->templateurl()."/images/background/$bodybg);"";
}
}/*if ($bodybg) {
$bodybg = " style="background-image: url(".$tmpTools->templateurl()."/images/background/$bodybg);"";
}*/
?>
Hope it help
odpearl Friendodpearl
- Join date:
- February 2008
- Posts:
- 37
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
November 24, 2008 at 12:44 pm #280131HI,
Thank you for answer, but got error:Warning: opendir(images/background/): failed to open dir: No such file or directory in /home/content/m/b/p/mbpartydesign/html/test2/templates/ja_sanidineii_light/index.php on line 76
Warning: readdir(): supplied argument is not a valid Directory resource in /home/content/m/b/p/mbpartydesign/html/test2/templates/ja_sanidineii_light/index.php on line 79
Warning: closedir(): supplied argument is not a valid Directory resource in /home/content/m/b/p/mbpartydesign/html/test2/templates/ja_sanidineii_light/index.php on line 86
Thanks.
scotty Friendscotty
- Join date:
- March 2008
- Posts:
- 2339
- Downloads:
- 0
- Uploads:
- 13
- Thanks:
- 76
- Thanked:
- 827 times in 595 posts
odpearl Friendodpearl
- Join date:
- February 2008
- Posts:
- 37
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
November 24, 2008 at 4:36 pm #280147Thank you .
Fix the missing “r”.
Stil two errors:
Warning: readdir(): supplied argument is not a valid Directory resource in /home/content/m/b/p/mbpartydesign/html/test2/templates/ja_sanidineii_light/index.php on line 79
Warning: closedir(): supplied argument is not a valid Directory resource in /home/content/m/b/p/mbpartydesign/html/test2/templates/ja_sanidineii_light/index.php on line 86
I created folder imagesbackground still not lucky
Thanks
scotty Friendscotty
- Join date:
- March 2008
- Posts:
- 2339
- Downloads:
- 0
- Uploads:
- 13
- Thanks:
- 76
- Thanked:
- 827 times in 595 posts
November 24, 2008 at 4:38 pm #280148lol… the missing ‘r’ was not a mistake. Well it might be but it’s missing in the rest of the argument so it doesn’t matter.
Take it back out and try again.
odpearl Friendodpearl
- Join date:
- February 2008
- Posts:
- 37
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
November 24, 2008 at 4:55 pm #280150Thank you VERY much.
Working Perfectly .
matt2047 Friendmatt2047
- Join date:
- June 2008
- Posts:
- 13
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
December 8, 2008 at 9:30 pm #281817I’ve got the same problem (sort of).
What “r” are you guys mentioning; I can’t find that. I just really want to specify one background image for the entire site, but am having no luck on that background-image line…
Thanks for any assist.
Cheers,
matt2047
odpearl Friendodpearl
- Join date:
- February 2008
- Posts:
- 37
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
December 9, 2008 at 12:18 am #281833Hi,
Don’t look for my mistake with ” r “
Just follow this :
1. create folder “background” under folder “images”
2. put some picture with same resolution as 1600x 2000 or more
3. change the code how JA Developer say in post #2Hope this help
Rob Hawthorn FriendRob Hawthorn
- Join date:
- September 2014
- Posts:
- 190
- Downloads:
- 0
- Uploads:
- 28
- Thanks:
- 38
- Thanked:
- 3 times in 1 posts
December 11, 2008 at 10:52 pm #282471<em>@odpearl 94190 wrote:</em><blockquote>Hi,
Don’t look for my mistake with ” r “
Just follow this :
1. create folder “background” under folder “images”
2. put some picture with same resolution as 1600x 2000 or more
3. change the code how JA Developer say in post #2Hope this help</blockquote>
Hi,
I’ve just inserted the new code, uploaded the new image and index.php to the correct paths (and deleted the other files in that folder), what does the background image file have to be called because I’ve lost the background image now when viewing my site in a browsermatt2047 Friendmatt2047
- Join date:
- June 2008
- Posts:
- 13
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
December 11, 2008 at 11:29 pm #282477Rob,
I edited the ja_vars_1.0x.php file that is mentioned here: http://www.joomlart.com/forums/topic/how-to-configure-joomlart-templates/
Set that file it’s referencing for the background to “example.jpg” and then make sure to place that same file in the images/background folder. You’ll see the other files for this template (sl-1, sl-2, etc.) listed in there as well.
Let me know if this works out okay for you.
matt2047
1 user says Thank You to matt2047 for this useful post
matt2047 Friendmatt2047
- Join date:
- June 2008
- Posts:
- 13
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
December 11, 2008 at 11:30 pm #282478I think by default, this template references “beach.jpg” for the background. So, look for that piece of code in the ja_vars_1.0x.php file.
Rob Hawthorn FriendRob Hawthorn
- Join date:
- September 2014
- Posts:
- 190
- Downloads:
- 0
- Uploads:
- 28
- Thanks:
- 38
- Thanked:
- 3 times in 1 posts
December 12, 2008 at 12:37 pm #282600Hi Matt,
Thanks for the reply, I appreciate it I have to admit though that I’m getting slightly frustrated (not with you, with the actual template solution).The background image file name is obviously referenced somewhere in the files but using CTRL+F I’m looking for “gaming-02.jpg” which is the file referenced but dreamweaver is not picking it up anywhere. FYI the background code is not in “ja_vars_1.0x.php” (although I am using j1.5 but is should be similar.
Just to reiterate I’m not having a go at you Matt, just thinking it should not be this difficult to change the background image. Sorry for the rant.
I’ll press on with the code modification as suggested.
matt2047 Friendmatt2047
- Join date:
- June 2008
- Posts:
- 13
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
December 12, 2008 at 4:55 pm #282622Hi Rob,
Don’t worry – I felt the exact same frustration myself with this particular template. I think the user guide could have been a lot more striaghtforward in how to edit simple stuff like this!
According to this link http://www.joomlart.com/forums/topic/ja-sanidine-userguide/ (configuring Sanidine for J1.5), you go into the template manager and change the “Body Background” to your image file. Now, I’m using J1.0 so I have no idea if that’s true or not, and you’ve probably already tried that, right?
What worked for me to find out where my background image was being called from was, I looked at the page source from Firefox, and then opened the ja_vars_1.0x.php file in Dreamweaver and found that line of code. That same link says that it could also be ja_vars.php, depending on the Joomla version/template.
Sorry, that’s my entire experience with this template, wish I could be of better assistance. Feel free to let me know if you need help with any other particulars, and best of luck!
matt2047
1 user says Thank You to matt2047 for this useful post
Rob Hawthorn FriendRob Hawthorn
- Join date:
- September 2014
- Posts:
- 190
- Downloads:
- 0
- Uploads:
- 28
- Thanks:
- 38
- Thanked:
- 3 times in 1 posts
December 12, 2008 at 8:24 pm #282677<em>@matt2047 95104 wrote:</em><blockquote>Hi Rob,
Don’t worry – I felt the exact same frustration myself with this particular template. I think the user guide could have been a lot more striaghtforward in how to edit simple stuff like this!
According to this link http://www.joomlart.com/forums/topic/ja-sanidine-userguide/ (configuring Sanidine for J1.5), you go into the template manager and change the “Body Background” to your image file. Now, I’m using J1.0 so I have no idea if that’s true or not, and you’ve probably already tried that, right?
What worked for me to find out where my background image was being called from was, I looked at the page source from Firefox, and then opened the ja_vars_1.0x.php file in Dreamweaver and found that line of code. That same link says that it could also be ja_vars.php, depending on the Joomla version/template.
Sorry, that’s my entire experience with this template, wish I could be of better assistance. Feel free to let me know if you need help with any other particulars, and best of luck!
matt2047</blockquote>
Yes Matt that’s exactly right about the template manager…….I know, it was as easy as that 🙂Cheers for taking the time to help it’s very much appreciated
-
AuthorPosts
This topic contains 15 replies, has 5 voices, and was last updated by Rob Hawthorn 15 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum