Welcome Guest Search | Active Topics

Add Reply New Topic

Descriptions Photo Order

Options
Albertvdmeulen
Posted: Wednesday, February 03, 2010 9:01:37 AM
Rank: Member
Groups: Member

Joined: 3/19/2009
Posts: 10
Points: 30
Is it possible to store the descriptions in the photo order (size, paper, amount) in seperate files into the xml file?
Now all is stored in the 'descriptions'

The advantage of this is that i can calculate how many photo are in i.e. 4x6 and how many in 5x7 and so on.

I tried some extra code into the xml through POST:
//This function is called when the user changes some order settings (like format name, paper type, or amount of items).
        //Ordered format information is stored in the description field of Image Uploader items.
        //If 'applyToAll' parameter is true, then ordered format information applies to all images in upload pane.
        function itemChange(applyToAll) {
            if (imageUploader1) {

                //Compile the string with ordered formats.
                var description = "";
                for (var i = 1; i <= maxFormatCount; i++) {
                    var SelectFormatN = document.getElementById("SelectFormat" + i);
                    var SelectPaperN = document.getElementById("SelectPaper" + i);
                    var InputAmountN = document.getElementById("InputAmount" + i);
                    var SelectResizeN = document.getElementById("SelectResize" + i);
                    [b]format2 = document.getElementById("SelectFormat" + i);    [/b]                

                    var amount = parseInt(InputAmountN.value);

                    if (SelectFormatN.selectedIndex != 0 && SelectPaperN.selectedIndex != 0 && InputAmountN.value != 

"" && amount && SelectResizeN.selectedIndex != 0) {
                        var format = SelectFormatN.options[SelectFormatN.selectedIndex].value;
                        var paper = SelectPaperN.options[SelectPaperN.selectedIndex].value;
                        var resize = SelectResizeN.options[SelectResizeN.selectedIndex].value;
                
                        if (description != "") {
                            description = description + separator;
                        }
                        description = description + format + " " + paper + " x " + amount + " " + resize;
                    }
                }

                //Update desriptions of selected items and write ordered formats information into it.
                for (var i = 1; i <= imageUploader1.getUploadFileCount(); i++) {
                    if (applyToAll === true || imageUploader1.getUploadFileSelected(i)) {
                        imageUploader1.setUploadFileDescription(i, description);
                    }
                }
            }
        }


And in the upload i added:
//Save file info.
        $xmlFile = $descriptions->createElement("file");
        $xmlFile->setAttribute("name", $fileName);
        [b]$xmlFile->setAttribute("formaat", $_POST ['format2_1']);[/b]
        $xmlFile->setAttribute("description", $_POST ['Description_1']);
        $descriptions->documentElement->appendChild($xmlFile);


In the XML file i get an empty string formaat

Tamila
Posted: Monday, February 08, 2010 1:30:45 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 3/10/2008
Posts: 419
Points: 1,160
Hi,

I recommend you to send all necessary information in Description as previous, but parse it on server-side.
The following function is used on client-side:
function parseDescription(description) {
    var formats = new Array();
    if (description != "") {
        var arrDescription = description.split(separator);

        for (var z = 0; z < arrDescription.length; z++) {
            arrFormat = arrDescription[z].split(" ");
            formats.push(new Format(arrFormat[0], arrFormat[1], arrFormat[3], arrFormat[4]));
        }
    }
    return formats;
}

You just need to rewrite it to PHP and add the code which write information from description in XML file.


Best regards,
Tamila Ashrafova

Aurigma Support Team
Users browsing this topic
Guest

Add Reply New Topic

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.