Jump to content
Sign in to follow this  
blueline

Pass osCommerce session IDs into Flash

Recommended Posts

This is the official support thread for the tutorial provided by Chris Sullivan regarding passing osC varialbes (such as session ids) into flash for proper navigation, etc.

 

Hope you find it useful.

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

This is great. Nice to know someone know how to pass session id variables. I was wondering if you could help me on on passing the variables over to a phpbb forum? I have it so it adds a customer to the customer table of the phpbb when one opens an account in the shop.

Share this post


Link to post
Share on other sites

So does anyone else find this useful?

 

If I don't get any feedback I assume that no one is interested, yet I am getting TONS of emails from people asking how to do this...

 

Any comments?


Chris Sullivan

Share this post


Link to post
Share on other sites

Maybe you could explain in short what this contribution can do? It's not really clear to me :)

Share this post


Link to post
Share on other sites

Ok. Many people would like to use flash throughout their site, whether it is in featured products or navigation headers. Flash has many uses, and osC is the perfect place to integrate these capabilities.

 

I get TONS of emails everyday asking how to incorporate flash into osCommerce. Once this has been accomplished YOU WILL RUN INTO SESSION PROBLEMS. For example, let's say you have a header that has navigation buttons for the site. When the user clicks on a button in the header all of his cart contents will disappear. How come? Well, flash doesn't have osCommerce session IDs in the links, so when the user follows the link from flash, the session ID is dropped and so is all the info for that user (shopping cart contents, login info, etc).

 

I have included a .php file and a .fla and a .swf file so that anyone who is interested in flash can easily fix this problem. Anyone who would like to REALLY CUSTOMIZE their site can do so with flash, and now they'll do it properly.

 

I hope this helps. If you have any questions please post them and I'll do my best to get back to you.

 

For an example of a flash header (with a lot more variables then just session IDs) check out a demo I set up at: http://www.eclyptiq.com/flashosC

 

Thanks,

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

Hi blueline, thanks for putting up this contribution i found it very use-full. I just have one qeustion if for example i had amination on my flash header that i only wonted to play when the user first enters the site (like an intro) how would i make it not loop over every time a link is clicked. I only ask because the flash header always reloads when the page refresses or a link is clicked on.

any help would be much apresheated.

thanks.

Share this post


Link to post
Share on other sites

In order for that to work you would have to modify the code that loads the flash movie, as well as add a conditional statement in the actionscript (flash).

 

Basically, set some variable (once a session has started) and pass that variable along to flash. Another conditional statement will go in the actionscript that checks for the variable. If the variable is passed, set the script to

stop();

otherwise let the code play the movie_clip or frame set.

 

HTH

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

Chris, beautiful coding - nice and clean. I think your contribution is great. I am still in the early days of implementation and have not had much chance to work with swf. But I am sure I will use your contribution - if i get a payment for a site - i will put u at the top of the list for a paypal thankyou

 

All the best!

Share this post


Link to post
Share on other sites

Well thank you very much. Glad I could help. If you have any questions...please post them here.

 

Thanks.

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

Chris

 

Interesting reading. Could you please check this prototype site for the condition you are talking about. http://www.clubshack.com/adam/

 

I hope it is working correctly, as I have used a great deal of Flash to create my menus.

 

Thanks

ofWES

Share this post


Link to post
Share on other sites

well , seems great , but i can't get it to work .

 

I use STS contrib and the flask menu is located in a box i created . I used the same as u did in your Header.php in my box file but it doesn't work , no osCsid parsed into my flash movie .

 

Do you think it's because of the STS contrib ??

 

By the way i found another way to do it .

 

instead of using the way u did on the header.php to load the flash movie i did like this :

<object type="application/x-shockwave-flash" data="menu.swf?id=<?php echo tep_session_id(); ?>"   
width="770" height="40">
<param name="scale" value="exactfit" /> 
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="movie"value="menu.swf?id=<?php echo tep_session_id(); ?>" /> 
<a href=http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash  target="blank"><img src="images/icons/noflash.gif" width="88" height="31" vspace="5" hspace="50" alt="install flash player plugin"/></a>
  </object>

 

