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)
-   -   adding flash to the welcome.tpl (https://forum.x-cart.com/showthread.php?t=45156)

tbm 01-28-2009 08:12 AM

adding flash to the welcome.tpl
 
hi,

trying to figure out the best way to add a small flash movie to my front page. currently i'm using a static image embedded in the welcome.tpl file. here's the code:

Code:

{* $Id: welcome.tpl,v 1.28.2.1 2006/07/12 04:51:17 svowl Exp $ *}
{*DELETED HEADLINE AREA*}
{*
{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>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng.lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$config.Company.company_name}</h3>
{/if}
*}

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="{$ImagesDir}/front_page1.jpg"></td>
    <td class="frontpageRight">{$lng.txt_welcome}</td>
  </tr>
</table>

<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}


simply replacing the "{$ImagesDir}/front_page1.jpg" with "{$ImagesDir}/front_page1.swf" aint working, so what do i need to do?

i did check out this thread but i couldn't really make sense of it. any help would be greatly appreciated.

Yurij 01-29-2009 01:26 AM

Re: adding flash to the welcome.tpl
 
Quote:

Originally Posted by tbm
hi,

trying to figure out the best way to add a small flash movie to my front page. currently i'm using a static image embedded in the welcome.tpl file. here's the code:

Code:

{* $Id: welcome.tpl,v 1.28.2.1 2006/07/12 04:51:17 svowl Exp $ *}
{*DELETED HEADLINE AREA*}
{*
{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>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng.lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$config.Company.company_name}</h3>
{/if}
*}

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="{$ImagesDir}/front_page1.jpg"></td>
    <td class="frontpageRight">{$lng.txt_welcome}</td>
  </tr>
</table>

<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}


simply replacing the "{$ImagesDir}/front_page1.jpg" with "{$ImagesDir}/front_page1.swf" aint working, so what do i need to do?

i did check out this thread but i couldn't really make sense of it. any help would be greatly appreciated.


You can not insert a flash as a picture.
You need to use a special code to insert a flash.

PHP Code:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" 
WIDTH=264 HEIGHT=195
<
PARAM NAME=movie VALUE="{$ImagesDir}/front_page1.swf"
<
PARAM NAME=menu VALUE=false
<
PARAM NAME=quality VALUE=high
<
PARAM NAME=wmode VALUE=transparent
<
PARAM NAME=scale VALUE=noscale>
<
EMBED src={$ImagesDir}/front_page1.swf menu=false quality=high wmode=transparent scale=noscale WIDTH=264 HEIGHT=195 TYPE="application/x-shockwave-flash" 
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</
EMBED>
</
OBJECT


PhilJ 01-29-2009 02:38 AM

Re: adding flash to the welcome.tpl
 
Easy method here using SWFObject...
http://www.xcartmods.co.uk/adding-flash-x-cart-mods-pg-8.html

tbm 01-29-2009 02:55 AM

Re: adding flash to the welcome.tpl
 
thanks all, got this working!

nortonz 02-21-2009 03:01 PM

Re: adding flash to the welcome.tpl
 
This is an old thread, but here it goes anyway.

I added this line to my "txt_welcome.tpl" file, and got the Flash to play fine., but there is a White box around the animation, and I can't figure out where it is coming from. Hope someone can help.

This is the text I added.

Code:


<script type="text/javascript" src="{$SkinDir}/flash/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myId", "9.0.0", "{$SkinDir}/flashexpressInstall.swf/");
</script>
<div style="text-align:center;">
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700" height="120">
<param name="movie" value="{$SkinDir}/flash/Tv Tech Center_2.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="{$SkinDir}/flash/Tv Tech Center_2.swf" width="700" height="120">
<!--<![endif]-->
<div>
<h1>Please Install Flash</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>


The flash plays just fine, but I need to figure out where the White background is coming from to get rid of it. maybe "skin1.css"

Heres the link. http://www.tvtechcenter.com/xcart/home.php

Any help would be great. Thanks

Michael

beetlejuice 02-22-2009 03:54 AM

Re: adding flash to the welcome.tpl
 
Can't see any Flash files, did you remove it?

nortonz 02-22-2009 07:42 AM

Re: adding flash to the welcome.tpl
 
No its still there, I did add a line to the first part. The Flash file has a Transparent Background, and that was the cause of the problem. This is what the code looks like now.

Code:

<script type="text/javascript" src="{$SkinDir}/flash/swfobject.js"></script>
<script type="text/javascript"> swfobject.registerObject("myId", "9.0.0"), "{$SkinDir}/flashexpressInstall.swf/";
</script>
<div style="text-align:center;">   
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700" height="120">
<param name="movie" value="{$SkinDir}/flash/Tv Tech Center_2.swf" wmode="transparent" quality="high" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="{$SkinDir}/flash/Tv Tech Center_2.swf" wmode="transparent" quality="high" width="700" height="120"/>
<!--<![endif]-->
<div>
<h1>Please Install Flash</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>


The 2 lines in RED are what I changes. The white background is now gone in FF3, but still there in IE7/8. I guess IE has a problem this the "wmode=transparent" Anyway I'm still looking for a fix for it..

If you didn't see the Flash playing on the top of the screen What Browser are you using?

Michael

gb2world 02-22-2009 10:36 AM

Re: adding flash to the welcome.tpl
 
If you can't get it to work, you might consider using SWFObject method for embedding flash. I have used their method for transparancy, and it worked for me.

beetlejuice 02-22-2009 01:13 PM

Re: adding flash to the welcome.tpl
 
Or you could save yourself the grief and redo the .fla file with your background colour.

