PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Andrea Giammarchi   Folder Stats   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Class with flash example [ requires FolderTree.swf too ]
Class: Folder Stats
Serve folder listings to show in a Flash applet
Author: By
Last change:
Date: 18 years ago
Size: 899 bytes
 

Contents

Class file image Download
<?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>';
?>