as u can see i use the " tep_session_id() " function to get the current id number and send it to flash .

 

in my flash movie i get it using this :

var osCsid = _root.id;

 

and then i use the same code on button as you .

 

So i don't need no more the " flash_variables.php " file .

 

it works just great , but i wonder if it's really a good way and if i'll not have some trouble using this way .

 

 

what do you think ?

Share this post


Link to post
Share on other sites

If the other way works for you, great. There are many ways to do this. There are some benefits to using the flash_variables.php file, but again, you don't have to.

 

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

Hi

I was wandering if anyone could help me?

 

I have the following code to get my flashmovie working but I need to add a hyperlink to it.

Is that possible?

 

<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="617" height="100" align="right">
<param name="movie" value="http://store.247.is/catalog/images/bordibud.swf">
<param name="quality" value="High">
<embed src="http://store.247.is/catalog/images/bordibud.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="150" height="100" quality="High"></object>

Share this post


Link to post
Share on other sites

I wanted to use my movie to be a hyperlink.

 

This was because I am new to work with flash.

I did not find any way to do this with html.

So just had to learn more about flash and what do you know

I finally figured this out.

But thanks for answering

Share this post


Link to post
Share on other sites

hi first i would just like to say how cool this contribtion is. mabe some can help with a little problem im having.

 

im using the sts template contribtion and for some reason i cant get it to work with this contribution. im getting this error on the top of the page

"Content-type: text/html X-Powered-By: PHP/4.3.4 Set-Cookie: osCsid=; path=/catalog/; domain=http://localhost Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache"

 

can somone please tell me if this mean anything to them.

Share this post


Link to post
Share on other sites

Hi and Thanks for the Excelent contrib

 

Definatly one of the top 5 best pratical contribs :thumbsup: :thumbsup:

 

this with sts has made me a Brill site but i have one problem every time i click on the flash header bar it generates a new session id

 

Ie : catalog/login.php?osCsid=ced175c03a5e8bf9127db4ad98ea85c7

 

Click again on another button or the same and sesion id changes

 

osCsid=34843104cd54e87498ec10ef72f3a3eb

 

this putting me at square 1 again

 

Thanks in advance for any help you can give!! :D :D

Share this post


Link to post
Share on other sites

hodee chris!

 

thank you for this contribution. but i have a problem to open the .fla file. it doesn't work with flash 4 or MX. i always get the error-message: unexpected file format. and i can't import the .swf file in flash 4/MX to by-pass the problem.

with which flash-version did you create this file?

or is there a chance to public the actionscript in this thread?

 

greetz, trebis.


log in - log out, but never go home!

Share this post


Link to post
Share on other sites

I actually published it in both MX and MX 2004. You ought to be able to see that various publications in the various folders.

 

HTH,

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites
You ought to be able to see that various publications in the various folders.

 

HTH,

-Chris

 

you are right and i am. but altogether there are only two flash files in the folders. one .swf and one .fla, and both don't work with 4/MX.

am i using an old version?

 

thanks for your help, trebis.


log in - log out, but never go home!

Share this post


Link to post
Share on other sites

but now i have another problem:

 

the flash header is at its right place, but when i press any button on it i get the error-message:

 

Warning: session_start(): The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9 in C:\xampp\htdocs\catalog\includes\functions\sessions.php on line 67

 

at the head of my shop.

 

line 67 in sessions.php is:

 

return session_start();

 

what shall i do?

 

trebis.


log in - log out, but never go home!

Share this post


Link to post
Share on other sites

Hi Chris

 

Do you have any sugestions for the problem i'm having with your contrib, if you need any more info i will gladly give you it..

 

 

Many Thanks

 

 

 

Marc Turner :thumbsup: :thumbsup: :thumbsup:

Share this post


Link to post
Share on other sites

hi chris!

 

you know:

we are ready to use but worse to take.

keep fun with your next contrib..

 

love,

trebis.


log in - log out, but never go home!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×