Topic: Simpleviewer w/ simple e-commerce customization

big_smile  Hey just wanted to share my customization of simpleviewer.
=========================================

Basically my mod is an xml menu initiated by a "buy products" button
in my simple viewer gallery. The button can be me made visible/invisble via an xml variable on an image by image basis. So if I have portfolio items that I want to sell prints of for example, I can turn on the button and then set xml options accordingly and likewise turn off the button for Portfolio items I do not have available for sale at my site. The product options are then forwarded to my stores for further order processing.

The version on my site works well as is, but I have a more complex version I have created that can be implemented/ modified to work with mal's ecommerce.

To see it in action go to my illustration portfolio at:

http://www.halegrafx.com

some items will have the purchase feature... some will not...

-Halegrafx 8)

Re: Simpleviewer w/ simple e-commerce customization

That's very cool. Would you mind sharing how you did it?

Re: Simpleviewer w/ simple e-commerce customization

I too would be interested in how this was done -- that is if this was done without purchasing the source and you are willing to share.

Thanks.

Charlie

Re: Simpleviewer w/ simple e-commerce customization

I am continually updating my site and would like to add a section were I put al my useful code snippets from flash etc. I will post my code inserts there at some point without compromising the actual simpleviewer source which requires purchase.

-HaleGrafx wink

Re: Simpleviewer w/ simple e-commerce customization

Hey HaleGrafx ,
Have you played around with incorporating Paypal with SV?
Richard

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Simpleviewer w/ simple e-commerce customization

I haven't tried a marriage between Paypal & SV, however in its basic format it wouldn't bee too hard. In a standard Paypal buy button the price is preset so you would simply store the buy link in your XML and have that linked to a buy button in the gallery. Now in a more complex Paypal shopping cart where people can set sizes, options etc, I would need to set up a fake shopping cart to see all the different variables then I would need to pass them and then make a plugin so simple viewer could pass them through the same way a shopping cart button would. This is basically what I did with Mal's E-commerce so that you can purchase through simpleviewer and pay using anyone of their payment systems which include Paypal. With mal's you can also set up complex shipping options like UPS, postal etc very easily.

-Halegrafx

Re: Simpleviewer w/ simple e-commerce customization

pretty cool...

You could get some idea from fotoplayer.com which has a similar concept

[url]http://www.photographybykevin.net[/url]

Simple Viewer FAQ By Kevin
[url]http://knguyentu.com/wordpress/photography-by-kevin/simpleviewer-flash-photo-gallery/[/url]

Re: Simpleviewer w/ simple e-commerce customization

Ive just had a good look around your site and the menu system you have is great, if thats a first release I cant wait to see what else you may com up with.

Without speaking out of turn I think you could make a few pennies from this and would possibly be best done with Felix of course, I am desperate for something like this and would appreciate any shout out when this may happen, I want 5 fixed prices for sizes of each photo and will pass straight to paypal, I wish I was more techy but just good at the photography...

C'mon halegrafx pleeeeeeeease. I would be willin g to pay for this don't forget...

Re: Simpleviewer w/ simple e-commerce customization

.
.
.

C'mon halegrafx pleeeeeeeease. I would be willing to pay for this don't forget..

.
.
Me too! 

C'mon, this would be great!

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Simpleviewer w/ simple e-commerce customization

i use picasa to create gallery

1: modify  imageNode.xml like this:
<image>

<filename><%itemName%></filename>

    <caption><![CDATA[<font size="16"><%itemCaption%><br><A href="http://www.tancsicscipo.hu/basket.php?s=<%itemName%>&c=<%itemCaption%>" target="basket"><U>Buy</U></A></font>]]></caption>

</image>

2: this makes a link into caption. pass 2 $_GET parametert to basket.php: ietm name(which determines the picture) and full caption text (which contains additional info:eg:price,size,color...)
3: basket.php add an item to the database.
4: see it: http://www.tancsicscipo.hu (navigate to "upcoming collection")
(the link is "hungarian" "kosárba teszem")
This site is bi-language (english hungarian) but at the moment e-commerce is only hungarian......

regards....

Re: Simpleviewer w/ simple e-commerce customization

That is a hard language!
Ok, i used the english version and found upcoming collection, opened an image, clicked on caption, then the cart opened, then i got lost. What is Tovabb ? i tried typing 2 thinking it was quanity, but nothing happens. This is in IE. Nothing at all shows in FF. Can you give more directions? Is a full blown cart supposed to open? Or is this code similar to paypal requirements?
Thanks
Richard

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Simpleviewer w/ simple e-commerce customization

