Page 1 of 1

ways to use banners with cache truned on

Posted: Sun Nov 23, 2008 4:22 am
by JeremyBASS
Ok... the first is this... using an iframe... here is one example in here


One problem.... when I did this straight up... the page just loaded in there... in the iframe

Not to worries... try this (must have a frame work... in this example it's jQuery)


$(document).ready(function(){
$("[href*='index.php?mact=Banners']").attr('target','_blank');
});

Basically the idea is to target the banners... add the target path and bam all is better... that is client side fix... and in the page you'll have to have something like this for the banner content...

Code: Select all

<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt-->{literal} <!-- body {margin:0;padding:0;text-decoration:none;} a img {border:0;text-decoration:none;} -->
<__script__ src="Scripts/jquery-1.2.6.min.js" type="text/javascript"></__script>
<__script__ src="Scripts/Master.1.0.0.11.08.js" type="text/javascript"></__script>
{/literal} {Banners category="SkyBOX"}
now This is the first way... I'll post the others in a bit...

hope this helps
jeremyBass

note: this method is the one I'm using in me sandbox... CorbensProducts.com

Re: ways to use banners with cache truned on

Posted: Sun Nov 30, 2008 5:40 am
by JeremyBASS
I guess I lost the old post I just made...

I had to make some changes to my site that forced a different way to do the same thing...

in the page it looks like this

Code: Select all

<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt-->
{global_content name='BannerCSS'}
{Banners category="COMwebads"}
{flush}
{BannerFix}
the global_content 'BannerCSS'

Code: Select all

     {literal}
          <style type="text/css" media="screen">
               *{margin:0;padding:0;border:0px;text-decoration:none;display:none;}
          </style>
     {/literal} 
now that was done to speed up the loading of the core page... god know if you have more than two on there it started to drag.. I was testing with 5.. so with the

the UDT {flush}
is just

Code: Select all

     
     flush();
     


which pushes the code out so the rest of the core page finishes up loading while the iframes continue on

the UDT {BannerFix}

Code: Select all

echo "
<__script__ src=\"Scripts/jquery-1.2.6.min.js\" type=\"text/javascript\" charset=\"utf-8\"></__script>
<__script__ type=\"text/javascript\">
$(document).ready(function(){

     $(\"[href*='index.php?mact=Banners']\").attr('href','http://websales.corbensproducts.biz/');

     $(\"*\").not('style').each(function() {
                $(this).css('display', 'block');
     });

     $(\"a\").click(function(){
          window.open( $(this).attr('href') );
          return false;
     });
});
</__script>
";
now most of my sites have a jQuery framework but this can be done in may different longer ways.... this is just the shortest...

now the draw back is that you have to pick the location... you don't get the hits counted... but it works and you don't have to loose your cache to get it to work...

note: this method is the one I'm using in my sandbox... CorbensProducts.com

hope this help
jeremyBass