Page 1 of 1

Rotating Images each page load

Posted: Mon Jun 09, 2008 5:44 pm
by buntrosgali
Im building a hockey website for someone and i would like to have a player rotational thing on the right hand side of the screen a bit like this

http://redwings.nhl.com/

u see when u refresh each page the player in the top right changes. Anyone know anything about those type of things, i see that one is a javascript file.

Re: Rotating Images each page load

Posted: Tue Jun 10, 2008 5:54 am
by cyberman
Make a search with "random" in forge

http://dev.cmsmadesimple.org/search/?ty ... arch=Suche

and you will found some image rotators :).

Re: Rotating Images each page load

Posted: Tue Jun 10, 2008 9:41 am
by buntrosgali
cheers man i have tried installing that rotator but im getting string errors.


http://www.pigsflymedia.com/cms/


any advice? i dont think i have labelled the images folder properly but im not sure the images are here http://www.scotwellhouse.com/uploads/im ... m/img1.jpg


and the code is here
0)
{
$imageNumber = (time()+(microtime()*1000000)) % count($fileList);
$img = $folder.$fileList[$imageNumber];
$filename = $fileList[$imageNumber];
}

#Check if user has specified ID-tag
if (isset($params['id']))
{
$id = " id="".$params['id'].""";
} else {
$id = "";
}

#Check if user has specified ALT-tag, otherwise use default (image file name)
if (isset($params['alt']))
{
$alt = " alt="".$params['alt'].""";
} else {
$alt = " alt="".$filename.""";
}

#Check if user has specified image height, otherwise use default
if (isset($params['height']))
{
$height = " height="".$params['height'].""";
} else {
$height = "";
}

#Check if user has specified image width, otherwise use default
if (isset($params['width']))
{
$width = " width="".$params['width'].""";
} else {
$width = "";
}

#Check if user has specified image alignment, otherwise use default
if (isset($params['align']))
{
$align = " align="".$params['align'].""";
} else {
$align = "";
}

return "";

}

function smarty_cms_help_function_random_image() {
?>
What does this do?
Shows a random image.
How do I use it?
Just insert the tag into your template/page like: {random_image}
What parameters does it take?


(optional) folder - ("http://www.scotwellhouse.com/uploads/im ... m/img1.jpg").
(optional) height - Image height (579px).
(optional) width - Image width (default is unspecified, eg. actual image width).
(optional) align - Image alignment (default is unspecified).
(optional) alt - Image description/mouse-over text (default is image file name).
(optional) id - Image id (default is unspecified).


Hints and Tips
-A good idea might be to organize your random images in folders (ex): uploads/images/random/pagename/ a.s.o.

-Specifying width and not height (or viceversa) prohibits your images from exceeding that certain width (or height). Pretty useful sometimes.

-Thumbnail images are automatically excluded (images starting with "thumb_")



Author: Anders Hansen <baconburgare@hotmail.com>

Thanks to Greg for hinting on the ID-tag


Version: 1.2
Change History:

1.0a - Alpha version released.

1.0  - Added ALT-tag. Changed default values for Height, Width and Align

1.1  - Images starting with "thumb_" (thumbnails) prevented from being displayed

1.2  - Added ID-tag and changed IMG tag to comply with W3C standard. Also fixed a bug where the same image was selected when you had several random images on the same page.


anyone help?

Re: Rotating Images each page load

Posted: Tue Jun 10, 2008 9:46 am
by RonnyK
Did you try the http://dev.cmsmadesimple.org/projects/image-rotator/ plugin, download this and put it in the \functions folder of your CMSMS installation. It will be listed then in the Extensions -> Tags list and its help is selectable then...

Ronny

Re: Rotating Images each page load

Posted: Tue Jun 10, 2008 11:10 am
by buntrosgali
cool man got that working

http://pigsflymedia.com/cms/index.php?page=our-services


but if i want it on outside like this

http://www.scotwellhouse.com/uploads/im ... wantit.jpg

do i have to create a new div area or something in stylesheet?

Re: Rotating Images each page load

Posted: Wed Jun 11, 2008 7:34 am
by Dr.CSS
That would be a new div out side of main position:absolute then you will have to mess with the position: for main to get it to show up over the image, or cut the missing white part out and make it transparent...

EDIT: you don't have to add the http:// to you image URLs in CSS just 'images/bgnav2alternate.gif', and your best off putting them in a folder in uploads...