X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Trouble with flash files in head.tpl (https://forum.x-cart.com/showthread.php?t=43328)

beetlejuice 10-30-2008 12:34 AM

Trouble with flash files in head.tpl
 
Hi,

I'm waving the white flag, I surrender, been at this problem on and off for a couple of weeks and I still can't solve it.

I have a client who requires a flash file to run in the header of his site. It's the simplest two image fade in fade out you can do in flash. When a user clicks around the site, the whole page refreshes, the header, menus etc all refresh. If I remover the flash file from the head.tpl, the "refreshing" problem disappears also.

I've used a couple of third party programs initially to create the file and thought it may have been the way the code was generated, so I became a quick learner of Flash CS3 and created my own file. The same problem occurred so it wasn't dodgy code.

If I put the flash file in the welcome.tpl there is also no page refreshing issue. Just when it's in the head.tpl.

Has anyone struck the same issue and if so what's the damn fix :D?

Thanks

JWait 10-30-2008 04:01 AM

Re: Trouble with flash files in head.tpl
 
I don't use flash, but here is x-cart's solution...
Code:

{*** Remove this part of code if you want to replace a flash movie with an image ***
        <td valign="top">
<object type="application/x-shockwave-flash" data="{$ImagesDir}/custom/flash_logo.swf" width="341" height="206" id="flash_logo" align="top">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{$ImagesDir}/custom/flash_logo.swf" />
<param name="menu" value="false" />
<param name="loop" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="not_home_page={if $main eq "catalog" && $current_category.category eq ""}0{else}1{/if}&amp;final_image={#FinalImage#}&amp;company_name_path={$ImagesDir}/custom/company_name.swf&amp;home_path={$current_location}/customer/home.php" />
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<param name="swLiveConnect" value="true" />
</object>
        </td>
*** Remove this part of code if you want to replace a flash movie with an image ***}


It goes in head.tpl in place of where the logo is normally displayed.

beetlejuice 10-30-2008 11:14 AM

Re: Trouble with flash files in head.tpl
 
Thanks JW, I'll take a look at that when I'm back in the office later today.

gb2world 10-30-2008 11:53 AM

Re: Trouble with flash files in head.tpl
 
There are advantages to using swfobject for embedding flash, you might be interested in taking a look.

cbostard 11-13-2008 06:40 PM

Re: Trouble with flash files in head.tpl
 
I was trying to do the same thing and got it to work ok but I only need to center the flash in the space, but what I did was took the code posted above(reguards to above ) and inserted it into /customer/main/welcome.tpl you might be able to copy and paste the entire code as provided below into this folder but 1st make a backup copy
template will look like this:

Code:

{* $Id: welcome.tpl,v 1.28 2006/04/12 09:54:19 svowl Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'":"'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_name} </h3>
{else}
<h3>
<object type="application/x-shockwave-flash" src="{$ImagesDir}/custom/flash_logo.swf" width="500" height="250" id="flash_logo" align="bottom">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{$ImagesDir}/custom/flash_logo.swf" />
<param name="menu" value="false" />
<param name="loop" value="true" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="not_home_page={if $main eq "catalog" && $current_category.category eq ""}0{else}1{/if}&final_image={#FinalImage#}&company_name_path={$ImagesDir}/custom/company_name.swf&home_path={$current_location}/customer/home.php" />
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<param name="swLiveConnect" value="true" />
</object>
{/if}
{* $Id: welcome.tpl,v 1.28.2.3 2008/07/15 12:07:40 ferz Exp $ *}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<br />
{include file="customer/main/featured.tpl" f_products=$f_products}



next what you need to do is create a flash (.swf) file. to make it simple name it " flash_logo" and place into /xcart/skin1/images/custom

so far it works on my testing site witch is a full site with a few mods installed and there are no errors on page. once I figure out how to center it. ill post it on site. IM sure it is just adding a <cell padding > type code


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

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