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
  #11  
Old 10-10-2010, 12:03 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

For some reason the code will not work if you have any other Java script on the same page as they seem to conflict with each other.

Secondly, what I did was to create a language variable and then place the code in the variable and then just call the variable where you want the banner rotator to display

Create a variable lbl_banner_rotator

Place the below code where you want the banner rotator to display

{$lng.lbl_banner_rotator}


Also ensure that your image path ways are specified correctly
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote

The following user thanks Dan.roh for this useful post:
bellabeachwear (10-10-2010)
  #12  
Old 10-10-2010, 02:35 AM
 
bellabeachwear bellabeachwear is offline
 

Member
  
Join Date: Dec 2007
Posts: 10
 

Default Re: FREE Banner Rotator with Links

I created a language variable and added the {$lng.lbl_banner_rotator} to my welcome.tpl. it shows on my page source, but does not work. may be because i have other JS on the same page...

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

Using X-Cart Gold version 4.19.0
Reply With Quote
  #13  
Old 10-10-2010, 02:46 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

Try to put {$lng.lbl_banner_rotator} on another page just to check if it works, even if you have to create a temp static page just for testing purposes. If it does then it confirms that you had conflict with other JS. If it still not working then your issue lies elsewhere
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote

The following 2 users thank Dan.roh for this useful post:
bellabeachwear (10-10-2010), john55 (03-17-2013)
  #14  
Old 10-10-2010, 02:52 AM
 
bellabeachwear bellabeachwear is offline
 

Member
  
Join Date: Dec 2007
Posts: 10
 

Default Re: FREE Banner Rotator with Links

I tried into another static page and still does not work. I added a text label before just to see if it shows on the static page and it does show, but it does not show the images after the text...
__________________
Bella Beachwear
http://www.bellabeachwear.com
sales@bellabeachwear.com

Using X-Cart Gold version 4.19.0
Reply With Quote
  #15  
Old 10-10-2010, 08:02 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

Try to put the full code not {$lng.lbl_banner_rotator} in a static page and if it still does not work then it is definitely a conflict with JS
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #16  
Old 10-11-2010, 05:54 AM
 
bellabeachwear bellabeachwear is offline
 

Member
  
Join Date: Dec 2007
Posts: 10
 

Default Re: FREE Banner Rotator with Links

Quote:
Originally Posted by Dan.roh
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.
Interesting, the whole reason the code was not working was a typo in the word "length". there was a space between the t and the h...

.

Now it works.

BTW. MUST Install in the welcome.tpl or any other tpl file. not in the language section
__________________
Bella Beachwear
http://www.bellabeachwear.com
sales@bellabeachwear.com

Using X-Cart Gold version 4.19.0
Reply With Quote
  #17  
Old 10-18-2010, 09:25 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

Well spotted! I have tried to edit my post but the WYSIWYG editor in this forum displays it without the space. Not sure I understand why this space appears.

A forum moderator should maybe look into this?
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #18  
Old 10-26-2010, 11:48 AM
 
MAPerformance MAPerformance is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 145
 

Default Re: FREE Banner Rotator with Links

Got this working using your language variable idea, and removing the space in "length"

Thanks for this!
__________________
www.maperformance.com

X-Cart Version: 4.4.3 Gold
Reply With Quote
  #19  
Old 10-26-2010, 12:13 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

Glad you are sorted! Like your site by the way, looking good!

BellaBeachwear spotted the space in "length", although I did try and edit my post to fix it but the WYSIWYG in this forum is not having it for some reason?

Regarding language variables, I always try and test most code in them first because it makes it so much easier to modify things. You will notice that they are handy for allot of things e.g. if you look on my site you will see on my left and right hand side columns I have a string of banners. These banners are placed in 2 language variables, one named lbl_left_column and lbl_right_column. This makes life so much easier if you wish to change your banners because instead of trying to remember which tpl to edit you just keep record of all your language variables and BOB's YOUR UNCLE!
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #20  
Old 11-10-2010, 08:57 AM
 
cmarrese cmarrese is offline
 

Newbie
  
Join Date: Aug 2008
Posts: 7
 

Default Re: FREE Banner Rotator with Links

Dan,

I tried the code (fixing the space in length issue) and placed it on a static page to get it working before I add it to my welcom page, but I consisatntly get a syntax error in the same spot.

In the code I have (as per youtr post):
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++
}
}
}

But in the source code when the page loads all it has is:
if (preloadimages=="yes")}
var currentslide=0
function randomize(targetarray)
}
}
Which the creates a syntax error on floating "}". I have tried retyping these sections add, subtracting, etc. But still nothing is showing up in the source code.

Have you seen anything like this before or have any ideas?

Thanks
Chris
__________________
Version 4.1.9
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 02:07 AM.

   

 
X-Cart forums © 2001-2020