Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

FREE Banner Rotator with Links

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-15-2010, 09:00 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default FREE Banner Rotator with Links

Hi Guys,

I found this very useful banner rotator online and thought the right thing to do would be to share it.

Useful things about this banner rotator:

- Your banners do not all have to be the same size as it allows you to specify a background and you can set the background to be the size of your largest banner.
- You can have as many banners as you like and you can specify where they link to.
- You can set the cycles of your rotator for as many times as you want or you can just set it continuous.
- You can set the rotator to randomize your banners or have them display in order.
- You can also set the time before the next banner must display.
- You can set it to pre-load all your banners or not.


**Hope someone would find this useful, you can display it anywhere on your site or even within a language variable.




Quote:
<script type="text/javascript">

var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

ultimateshow[0]=['http://www.yoursite.co.uk/skin1/images/Banners/custom.jpg', 'http://www.linkhere.com', '_new']
ultimateshow[1]=['image1.gif', 'http://www.linkhere.com', '_new']
ultimateshow[2]=['image2.gif', 'http://www.linkhere.com', '_new']
ultimateshow[3]=['image3.gif', 'http://www.linkhere.com', '_new']
ultimateshow[4]=['image4.gif', 'http://www.linkhere.com', '_new']
ultimateshow[5]=['image5.gif', 'http://www.linkhere.com', '_new']
ultimateshow[6]=['image6.gif', 'http://www.linkhere.com', '_new']
ultimateshow[7]=['image7.gif', 'http://www.linkhere.com', '_new']
ultimateshow[8]=['image8.gif', 'http://www.linkhere.com', '_new']
ultimateshow[9]=['image9.gif', 'http://www.linkhere.com', '_new']
ultimateshow[10]=['image10.gif', 'http://www.linkhere.com', '_new']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="700px" //set to width of LARGEST image in your slideshow
var slideheight="96px" //set to height of LARGEST iamge in your slideshow
var slidecycles="3" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='black'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=3000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById
var curcycle=0

if (preloadimages=="yes"){
for (i=0;i<ultimateshow.length;i++){
var cacheimage=new Image()
cacheimage.src=ultimateshow[i][0]
}
}

var currentslide=0

function randomize(targetarray){
ultimateshowCopy=new Array()
var the_one
var z=0
while (z<targetarray.length){
the_one=Math.floor(Math.random()*targetarray.lengt h)
if (targetarray[the_one]!="_selected!"){
ultimateshowCopy[z]=targetarray[the_one]
targetarray[the_one]="_selected!"
z++
}
}
}

if (randomorder=="yes")
randomize(ultimateshow)
else
ultimateshowCopy=ultimateshow

function rotateimages(){
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<center>'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'" target="'+ultimateshowCopy[currentslide][2]+'">'
ultcontainer+='<img src="'+ultimateshowCopy[currentslide][0]+'" border="0">'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='</a>'
ultcontainer+='</center>'
if (ie||dom)
crossrotateobj.innerHTML=ultcontainer
if (currentslide==ultimateshow.length-1) currentslide=0
else currentslide++
if (curcycle==parseInt(slidecycles) && currentslide==0)
return
setTimeout("rotateimages()",slidedelay)
}

if (ie||dom)
document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+' ; background-color:'+slidebgcolor+'"></div>')

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
rotateimages()
}

if (ie||dom)
window.onload=start_slider

</script>
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote

The following user thanks Dan.roh for this useful post:
ScrapbookSupplies (02-01-2011)
  #2  
Old 02-15-2010, 12:35 PM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default Re: FREE Banner Rotator with Links

Nice:
Yea I use to use this script, think it was on Dynamic drive, when I was on asp server.

It use to work well..
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #3  
Old 02-15-2010, 01:02 PM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default Re: FREE Banner Rotator with Links

You have no idea how long I have searched online to find it! All I was really interested in was the clickable links because you can have all your manufacturer logo's rotate in a banner with links to that manufacturers products and it does not slow your site down either not even if the image pre load is activated

Quote:
Originally Posted by gizmo
Nice:
Yea I use to use this script, think it was on Dynamic drive, when I was on asp server.

It use to work well..
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #4  
Old 02-16-2010, 08:31 AM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default Re: FREE Banner Rotator with Links

Lol..........Glad you got what you wanted, BTW was it the one from Dynamicdrive?
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #5  
Old 02-16-2010, 10:10 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default Re: FREE Banner Rotator with Links

Almost sure it was, but it was freeware and that's ok with me...lol

Still not sure where I will use it on my site, done some testing with it and must say no problems there

Quote:
Originally Posted by gizmo
Lol..........Glad you got what you wanted, BTW was it the one from Dynamicdrive?
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #6  
Old 02-19-2010, 02:26 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Default Re: FREE Banner Rotator with Links

I'm looking for banner rotation script for affiliate banners, to limit the number of banners visible to the customers at any one time to 2.
I've tried this script for rotating those affiliate banners but it doesn't show.