anandat 02-22-2009 07:46 PM

Re: adding flash to the welcome.tpl
 
It's possible to randomise the flash banners ? so on every page refresh it would show new banners ?

nortonz 02-22-2009 09:47 PM

Re: adding flash to the welcome.tpl
 
Thanks Beetlejuice, I think that is what I will do, can't seem to find any other fix for this.

Michael

connemara 11-06-2009 12:41 PM

Re: adding flash to the welcome.tpl
 
I downloaded Phil's recommended flash banner rotation script. Tested it out in the welcome.tpl, putting the code below {$lng.txt_welcome} . 2 Questions:

1 - Tthe files appear, but are not sized correctly even though I have defined the image sizes. Note if the files render strangely to use banner.swf and simply rename our own file. Will do that next.

2 - However, the client wants the flash file rotation within the welcome text area. Client has one flash file there already and has requested adding a second flash file, same dimensions to rotate in that same space. Adding {include file="banners/banners.tpl"} into the text doesn't work of course. Can it be done here, and how would it be added to that text variable? Or are we limited to having it only below the t{$lng.txt_welcome} in welcome.tpl?

Thank you!
Connie

anandat 11-06-2009 09:31 PM

Re: adding flash to the welcome.tpl
 
Quote:

Originally Posted by connemara
I downloaded Phil's recommended flash banner rotation script. Tested it out in the welcome.tpl, putting the code below {$lng.txt_welcome} . 2 Questions:

1 - Tthe files appear, but are not sized correctly even though I have defined the image sizes. Note if the files render strangely to use banner.swf and simply rename our own file. Will do that next.

2 - However, the client wants the flash file rotation within the welcome text area. Client has one flash file there already and has requested adding a second flash file, same dimensions to rotate in that same space. Adding {include file="banners/banners.tpl"} into the text doesn't work of course. Can it be done here, and how would it be added to that text variable? Or are we limited to having it only below the t{$lng.txt_welcome} in welcome.tpl?

Thank you!
Connie


For banner rotation I am using FREE service from http://www.openx.org/ad-server. For banner rotation they have some cool features like banner display as per country & number of banner display per visitor/ip etc & many more...

connemara 11-06-2009 09:49 PM

Re: adding flash to the welcome.tpl
 
Thanks for your reply but I have a script already.

My problem is how to add the include code into the welcome text instead of the welcome.tpl. The include code just comes up as plain text so obviously there needs to be more to it.
Connie

anandat 11-06-2009 10:07 PM

Re: adding flash to the welcome.tpl
 
Quote:

Originally Posted by connemara
Thanks for your reply but I have a script already.

My problem is how to add the include code into the welcome text instead of the welcome.tpl. The include code just comes up as plain text so obviously there needs to be more to it.
Connie

if your code contains the java script then you need put your code under {literal}CODE HERE.....{/literal} tags.

nortonz 11-07-2009 07:37 AM

Re: adding flash to the welcome.tpl
 
You can put the script in the Welcome.txt file in language file, I will have to go back and see if I can find the right way do do it in one of my backups. I don't use it anymore, but it took me quite a few tries to figure out the best way to do it..

Michael

edit

I could not find any thing in my back ups, so I'm guessing that I did it the way it shows in the 1st part of this thread in the welcome.tpl file.

I remember putting some graphics in the LBL_Welcome txt file in ACP under language, but not sure on putting Flash file there. this is the way I got a image file to work in the lbl_welcome_txt file.

Code:

img src='/yourlocation/skin1/images/payment_xxxx.gif' /img>

Not sure what you would have to change to get a flash file to work there, or if it even would..

Michael

connemara 11-07-2009 09:52 AM

Re: adding flash to the welcome.tpl
 
Hi Michael:
I took a look again, and what I was trying to do was include the banner.tpl inside the welcome text. Think that is not going to work, so I am trying the banner tpl code in directly but I think that needs modification since it is javascript.
Here is what I have done so far:
Literal tags don't seem to work
I simply added the js script, modified ("{$SkinDir} to skin1/ for path.
"Some" success: In Firefox I get the rotation, albeit the files are still distorted but nothing visible in IE. So, I think this is one step closer. I think the definitions for banner width, etc need to be done differently than below but I am not a programmer.

The assigned variables are not working so wonder how that can be achieved?

{*---------------------------------------*}
{* Set Banner Width *}
{assign var='bw' value='291'}
{*---------------------------------------*}
{* Set Banner Height *}
{assign var='bh' value='169'}
{*---------------------------------------*}
{* Set Minimum Flash Version *}
{assign var='fv' value='6'}
{*---------------------------------------*}
{* Set Background Colour *}
{assign var='bgc' value='#FFFFFF'}
{*---------------------------------------*}
<div id="banners"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Please click here to upgrade your Flash Player</a>. Please also turn on JavaScript.</div>
<script type="text/javascript">
var so = new SWFObject("{$SkinDir}/banners/banners.swf", "banners", "{$bw}", "{$bh}", "{$fv}", "{$bgc}");
so.addParam("menu", "false");
so.addParam("scale", "exactfit");
so.addParam("wmode", "transparent");
so.write("banners");
</script>


Connie

monarchmdm 05-15-2010 08:21 AM

Re: adding flash to the welcome.tpl
 
Probably its not showing up on ie as you have to put in the full path to files ... so for instance instead of "{$SkinDir}/banners/banners.swf" it would be "htp://www.yoururlhere.com/skin1/banners/banners.swf"

that should handle that problem...


All times are GMT -8. The time now is 11:32 PM.

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