Rotating Images each page load

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
buntrosgali
Forum Members
Forum Members
Posts: 167
Joined: Thu Apr 17, 2008 9:02 pm

Rotating Images each page load

Post 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.
cyberman

Re: Rotating Images each page load

Post by cyberman »

Make a search with "random" in forge

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

and you will found some image rotators :).
buntrosgali
Forum Members
Forum Members
Posts: 167
Joined: Thu Apr 17, 2008 9:02 pm

Re: Rotating Images each page load

Post 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?
Last edited by buntrosgali on Tue Jun 10, 2008 9:45 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Rotating Images each page load

Post 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
buntrosgali
Forum Members
Forum Members
Posts: 167
Joined: Thu Apr 17, 2008 9:02 pm

Re: Rotating Images each page load

Post 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?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Rotating Images each page load

Post 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...
Last edited by Anonymous on Wed Jun 11, 2008 7:38 am, edited 1 time in total.
Post Reply

Return to “Layout and Design (CSS & HTML)”