Flash Ho,

I just want to demonstrate howto use SV in ecommerce.
Howto break out from SV with caption link and get data from caption.
The backend is a php/mysql script collection, which manages goodies in cart (set quantity ..etc)

Anyway this code is not complete yet
Usage:
1: login, give your email addr (this will your account in database)
if there was previous login and item in your cart these will display
2: click one or more image caption to drop them into cart (bottom of screen)
images on cart have a  tooltip with its data
3: click thumbnail on cart to open details window, and set deatils of that item
4: set color,size,quantity, and press "Tárolás" as Save or "Pénztárhoz" as to cassa
5: To cassa menu point will list your order, and send an email to administrator

ps: i see your heavy actvity in svpro (with source fla) and  i think emommerce can be solved in flash also
in source you can easily call php scripts which manage cart items ,and set order.

Re: Simpleviewer w/ simple e-commerce customization

Thank you for expaining in detail. Nice work, I understand now. I had not realized it wasn't complete. I've done a couple php/mySql from flash things, and I could collect cc info that way. I'm looking for a smooth intergration with Paypal from flash. Guess I will jump in and tackle the problem.

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Simpleviewer w/ simple e-commerce customization

i use picasa to create gallery

1: modify  imageNode.xml like this:
<image>

<filename><%itemName%></filename>

    <caption><![CDATA[<font size="16"><%itemCaption%><br><A href="http://www.tancsicscipo.hu/basket.php?s=<%itemName%>&c=<%itemCaption%>" target="basket"><U>Buy</U></A></font>]]></caption>

</image>

This seems to be exactly what I need. However I immediately met the first problem .... I can not break out SV by change of <caption> as quoted!! Whatever I try, the link returns the SV page (the index.html of the gallery).

I use SV template version 1.7 for Picasa.

Any idea what I have to do to break out SV?

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

<caption><![CDATA[<font size="16"><%itemCaption%><br><A href="http://www.tancsicscipo.hu/basket.php?s=<%itemName%>&c=<%itemCaption%>" target="basket"><U>Buy</U></A></font>]]></caption>

You must use modified picasa template, whick make xml file.
You must mod imageNode.xml file.
Or you can create xml file manually.
pls double check your xml file (in SV17 this is imageData.xml)
in this file in the caption entry must be the line just like the above one.
There must be a link: <a href=......></a>
in this link the target url is http://www........

in your file what is that url? it must be your php page NOT the index.html of SV page

good luck.....

Re: Simpleviewer w/ simple e-commerce customization

Thanks $5v1 for your reply!

I tried exactly what you instructed, but it did'nt work for me with the SV Picassa template (V 1.7.1) which I downloaded on July 29, 2006.

I have now downloaded the newer version (V 1.8) wich generates gallery.xml (i.s.o. imageData.xml) and now it works fine!!

I can breakout the SV and give to parameters <%itemName%> and <%itemCaption%> to the URL file.

Thanks for your help.

By the way: <%itemName%> and <%itemCaption%> result in the same output ! Maybe something is not done right by me; I will look further.

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

Good luck ....

Thanks for help! I have installed now SV Version 1.8 Picasa-template. This version parshes the variables (V 1.7 not !!!), which can be seen in gallery.xml

So far OK!

<caption><![CDATA[<font size="16"><%itemCaption%><br><A href="http://www.tancsicscipo.hu/basket.php?s=<%itemName%>&c=<%itemCaption%>" target="basket"><U>Buy</U></A></font>]]></caption>

