X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   FREE Banner Rotator with Links (https://forum.x-cart.com/showthread.php?t=52351)

Dan.roh 11-10-2010 10:22 AM

Re: FREE Banner Rotator with Links
 
Chris

I'm afraid this is new to me. I have no idea how to sort this issue. Have you tried placing the code direct into the tpl where you want the banner to display without making use of a language variable?

cmarrese 11-10-2010 11:40 AM

Re: FREE Banner Rotator with Links
 
I figured it out, you need to wrap {literal}{/literal} around any code that includes braces - I did that with all the code within {'s and the banner worked perfectly in my static pages.

I cant' get it to work on my welcome page yet because of some conflict with other javascript on the page - but I'm trying to work that out.

Cheers,
Chris

cmarrese 11-10-2010 12:40 PM

Re: FREE Banner Rotator with Links
 
I resolved the conflicts - it relates to the window.onload function - you can only have one of these. I found the following code that works perfectly in stacking the onloads into a single command. If you replace all your onloads on a page with this function it works perfectly with multiple JS:

CODE

function addOnloadEvent(fnc){
if ( typeof window.addEventListener != "undefined" )
window.addEventListener( "load", fnc, false );
else if ( typeof window.attachEvent != "undefined" ) {
window.attachEvent( "onload", fnc );
}
else {
if ( window.onload != null ) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
window[fnc]();
};
}
else
window.onload = fnc;
}
}


Example: CODE

addOnloadEvent(myFunctionName);

// Or to pass arguments

addOnloadEvent(function(){ myFunctionName('myArgument') });

Everten Online 12-24-2010 02:21 AM

Re: FREE Banner Rotator with Links
 
Hey everybody,

I have this useful little program working on my site at the moment.... www.everten.com.au . And it works but seems to load really really slowly. Anybody know if this is normal or there is something wrong.

Cheers

Johny1 01-09-2011 01:53 PM

Re: FREE Banner Rotator with Links
 
If anyone is still having problems with this, I fixed mine due to the gap between the "t" and the "h" in the word "length" in the middle of the script!

Mat2012 12-26-2011 05:27 PM

Re: FREE Banner Rotator with Links
 
I am realy desperate for this banner, I copied the code into my welcome.tpl and I deleted the space that caused the issue, but it did not work, I got:

Error: Smarty error: [in customer/main/welcome.tpl line 48]: syntax error: unrecognized tag 'for' (Smarty_Compiler.class.php, line 590) in /home/easyqura/public_html/include/lib/smarty/Smarty.class.php on line 1093

Anyone can help? please?

cflsystems 12-26-2011 06:56 PM

Re: FREE Banner Rotator with Links
 
YOu have to surround the script code with {litral} code here {/literal}

Mat2012 12-27-2011 01:02 AM

Re: FREE Banner Rotator with Links
 
Thanks for the reply Steve, but it did not work, same error again, any idea?

If you are aware of a working up to date rotating banner I would realy appreciate if you give me a link, thanks!

cflsystems 12-27-2011 06:27 AM

Re: FREE Banner Rotator with Links
 
Then you are doing somehting wrong.
Tons of image rotators - just google "jquery image rotator" for example and you will get a lot of them

JoeS 12-27-2011 08:32 AM

Re: FREE Banner Rotator with Links
 
I was told that the smarty code needs modification to get it to work. Thanks


All times are GMT -8. The time now is 10:04 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.