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

Trouble with Random Image Generator in head.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-27-2011, 06:55 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Trouble with Random Image Generator in head.tpl

After upgrading to 4.4.2 from 4.3.2 I can't get my Image Generator to work.

Anyone have a clue here? I didn't have to put anything in the meta.tpl under 4.3.2 to get this to work before.

The original source of the code is from http://www.web-source.net/web_development/random_images.htm

Original head.tpl
Code:
{* $Id: head.tpl,v 1.20 2009/06/05 11:46:27 joy Exp $ vim: set ts=2 sw=2 sts=2 et: *} <div class="line1"> {include file="customer/tabs.tpl"} <div class="logo1"> <center> {literal} <script type="text/javascript" language="JavaScript"> <!-- Copyright 2002 Bontrager Connection, LLC // // Type the number of images you are rotating. NumberOfImagesToRotate = 5; // Specify the first and last part of the image tag. FirstPart = '<a href="home.php"><img src="skin1/flash/banner'; LastPart = '.jpg" height="192" width="1280" border="0"></a>'; function printImage() { var r = Math.ceil(Math.random() * NumberOfImagesToRotate); document.write(FirstPart + r + LastPart); } //--> </script> <script type="text/javascript" language="JavaScript"><!-- printImage(); //--></script> {/literal}<br /> </div> <script src="{$SkinDir}/hr.js" type="text/javascript"></script> {*<div class="logo"> <div class="logo1"> <a onclick="javascript: $('#hr_menu').hide();" href="{$catalogs.customer}/home.php"><img src="{$ImagesDir}/custom/company_logo.gif" alt="" /></a> <div class="logo2"><img src="{$ImagesDir}/spacer.gif" alt="" /></div> </div> </div>*} {*include file="customer/phones.tpl"*} </div> <div class="line2"> {if $main ne "fast_lane_checkout"} {include file="customer/language_selector.tpl"} {else} {include file="modules/Fast_Lane_Checkout/head.tpl"} {/if} </div> {if $categories_menu_list} <div class="top-categories"> <div class="hor-categories"> <ul id="hr_list"> {foreach from=$categories_menu_list item=c} <li><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category}</a></li> {/foreach} </ul> </div> <div class="more-categories" onmouseover="javascript: hrMenuShow('cat_list');" onmouseout="javascript: hrMenuHide('cat_list');"> <a href="javascript:void(0);"><img id="menu_more" src="{$ImagesDir}/custom/menu_more.gif" alt="" /></a> <ul id="hr_menu" style="display: none;"> <li>&nbsp;</li> </ul> </div> </div> {/if} {include file="customer/noscript.tpl"}

I do realize that " FirstPart = '<a href="home.php"><img src="skin1/flash/banner'; " needs to be changed to <img src="skin/common_files/flash/banner';

I also tried {$SkinDir}, but no go. I tried it in the meta.tpl as well, with and w/o the literal's

Thanks
Mike
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 03-29-2011, 08:05 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Trouble with Random Image Generator in head.tpl

Nevermind, it started working. I have no idea.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:29 PM.

   

 
X-Cart forums © 2001-2020