Next what I want to accomplish is parshing a third variable (different from "itemCaption" and "itemName". This third parameter comes from the page (PHP) that links to the SV Gallery and has to be parshed to a form to order by the link in imageNode.xml

I tried :
<caption><![CDATA[<font size="14"><A href="../../../fotosbestellen.php?fotonr=<%itemName%><caption><![CDATA[<font size="14"><A href="../../../fotosbestellen.php?fotonr=<%itemName%>&rubriek=$rubriek&evenement=<%exportDescription%>" target="_parent"><font size="14"><U>Bestel&nbsp;<sup>1)</sup>&nbsp;<b>onderstaande</b> vergrote foto.</font></U></A>&nbsp;&nbsp;<font size="-2">>>>></font></font>]]></caption>

Also tired things like :
&rubriek=<? $rubriek ?>
or
&rubriek=<? echo $rubriek ?>
but it did'nt work.

It looks as if the .swf file does,nt take "starnge variables".

Or .... is there a way to work around?

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

Berend ,

AFAIK this gallery xml file is static.
SW uses this file to display pics and captions only.
There is no parameter passing.
Your captions must vary time by time?
You want to drop into gallery.xml dynamic data?
In that case i think you must create gallery.xml file in runtime (not with picasa, but with proper php code)

In the past i used SV to display static captions. ( once i made them with picasa, and thats all, they're do not chages )

This would be great improvement to change captions on runtime dynamically.
1. search entry in gallery.xml file
2. mod captions
3. write out gallery.xml
4. restart SV ( i think SV reads xml file at once on start, and if xml file changed SV dont mind it.)

regards....

Re: Simpleviewer w/ simple e-commerce customization

This would be great improvement to change captions on runtime dynamically.

I understand that galery.xml is static, i.e. only dynamic for <itemName> and <exportDescription>. Question is : How to make it dynamic for other parameters? Or, maybe beteer question: Which file generates galery.xml (a SV file or a Picas file) and can we change this file to include other dynamic parameter?

I understand that three files in SV (header.xml ; imageNode.xml ; footer.xml) are involved in making the right galery.xml

So I tried modified imageNode.xml as follows:
<image>
    <filename><%itemName%></filename>
    <rubriek><%$path|replace:"\":"\\"%></rubriek>
    <caption><![CDATA[something here]]></caption>
</image>

which results in the galery.xml as:
<image>
    <filename>1.jpg</filename>
    <rubriek>$path|replace:"\":"\\" UNDEFINED (9)</rubriek>
    <caption><![CDATA[something here]]></caption>
</image>

Yes, indeed I would like to get the 'root directory' of the galery as parameter "rubriek" and then retrieve it with <% rubriek%> in the next php-file.

I have the feeling this must be posible, right?

Maybe Felix can jump in here to help us on this!!!

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

Hi Berend,

There are some confused things...

0. for sv flash gallery you need only 4 things:  images,thumbnails,gallery.xml, and sv ofcoz.

1. SV dont create gallery.xml just read it.
imageNode.xml, header.xml ...etc are NOT parts of SV BUT parts of picasa (sv template)

2. Picasa create gallery.xml (with help of picasa sv template)

3. Its right that both sv, and sv picasa template made by Felix. but these are 2 different proggies.

4. if you want to mod sv picasa template. and insert additional things, you must consult picasa , how to make templates
BUT this method will be not automatic, changes on sv picasa template will not affect your gallery unless you run picasa and create gallery manually.

5. I think you need, to chage gallery.xml content dynamically on runtime. with picasa you cannot do that.
forget picasa and sv picasa template.
You need completely different new method to create gallery.xml file ( you must write proper php code to do that )

6. to enlighten me about your situation:
-your sv gallery start by a php file
-this php file got a parameter which hold info
eg: http://www.xxx.com/BerendSVgallery.php?rubriek=yyyy
-this rubriek info must placed into all image's caption

-in that case in that php file which fire SV you must insert a code BEFORE fire SV
this code must read galleryprototype.xml , insert rubriek info on every <caption> entry, and write out gallery.xml
then file SV, which will read newly created gallery.xml

galleryprototype.xml will be that full xml file but without rubriek info. (this can be created by picasa)

good luck

Re: Simpleviewer w/ simple e-commerce customization

6. to enlighten me about your situation:
-your sv gallery start by a php file
-this php file got a parameter which hold info
eg: http://www.xxx.com/BerendSVgallery.php?rubriek=yyyy
-this rubriek info must placed into all image's caption

-in that case in that php file which fire SV you must insert a code BEFORE fire SV
this code must read galleryprototype.xml , insert rubriek info on every <caption> entry, and write out gallery.xml
then file SV, which will read newly created gallery.xml

galleryprototype.xml will be that full xml file but without rubriek info. (this can be created by picasa)
good luck

S5VI,

My situation is as you subscribe:
a) the SV gallery starts with a PHP-file (with the parameter "rubriek"), which calls for the "default.php" (i.s.o. the normal index.html of the SV Picasa template)

b) this default.php contains :

<script type="text/javascript">
var fo = new FlashObject("viewer.swf", "viewer", "100%", "100%", "8", "#000000");       
fo.addParam("wmode", "transparent");
fo.addParam("quality", "best");
fo.addVariable("preloaderColor", "0xffffcc");
fo.addVariable("xmlDataPath", "gallery.xml");
//fo.addVariable("rubriek", getQueryParamValue("rubriek"));
fo.write("flashcontent");
</script>

to display the galery. Still clear?

c) I want, or better HAVE TO, use the SV Picasa template ! So I keep trying to parse the parameter rubriek to the page called by the link I created in viewer.swf by modyfying imageNode.xml

d) imageNode.xml does.nt accept new parameters, even not when added with f.i. fo.addVariable("rubriek", getQueryParamValue("rubriek"));. Can you still follow me?

