Jump to content

Flash/PHP/XML Help Needed Please


Taek

Recommended Posts

Hi, i am working on a flash gallery script that requires the use of XML, the following code is part of the XML that I would like to be done with PHP so that it's automated

 

<gallery title="Flash Gallery Title" thumbDir="./images/" imageDir="./images/" random="true">

<category name="Outdoors"> // foreach gallery as category
	<image>
		<date>03.30.09</date> // modified date or uploaded date
		<title>Testing B1</title> // file name
		<desc>Testing B1</desc> // can be empty or file name
		<thumb>bathrooms/Bath_vanity_1_thumb.jpg</thumb> // ./images/thumbdir/imagefile.ext
		<img>bathrooms/Bath_vanity_1_resize.jpg</img> // ./images/resizedir/imagefile.ext
	</image>
</category>

<category name="Show Rooms"> // foreach gallery as gategory
	<image>
		<date>03.30.09</date> // modified date (if possible)
		<title>Testing B1</title> // file name
		<desc>Testing B1</desc> // can be empty or file name
		<thumb>bathrooms/Bath_vanity_1_thumb.jpg</thumb> // ./images/resizedir/imagefile.ext
		<img>bathrooms/Bath_vanity_1_resize.jpg</img> // ./images/resizedir/imagefile.ext
	</image>
</category>

</gallery>

 

the closes thing i've found is a mp3 flash script

 

<?php

// setting the directory to search for mp3 files
$dir = "mp3/";



// reading the directory and inserting the mp3 files in the playlist array
$n = 0;
$playlist = array();
$fdir = opendir($dir);
while($i = readdir($fdir)) {
   // if a .mp3 string is found, add the file to the array
   if (strpos(strtolower($i),".mp3") !== false) {
  	   $playlist[$n] = $i;
  	   $n++;
  	} 
}
// close the directory and sort the array
closedir($fdir);
array_multisort($playlist);


// echoing the playlist to flash
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<player showDisplay=\"yes\" showPlaylist=\"yes\" autoStart=\"yes\">\n";
for ($i=0; $i<sizeof($playlist); $i++) {
   // for the title it filters the directory and the .mp3 extension out
   echo "  <song path=\"$dir$playlist[$i]\" title=\"".str_replace(".mp3","",$playlist[$i])."\" />\n";
}
echo "</player>";

 

Any help would be appreciated

 

Thanks in Advance.

Link to comment
https://forums.phpfreaks.com/topic/153904-flashphpxml-help-needed-please/
Share on other sites

if your using AS2, here is a site I found which gives an example. Not sure if is exactly what you are looking for, but may give you some ideas.

 

http://mrsteel.wordpress.com/2008/01/08/flash-image-gallery-example-actionscript-2-using-php-to-list-images-from-folder/

if you don't have access to the fla then realistically you are left with using the xml that it says you must use - php can create and manage that for you...

 

we can't write the script for you but if you look at simpleXML and spend a couple hours playing with it you WILL be able to do this yourself.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.