Has anyone tried it successfully with affiliate links?
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
Reply With Quote
  #7  
Old 02-19-2010, 08:05 AM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default Re: FREE Banner Rotator with Links

Quote:
Originally Posted by just_me
I'm looking for banner rotation script for affiliate banners, to limit the number of banners visible to the customers at any one time to 2.
I've tried this script for rotating those affiliate banners but it doesn't show.

Has anyone tried it successfully with affiliate links?


Have not tried it for what you are trying to do, but.
I would use something like ad http://www.adpeeps.com/

I have always used it, It has lots of functions for what you need, takes a while to get use to but works very well (Yep it's paid for) But well worth the money.

Another one I am just getting use to is this > http://www.flashxml.net/banner-rotator.html


And this one has different possibilities, The only downfall is that it's caching images, so any changes to your images and the user has to clear there cache for new changes to take place, but the Author, has fixed this for my file.

I hope this helps you a little, your best option is adpeeps, Give it a try, there is a trial...
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #8  
Old 10-09-2010, 02:38 AM
 
bellabeachwear bellabeachwear is offline
 

Member
  
Join Date: Dec 2007
Posts: 10
 

Default Re: FREE Banner Rotator with Links

Hi,

I tried to use the script on my welcome.tpl page and did not work. Any ideas why?
__________________
Bella Beachwear
http://www.bellabeachwear.com
sales@bellabeachwear.com

Using X-Cart Gold version 4.19.0
Reply With Quote
  #9  
Old 10-09-2010, 04:15 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default Re: FREE Banner Rotator with Links

Quote:
Originally Posted by bellabeachwear
Hi,

I tried to use the script on my welcome.tpl page and did not work. Any ideas why?

Which one did you try? The one I suggested?
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #10  
Old 10-09-2010, 04:40 PM
 
bellabeachwear bellabeachwear is offline
 

Member
  
Join Date: Dec 2007
Posts: 10
 

Default Re: FREE Banner Rotator with Links

This is the code I entered in my welcome.tpl and it failed...

<script type="text/javascript">

var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

ultimateshow[0]=['http://www.bellabeachwear.com/skin1/images/customer_images/welcome-slides-1.jpg', 'http://www.bellabeachwear.com/offers.php?mode=offer&offerid=11', '_self']
ultimateshow[1]=['http://www.bellabeachwear.com/skin1/images/customer_images/welcome-slides-2.jpg', 'http://www.bellabeachwear.com/pages.php?pageid=24', '_self']
ultimateshow[1]=['http://www.bellabeachwear.com/skin1/images/customer_images/welcome-slides-3.jpg', 'http://www.bellabeachwear.com/all-brazilian-bikinis-thong-and-micro-bikinis/', '_new']
//ultimateshow[3]=['image3.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[4]=['image4.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[5]=['image5.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[6]=['image6.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[7]=['image7.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[8]=['image8.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[9]=['image9.gif', 'http://www.linkhere.com', '_new']
//ultimateshow[10]=['image10.gif', 'http://www.linkhere.com', '_new']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="550px" //set to width of LARGEST image in your slideshow
var slideheight="275px" //set to height of LARGEST iamge in your slideshow
var slidecycles="continuos" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="yes" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='white'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=3000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById
var curcycle=0

if (preloadimages=="yes"){
for (i=0;i<ultimateshow.length;i++){
var cacheimage=new Image()
cacheimage.src=ultimateshow[i][0]
}
}

var currentslide=0

function randomize(targetarray){
ultimateshowCopy=new Array()
var the_one
var z=0
while (z<targetarray.length){
the_one=Math.floor(Math.random()*targetarray.lengt h)
if (targetarray[the_one]!="_selected!"){
ultimateshowCopy[z]=targetarray[the_one]
targetarray[the_one]="_selected!"
z++
}
}
}

if (randomorder=="yes")
randomize(ultimateshow)
else
ultimateshowCopy=ultimateshow

function rotateimages(){
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<center>'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'" target="'+ultimateshowCopy[currentslide][2]+'">'
ultcontainer+='<img src="'+ultimateshowCopy[currentslide][0]+'" border="0">'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='</a>'
ultcontainer+='</center>'
if (ie||dom)
crossrotateobj.innerHTML=ultcontainer
if (currentslide==ultimateshow.length-1) currentslide=0
else currentslide++
if (curcycle==parseInt(slidecycles) && currentslide==0)
return
setTimeout("rotateimages()",slidedelay)
}

if (ie||dom)
document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+' ; background-color:'+slidebgcolor+'"></div>')

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
rotateimages()
}

if (ie||dom)
window.onload=start_slider

</script>
__________________
Bella Beachwear
http://www.bellabeachwear.com
sales@bellabeachwear.com

Using X-Cart Gold version 4.19.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:00 PM.

   

 
X-Cart forums © 2001-2020