I searched the internet and found a couple of interestting links like:
1) http://blog.deconcept.com/2005/03/31/pr … practices/
2) http://www.a3d.nl/index.php/?p=276
3) http://www.flashfiles.nl/forum/topic.asp?topic_id=63261

But sofar I could not get the wanted result; only get the feeling that I need to learn more about swfobject.

However, maybe you, maybe Felix or maybe someone else can save me the time with the golden tip?

BUT ... maybe your suggestion (marked red in the quote) can help. Problem is don't understand what you suggest. Can you give some example files? I would very much appreciate that!

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

Hi, Berend

If you want to pass a parameter to viewer.swf, you can do as you wrote. BUT you must mod viewer.swf to recognize that
(Are you purchased source from Felix? Altough i can code in flash, a cannot pay for it.($45))

Picasa template is at work ONLY someone run Picasa.
ImageNode.xml is part of picsasa template.

The xml file which read by sv is gallery.xml

My idea is:
calling:   http://www.xxx.com/BerendSVgallery.php?rubriek=yyyy

content of BerendSVgallery.php:

$_GET['rubriek']  is the parameter

file open and read galleryprototype.xml

insert variable rubriek where you want into xml

write out file named gallery.xml

call sv: echo ".........";


ps: galleryprototype.xml can be created with picasa and acts as template file.

gallery xml will be created from galleryprototype.xml+rubriek parameter.
gallery.xml created BEFORE calling sv
you must be familiar with php coding.

ps : this method works if pictures and num of pict do not change, only rubriek info changes
if pictures also changes, you must create whole gallery.xml file (without galleryprototype.xml)
you must discover pictures on your own. (this is more difficult, you must do picasa's job)

regards....

Re: Simpleviewer w/ simple e-commerce customization

Hi S5VI,

I try to understand your idea and I think I'm close to that, I hope.

I studied today the Picasa Web Templating and searched the internet for new idea's I can implement with my (limited) knowledge of TPL, XML and PHP coding.

Let me explain more in detail :

1) I have multiple "rubrieken" and each "rubriek" contains multiple galeries with a number (up to 50) of fotos in each galery.

2) The foto's are stored in directories on a webserver as follows :
- root
----- RUBRIEK
--------- GALERY A Name
-------------- all SV Picase files including "/images/foto-names.jpg"
--------- GALERY Another Name
-------------- all SV Picase files including "/images/foto-names.jpg
--------- etcetera
----- RUBRIEK Another
--------- GALERY blabla
-------------- all SV Picase files including "/images/foto-blabla.jpg
--------- etcetera
----- etcetera

3) In my calling PHP-file I create dynamic hyperlinks containing the parameters "rubriek" and "galery" to call the "default.php" (or index.html), which contains the SV that is build by the "galery.xml" file (generated by Picassa with the SV Picassa template).
So the relative link is like : /rubriek/galery/default.php?rubriek =$rubriek&galery=$galery

4) In default.php I put :
//PHP5 with ' register_globals = off '
if(!isset($_GET["galery"])) $galery="Unknown galery";
else $evenement = $_GET["evenement"];
if(!isset($_GET["rubriek"])) $rubriek="Unknown rubriek";
else $rubriek = $_GET["rubriek"];

5) In the Picasa SV template <%itemName%> is the value for parameter <filename> and equals with the name of the picture (foto-blabla.jpg) AND <%exportDescription%> equals in my case with my parameter "galery"

6) The imageNode.xml looks like :

