Jump to content

How to rotate images?


Guest oldboy

Recommended Posts

Guest oldboy

Over a month ago i requested some advice on how to get rotating images on the main page, but no reply so i try again.

I have searched the forum and google and i cant find any easy way to have images rotate.

There most be an easy way to do this via a php script. Any suggestions?

Link to comment
Share on other sites

Over a month ago i requested some advice on how to get rotating images on the main page, but no reply so i try again.

I have searched the forum and google and i cant find any easy way to have images rotate.

There most be an easy way to do this via a php script. Any suggestions?

Rotating as in scrolling? which images?

Link to comment
Share on other sites

I'd use javascript to create a rotating advertisement. Do a google search for "DHTML Banner Ad Rotator". You should then add a new div to YOUR_SKIN/styleTemplates/global/index.tpl

I'd add the div beneath the div which contains the Categories tag. Then simply incorporate the DHTML Banner Ad script (or some other script) into that div. You'll of course need to upload the banner ad script to your server, ensuring the links in the index.tpl file point to the right directory where you'll be keeping that banner ad rotator.

Hope this helps!

Link to comment
Share on other sites

You can rotate images with javascript or with a php script. Don't give up after failing to integrate the one script.

Here is an example of rotating images with java script: http://www.allstarbowling.com/

Look at the sites in Show Off forum, you will see some that use js and some that use php scripts I believe. There is a mod with total CubeCart integration of js slideshow, configurable in Admin Control panel, I know because I wrote it. Also, if you want to hard code some js image script this is not difficult to do and there is a thread here somewhere about it, search for javascript slideshow, or just slideshow, you are bound to be able to find it somehow.

Link to comment
Share on other sites

Guest xceejayx

this might be what you're looking for...?

<script language=JavaScript>



var img_width = "468";

var img_height = "60";

var img_title = "Click Here";





var ad=new Array()

//insert here your images src

ad[0]='http://IMAGE1.jpg';

ad[1]='http://IMAGE2.jpg';

ad[2]='http://IMAGE3.jpg';

ad[3]='http://IMAGE4.jpg';

ad[4]='http://IMAGE5.jpg';



var links=new Array()

//insert here your links

links[0]='http://LINK1.com';

links[1]='http://LINK2.com';

links[2]='http://LINK3.com';

links[3]='http://LINK4.com';

links[4]='http://LINK5.com';



var xy=Math.floor(Math.random()*ad.length);

document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>');

</SCRIPT>

you could probably remove the links bit if you just wanted the images without links...

i dunno

Link to comment
Share on other sites

Guest hardnut33

have you got this code on your site ceejay?

your ruby site is great. a real old skool style tattooist theme.

Oldboy, I have a link on how to create a js slideshow, im just unsure if i'm allowed to post it here..PM me if you want the link

Link to comment
Share on other sites

Guest xceejayx

Thanks hardnut :blink:

No i don't have it on my site anymore, i used to use it when i was using an affilliate program, but decided it wasn't earning me enough cash!

Link to comment
Share on other sites

harrdnut, your link will probably be fine if it is a javscript tutorial about slideshows. If it is strictly educational, it would benefit the members.

The link restrictions here are meant to remove advertising by third-party CubeCart service providers, and to prevent anything even remotely approaching forum spamming by such.

Link to comment
Share on other sites

Guest LewisSellers

Hi,

Rikki, the example you've given, is exactly what I want on my site, could you send me a PM or reply on here on where I can get it from and how to install it.

That would be great!

Thanks

Lewis

Link to comment
Share on other sites

Guest oldboy

Thanks for all interesting tips, they all look really nice, but im actually looking for a simple php script to rotate images on every page load.

No slide show, ads, scrolling, java or Flash, just a script that will rotate images from a directory.

The point is to have different images to show up for a returnign visitor.

Also if possible to have each image to point to a specific link.

Link to comment
Share on other sites

Guest xceejayx

Thanks for all interesting tips, they all look really nice, but im actually looking for a simple php script to rotate images on every page load.

No slide show, ads, scrolling, java or Flash, just a script that will rotate images from a directory.

The point is to have different images to show up for a returnign visitor.

Also if possible to have each image to point to a specific link.

the code i gave can do exactly that :whistle:

not php but still simple

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...