<?php
 
require 'FolderStats.class.php';
 
 
function createXMLFiles(&$FS , $w3c_xml, $flash_xml) {
 
    $fp = fopen($w3c_xml, 'w');
 
    fwrite($fp, $FS->getXML());
 
    fclose($fp);
 
    $fp = fopen($flash_xml, 'w');
 
    fwrite($fp, $FS->getFlashXML());
 
    fclose($fp);
 
}
 
 
$FOLDER = 'C:/PHP/';
 
$FS = &new FolderStats($FOLDER);
 
 
if(!file_exists('myfolder_flash.xml'))
 
    createXMLFiles($FS, 'myfolder_w3c.xml', 'myfolder_flash.xml');
 
 
$output = "
 
<div style=\"text-align: center;\">
 
    <object type=\"application/x-shockwave-flash\" data=\"FolderTree.swf?xmlfolder=myfolder_flash.xml\" width=\"400\" height=\"380\">
 
        <param name=\"movie\" value=\"FolderTree.swf?xmlfolder=myfolder_flash.xml\" />
 
    </object>
 
</div>
 
";
 
 
echo $output;
 
echo '<pre>';
 
echo '<strong><a href="myfolder_w3c.xml">do you want look at W3C XML File ?</a></strong><br /> <br />';
 
var_dump($FS->getDetails());
 
echo '</pre>';
 
?>
 
 |