<image>
<filename><%itemName%></filename>
<caption><![CDATA[<font size="14"><A href=../buyfotos.php?foto=<%itemName%&galery=<%exportDescription%>&rubriek=<% ?? %>>" target="main"><font size="14"><U>Place picture in basket.</U></font></A></font>]]></caption>
</image>

SO FAR, SO GOOD!
However I would like to include "rubriek" also in the <caption> !! I need it in the further processing of the buy-order!

For your (very much appreciated) comments I understand I have to struggle with the SV Picassa files to get &rubriek=<% ?? %> in the final "galery.xml". Am I right?

I will start with "index.tpl" and STEP BY STEP hope to include something like you suggest as :
"ps: galleryprototype.xml can be created with picasa and acts as template file.
gallery xml will be created from galleryprototype.xml+rubriek parameter.
gallery.xml created BEFORE calling sv "

I will keep you informed and am still hoping that you or Felix or anay other expert can write me the required code for the files in SV Picasa template. I did my best to explain my obejective as much as possible in detail.

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

What I tried next :

In "index.tpl" you find : include imagedataTemplate.tpl

I adapted this for my objective and it looks now as (included the other files and my additions marked bold):

#templatefile
define exportFileName gallery.xml
define itemRubriek $rubriek
include header.xml
<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageHeight="392" maxImageWidth="490" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="1" stagePadding="50" thumbnailColumns="6" thumbnailRows="1" navPosition="top" navDirection="LTR" enableRightClickOpen="false" backgroundImagePath="" thumbPath="thumbnails/" imagePath="" >
loop rubrieklist.xml
<rubriek><%itemRubriek%></rubriek>

loop imageNode.xml
<image>
<filename><%itemName%></filename>
<caption><![CDATA[<font size="14"><A href="../../../fotosbestellen.php?fotonr=<%itemName%>&rubriek=<%itemRubriek%>&evenement=<%exportDescription%>" target="main"><font size="14"><U>Bestel&nbsp;<sup>1)</sup>&nbsp;<b>onderstaande</b> vergrote foto.</font></U></A>&nbsp;&nbsp;<font size="-2">>>>></font></font>]]></caption>
</image>
include footer.xml
</simpleviewerGallery>

This does'nt work !!

I run Picasa to generate "galery.xml" from my PC (without PHP installed). Can that be the reason that, whatever I try, I get

<rubriek>itemRubriek UNDEFINED (9)</rubriek>
<rubriek>itemRubriek UNDEFINED (9)</rubriek>
<rubriek>itemRubriek UNDEFINED (9)</rubriek>

in the galery.xml?

OR ....... is the solution in your comment

content of BerendSVgallery.php:

$_GET['rubriek'] is the parameter
file open and read galleryprototype.xml
insert variable rubriek where you want into xml
write out file named gallery.xml
call sv: echo ".........";

ps: galleryprototype.xml can be created with picasa and acts as template file.

gallery xml will be created from galleryprototype.xml+rubriek parameter.
gallery.xml created BEFORE calling sv

which I don't understand.

Is my "default.php" (i.s.o. index.html in SV Picasa template) what you name "BerendSVgallery.php"?

If so, what should be the PHP-code in default.php to "open and read galleryprototype.xml ; insert variable rubriek where I want into xml ; write out file named gallery.xml ; call sv: echo "........."; "

I have no idea how to handle this.

And ... what is the XML-code for galeryprototype.xml and where should this file be located in Picasa?

Really I'm lost about this!

met vriendelijke groet,
Berend

Re: Simpleviewer w/ simple e-commerce customization

Maybe i'm wrong to explain it.

1: use picasa template, with your mod, leave blank to rubriek place
<caption><![CDATA[<font size="14"><A href=../buyfotos.php?foto=<%itemName%>&galery=<%exportDescription%>&rubriek= " target="main"><font size="14"><U>Place picture in basket.</U></font></A></font>]]></caption>
2: with picasa make a web gallery from one of your picture set
3: you must get a folder in your Dicuments folder: picasa HTML exports/your gallery name
4: there are some files in it: images,thumbnails,gallery.xml,index.html,viewer.swf,swfobject.js
5: rename gallery.xml -> galleryprototype.xml
6: rename index.html -> default.php
7: insert  some php code to beginning of default.php

next step: php code

need to know php file operations
-get parameter rubriek
-open file galleryprototype.xml for read
-read data
-seek place to insert rubriek info and insert info
-- search for "rubriek=" in loaded file
-- paste info, repeat this for every picture caption (search next "rubriek=")
-open gallery.xml for write (delete previous gallery.xml)
-write file

thats all. calling of newly created default.php is: default.php?rubriek=xxxxxx   will show your gallery with rubriek info.

repeat this for every picture set.

regards.....