Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Albertvdmeulen  
#1 Posted : Wednesday, February 3, 2010 1:01:37 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
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:

Code:

//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:

Code:

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

Edited by user Thursday, February 11, 2010 2:04:07 AM(UTC)  | Reason: Not specified

Tamila  
#2 Posted : Monday, February 8, 2010 5:30:45 AM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
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:

Code:
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.

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest
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.