Open Source & Stuff  
  |     Main Site     |      Forum     |     Contact     |
Usage & Documentation :  forum.Salix.gr forum.Salix.gr
Usage & Documentation of Image File Browser Class 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
messageAdd Image File Browser to a page.
Posted by: panos (IP Logged)
Date: November 08, 2006 04:35AM

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.

messageRe: Add Image File Browser to a page.
Posted by: EIRAno (IP Logged)
Date: November 26, 2006 10:30AM

What I can use that in my TinyMCE?
thanx.

messageRe: Add Image File Browser to a page.
Posted by: panos (IP Logged)
Date: November 30, 2006 02:46AM

If you place it on the same page with TinyMCE when you select an image on the dialog that appears you will see a link "To Editor" that executes tinyMCE.execCommand('mceInsertContent'... javascript that inserts the selected image with properties set on the dialog to TinyMCE.
This will help users to add images on document.

Hope this helped.

messageRe: Add Image File Browser to a page.
Posted by: modulo (IP Logged)
Date: March 21, 2007 01:50PM

Bonjour

Bug avec votre script

[cmsfrance.org] sad smiley

h**p://cmsfrance.org/home/.lla/cmsfr/cmsfrance.org/lebid/ocr/ifb/demo_images/aa/ico_lang.gif ???



Edited 3 time(s). Last edit at 03/21/2007 02:09PM by modulo.

messageRe: Add Image File Browser to a page.
Posted by: panos (IP Logged)
Date: March 22, 2007 05:35AM

Bonjour,

my french is limit to oui, no, bojour :-)

this is something strange happening to the demo you show me...

/home/.lla/cmsfr/cmsfrance.org/lebid/ocr/ifb/demo_images/
is your image path and the class replaces $_SERVER['DOCUMENT_ROOT'] with blank

see function
        function htmlpath($relative_path) {
           $realpath=str_replace('\\','/', realpath($relative_path));
           $htmlpath=str_replace($_SERVER['DOCUMENT_ROOT'],'',$realpath);
           return $htmlpath;
        }

trying to make <img src location

but seems to make no replacement.

Can you check what is the value of $_SERVER['DOCUMENT_ROOT'] on your server?

messageRe: Add Image File Browser to a page.
Posted by: modulo (IP Logged)
Date: March 22, 2007 10:54AM

Hello

$_SERVER['DOCUMENT_ROOT'] return => /home/cmsfr/cmsfrance.org sad smiley

Merci beaucoup pour votre aide

messageRe: Add Image File Browser to a page.
Posted by: panos (IP Logged)
Date: March 23, 2007 03:07AM

hmmm

then an ugly hack would be to define previously in your code, configuration file or something, a global variable eg containing $images_real_to_url_drop_part = "/home/.lla/cmsfr/cmsfrance.org/" and
modify function

function htmlpath($relative_path) {
           global $images_real_to_url_drop_part;
           $realpath=str_replace('\\','/', realpath($relative_path));
           $htmlpath=str_replace($images_real_to_url_drop_part,'',$realpath);
           return $htmlpath;
}

so
/home/.lla/cmsfr/cmsfrance.org/lebid/ocr/ifb/demo_images/

will be lebid/ocr/ifb/demo_images/ :-)

hope that helps



Sorry, only registered users may post in this forum.

All Rights Reserved 2006 Salix.gr  |  Design by Ades Design |  Hosting by e-emporio |  forum.Salix.gr powered by Phorum