
Add Image File Browser to a page.
To add Image File Browser to your page is realy simple:
STEP 1. Include class file:
include("file_browser.class.php");
STEP 2. Create an instance:
$o = new File_browser();
STEP 3. Init instance:
$o->init('file_browser.class.php',
$abs_path."demo_images/",
$abs_path."demo_images/",
0,4,10);
Parameters:
- Ajax server side callback handler. Usualy 'path_to/file_browser.class.php', path_to is the path to file_browser.class.php file, if on same folder with your script then simply 'file_browser.class.php'
- The lower level folder user can browse.
- The start up folder (must be sub folder of the above).
- File list type. Currently only thumbs view, value =0.
- Files per row.
- Rows per page. That means that user will see Files per row X Rows per page thumbs.
STEP 4. Add javascripts to page:
$o->add_browser_jscripts('http://www.salix.gr/ifb_demo/');
Parameter:
Url of javascript libraries, prototype and scriptaculous. If you already include them to your page ommit the parameter.
STEP 5. Add browser html on the page where you need:
$o->place_browser();
That's it.
Edited 1 time(s). Last edit at 11/08/2006 05:11AM by panos.