BlueShoes File Browser Example

As you can see in the code, only images (and directories) are shown.

Source Code

<?php
/**
* @package    applications_filebrowser
* @subpackage examples
*/

die('This example is disabled by default for security reasons. File: ' __FILE__ ' Line: ' __LINE__);

//include the global conf file:
require_once($_SERVER['DOCUMENT_ROOT'] . '/../global.conf.php');


//here check some session (login) if you want to.


//configure the file browser:
$settings = array(
    
'basePath'             => $_SERVER['DOCUMENT_ROOT'],                                  //where to start browsing. the user cannot break out of here.
    
'viewStyle'            => 'detail',                                                   //'detail' or 'thumbnail'. user can change this with a button in the bar top right.
    
'fileExtensionsFilter' => array('jpg'=>TRUE'jpeg'=>TRUE'gif'=>TRUE'png'=>TRUE), //restrict file types
    
'ignoreDirs'           => array('CVS'=>TRUE),                                         //hide directories
    
'imageDimensions'      => array(                                                      //only allow images of the dimensions specified
        
array('width'=>320'height'=>70),                                                  //either 320x70 pixel
        
array('minWidth'=>420'maxWidth'=>450'minHeight'=>70'maxHeight'=>80),          //or somewhere from 420x70 to 450x80 pixel
    
), 
    
'doWithUnwantedFiles'  => 'disabled'//what to do with unwanted files, default is 'hidden', can also be 'disabled'. that shows them grayed out.
);


//now include the application file:
include $APP['path']['applications'] . 'filebrowser/fileBrowser.inc.php';
?>