26

Re: Another File Browser

Wow, I am VERY impressed. I needed a file/image manager for a school website I am building, and this was just the answer. Nice work, Guido Neele. I have a few suggestions:

   - Double click to insert a file would be nice
   - When in the image manager, limit the uploads to only images
   - The image filter on image manager doesn't always filter out all of the non-image files
   - Perhaps the delete/edit file name would be a bit more accessible, for any non-technical people to use

Nevertheless, this is a GREAT, editor and I am going to use it on my site right away.

Last edited by spryno724 (2010-06-07 19:25:30)

27

Re: Another File Browser

Thnx for a nice plugin,
i didnt get it to work properly now but ill sure give it another go on my next
project. I got a bunch of uset php vars $httpFiles $httpFolders and a few others. CSS looks
strange to. Your example looks great on my browser so guess its my server thats doggie.

Anyway i created a somewhat ok Swedish language file and i thought i´ll just pop it up here for your next ver.

Keep up the good work.



    "decimal seperator" => ".",
    "thousands separator" => ",",
    "datetime format" => "m/d/Y H:i", // www.php.net/manual/en/function.date.php
    "Insert" => "Lägg till",
    "File" => "Fil",
    "Root" => "Root",
    "Close" => "Stäng",
    "New folder" => "Ny mapp",
    "Upload" => "Ladda upp",
    "Clipboard" => "Urklipp",
    "Items" => "st",
    "Change view" => "Byt vy",
    "View" => "Vy",
    "Large images" => "Stora bilder",
    "Small images" => "Små bilder",
    "List" => "Lista",
    "Details" => "Detaljer",
    "Tiles" => "Tiles",
    "Content" => "Innehåll",
    "Show the preview pane" => "Visa förhandsgranskning",
    "Help" => "Hjälp",
    "Search" => "Sök",
    "Dimensions" => "Dimensioner",
    "Filename" => "Namn",
    "Filetype" => "Typ",
    "Size" => "Storlek",
    "Modified on" => "Datum ändrad",
    "Directory" => "Mapp",
    "Add a new folder" => "Lägg till ny mapp",
    "New folder is created in" => "Ny mapp kommer att skapas i",
    "Name of the new folder" => "Namn på nya mappen",
    "Create folder" => "Skapa ny mapp",
    "Upload a new file" => "Ladda upp ny fil",
    "Image editor" => "Bild editor",
    "Browse" => "Leta...",
    "Upload Queue" => "Uppladdnings kö",
    "Currently uploading in folder" => "Laddar upp i mapp..",
    "Select your file" => "Välj din(a) fil(er)",
   
    //Context menu
    "cmenu_insert" => "Insert",
    "cmenu_edit" => "Edit image",
    "cmenu_copy" => "Kopiera",
    "cmenu_cut" => "Klipput",
    "cmenu_paste" => "Klistra in",
    "cmenu_delete" => "Ta bort",
    "cmenu_delete_confirm_message_folder" => "Vill du verkligen ta bort den här mappen och all dess innehåll?",
    "cmenu_delete_confirm_message_file" => "Vill du verkligen ta bort den här filen?",
    "cmenu_delete_confirm_message_image" => "Vill du verkligen ta bort den här bilden?",
    "cmenu_open" => "Öppna",
    "cmenu_large_images" => "Stora bilder",
    "cmenu_small_images" => "Små bilder",
    "cmenu_list" => "Lista",
    "cmenu_details" => "Detaljer",
    "cmenu_tiles" => "Namn",
    "cmenu_content" => "Innehåll",
    "cmenu_refresh" => "Uppdatera",
    "cmenu_new_folder" => "Ny mapp",
    "cmenu_rename" => "Döp om",
   
    //Messages
    "folder_tampered_with" => "Knas på sökvägen till mappen!",
    "folder_name_invalid" => "Inge ny mapp skapades!<br />Du kan inte ha följande tecken i namnet: ^ \\ / ? * \" ' < > : |",
    "create_folder_successful" => "Ny mapp skapad!",
    "create_folder_failed" => "Ny mapp skapades inte!",   
    "file_tampered_with" => "Knas på sökvägen till mappen!",
    "loadfolder_error_1" => "Knas på sökvägen till mappen!",
    "delete_error_1" => "Knas på sökvägen till mappen/filen!",
    "delete_error_2" => "Kunde inte ta bort fil!",
    "delete_error_3" => "Kunde inte ta bort mapp!",
    "delete_success" => " filer borttagna!",
    "select_one_file" => "Välj endast en fil!",
    "insert_cancelled" => "Hittade ingen målmapp!",
    "directory_already_exists" => "Den mappen finns redan!",
    "file_already_exists" => "Filen finns redan!",
    "rename_failed" => "Kunde inte byta namn!",
    "rename_file" => "Namnge {0}{1}Fil ändelser läggs till automatiskt!{1}(Du kan inte ha följande tecken {2})",
    "rename_folder" => "Namnge {0}{1}(Du kan inte ha följande tecken {2})",
    "action_not_allowed" => "Inte tillåtet!"

28

Re: Another File Browser

Great work guido, i'll traduce it in italian language soon...
i'd like to ask you a thing... i would use it only for images and to set when load the default folder (one for each user, with his username) disabling the creation of new folder... is complicated? can you drive me? thanks in advance

29

Re: Another File Browser

neochmod wrote:

Great work guido, i'll traduce it in italian language soon...
i'd like to ask you a thing... i would use it only for images and to set when load the default folder (one for each user, with his username) disabling the creation of new folder... is complicated? can you drive me? thanks in advance

Hi neochmod,

Disabling the creation of folders is explained by BonySoft in the following post: http://tinymce.moxiecode.com/punbb/view … 42#p75042. Just remove 'create_folder' from the $allowed_actions array.

If you want a different folder for each user then you will have to change a few things in the config.php. You could do something like this:

config.php

/* 
 * UPLOAD PATH
 * 
 * absolute path from root to upload folder (DON'T FORGET SLASHES)
 *
 * Example 
 * ---------------------------------------
 * http://www.domain.com/images/upload/
 * $uploadpath = '/images/upload/';
 *
 */
$uploadpath = '/path/to/upload/folder/' . $_SESSION['username'] . '/';

I hope this works out for you.

Greetings,

Guido

Last edited by Guido Neele (2010-06-14 19:05:30)

30

Re: Another File Browser

Yeah, works like a charm ;-)

31

Re: Another File Browser

Guido, erg gaaf!

I have a little problem, not really known to TinyMCE and these things, my upload path doen'st seem to be perfect.
But, when I copy the link from the error, it works....

What's going wrong here?

Chilion

Last edited by Chilion (2010-06-17 09:42:22)

32

Re: Another File Browser

Hi Neele,

I have tried your suggestion to change default folder path in following way,

if(isset($_GET['album'])){

    $uploadpath = '/bronx/content/'.$_GET['album'].'/'; 
    
}
else $uploadpath = '/bronx/images/content/';

But i get an error as  The folder path was tampered with!

Any help on this please...

33

Re: Another File Browser

Hi. it's great. incase you are implementing the image manipulation i would suggest http://phpthumb.gxdlabs.com/ . it's gd2 class for image manipulation. the best as far as i know!

34

Re: Another File Browser

Shaaa wrote:

Hi Neele,

I have tried your suggestion to change default folder path in following way,

if(isset($_GET['album'])){

    $uploadpath = '/bronx/content/'.$_GET['album'].'/'; 
    
}
else $uploadpath = '/bronx/images/content/';

But i get an error as  The folder path was tampered with!

Any help on this please...

Hi Shaaa,

You shouldn't be using $_GET because the argument "album" isn't included in the AJAX calls. You should use $_SESSION instead.

Greetings,

Guido

35

Re: Another File Browser

keevitaja wrote:

Hi. it's great. incase you are implementing the image manipulation i would suggest http://phpthumb.gxdlabs.com/ . it's gd2 class for image manipulation. the best as far as i know!

Hi keevitaja,

Yes I'm already using phpThumb for the thumbnail creation so I intend to use it for the image manipulation as well. I won't be able to implement the editor soon but I hope to spend some time on it during this summer. I also have plans to add folder/file access and user priviliges. 

Glad you like it.

Guido

36

Re: Another File Browser

Hi Guido Neele.

This is traduction to french :

$lang = array(
    "decimal seperator" => ",",
    "thousands separator" => " ",
    "datetime format" => "d/m/Y H:i", // www.php.net/manual/en/function.date.php
    "Insert" => "Insérer",
    "File" => "Fichier",
    "Root" => "Racine",
    "Close" => "Fermer",
    "New folder" => "Nouveau dossier",
    "Upload" => "Charger un fichier",
    "Clipboard" => "Presse-papier",
    "Items" => "éléments",
    "Change view" => "Changer l'affichage",
    "View" => "Affichage",
    "Large images" => "Grandes icônes",
    "Small images" => "Petites icônes",
    "List" => "Liste",
    "Details" => "Détails",
    "Tiles" => "Mosaïques",
    "Content" => "Contenu",
    "Show the preview pane" => "Afficher le volet de prévisualisation",
    "Help" => "Aide",
    "Search" => "Recherche",
    "Dimensions" => "Dimensions ",
    "Filename" => "Nom ",
    "Filetype" => "Type ",
    "Size" => "Taille ",
    "Modified on" => "Date de modification ",
    "Directory" => "Dossier",
    "Add a new folder" => "Ajouter un nouveau dossier",
    "New folder is created in" => "Le nouveau dossier sera créé dans",
    "Name of the new folder" => "Nom du nouveau dossier",
    "Create folder" => "Créer un nouveau dossier",
    "Upload a new file" => "Envoyer un nouveau fichier",
    "Image editor" => "Éditeur d'image",
    "Browse" => "Parcourir...",
    "Upload Queue" => "Liste d'attente des envois",
    "Currently uploading in folder" => "Les fichiers seront envoyés dans le dossier",
    "Select your file" => "Choisissez votre(vos) fichier(s)",
   
    //Context menu
    "cmenu_insert" => "Insérer",
    "cmenu_edit" => "Modifier l'image",
    "cmenu_copy" => "Copier",
    "cmenu_cut" => "Couper",
    "cmenu_paste" => "Coller",
    "cmenu_delete" => "Supprimer",
    "cmenu_delete_confirm_message_folder" => "Voulez-vous vraiment supprimer ce dossier et tout ce qu\'il contient ?",
    "cmenu_delete_confirm_message_file" => "Voulez-vous vraiment supprimer ce fichier ?",
    "cmenu_delete_confirm_message_image" => "Voulez-vous vraiment supprimer cette image ?",
    "cmenu_open" => "Ouvrir",
    "cmenu_large_images" => "Grandes icônes",
    "cmenu_small_images" => "Petites icônes",
    "cmenu_list" => "Liste",
    "cmenu_details" => "Détails",
    "cmenu_tiles" => "Mosaïques",
    "cmenu_content" => "Contenu",
    "cmenu_refresh" => "Actualiser",
    "cmenu_new_folder" => "Nouveau dossier",
    "cmenu_rename" => "Renommer",
   
    //Messages
    "folder_tampered_with" => "Le chemin du dossier a été trifouillé !",
    "folder_name_invalid" => "Le nom du dossier est invalide !<br />Les caractères suivants ne sont pas autorisés : ^ \\ / ? * \" ' < > : |",
    "create_folder_successful" => "Un nouveau dossier a été créé !",
    "create_folder_failed" => "La création du nouveau dossier a échoué !",   
    "file_tampered_with" => "Le chemin du fichier a été trifouillé !",
    "loadfolder_error_1" => "Le chemin du dossier a été trifouillé !",
    "delete_error_1" => "Le chemin du fichier ou du dossier a été trifouillé !",
    "delete_error_2" => "La suppression du fichier a échoué !",
    "delete_error_3" => "La suppression du dossier a échoué !",
    "delete_success" => " fichiers correctement supprimés !",
    "select_one_file" => "Merci de choisir au moins un fichier a insérer !",
    "insert_cancelled" => "L'insertion a été annulée car il n'y a pas de cible pour les insérer !",
    "directory_already_exists" => "Le dossier existe déja !",
    "file_already_exists" => "Le fichier existe déja !",
    "rename_failed" => "Le renommage a échoué !",
    "rename_file" => "Merci de donner un nouveau nom pour {0}{1}L'extension est ajoutée automatiquement !{1}(Ces caractès ne sont pas autorisés {2})",
    "rename_folder" => "Merci de donner un nouveau nom pour {0}{1}(Ces caractès ne sont pas autorisés {2})",
    "action_not_allowed" => "Action non autorisée !"
);

I have added other language variables :

"all_files" => "Tous les fichiers",    // index.php line 384, 479
"upload_limited_to" => "Envoi limité à %d Mo",    // index.php line 543
"bytes" => "octets",    // view_... and file_specs.php, lines started by $file_size =...
"kB" => "Ko",
"MB" => "Mo"

I suggests you add these translations in order to completely translate your excellent file browser smile

I have also modify index.php at line 543 to get automatically the maximum filesize upload configuration :
<?php
function let_to_num($v){ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
    $l = substr($v, -1);
    $ret = substr($v, 0, -1);
    switch(strtoupper($l)){
        case 'P':    $ret *= 1024;
        case 'T':    $ret *= 1024;
        case 'G':    $ret *= 1024;
        case 'M':    $ret *= 1024;
        case 'K':    $ret *= 1024;
            break;
    }
    return $ret;
}
$max_upload_size = min(let_to_num(ini_get('post_max_size')), let_to_num(ini_get('upload_max_filesize')));
?>
<div style="margin-bottom:5px; padding:10px; height:20px; line-height:20px;"><?php echo sprintf($lang["upload_limited_to"], ($max_upload_size/(1024*1024)));?></div>

Best regards,

Roland Dufour

37

Re: Another File Browser

tasiot wrote:

Hi Guido Neele.

This is traduction to french.

I have added other language variables :

"all_files" => "Tous les fichiers",    // index.php line 384, 479
"upload_limited_to" => "Envoi limité à %d Mo",    // index.php line 543
"bytes" => "octets",    // view_... and file_specs.php, lines started by $file_size =...
"kB" => "Ko",
"MB" => "Mo"

I suggests you add these translations in order to completely translate your excellent file browser smile

I have also modify index.php at line 543 to get automatically the maximum filesize upload configuration :
<?php
function let_to_num($v){ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
    $l = substr($v, -1);
    $ret = substr($v, 0, -1);
    switch(strtoupper($l)){
        case 'P':    $ret *= 1024;
        case 'T':    $ret *= 1024;
        case 'G':    $ret *= 1024;
        case 'M':    $ret *= 1024;
        case 'K':    $ret *= 1024;
            break;
    }
    return $ret;
}
$max_upload_size = min(let_to_num(ini_get('post_max_size')), let_to_num(ini_get('upload_max_filesize')));
?>
<div style="margin-bottom:5px; padding:10px; height:20px; line-height:20px;"><?php echo sprintf($lang["upload_limited_to"], ($max_upload_size/(1024*1024)));?></div>

Best regards,

Roland Dufour

Hi Roland,

Thanks for the translation and your additions. I will add the translation to the zip-file and take your let_to_num function in to consideration. The problem with the max upload size is that it is not only controlled by the php.ini but there is also a variable in the swfupload/upload.php.

Greetings,

Guido

38

Re: Another File Browser

Exact for the max upload size... The let_to_num function come from php.net.

39

Re: Another File Browser

Hi Guido,

really nice work! But did you check it with IE6, IE7, IE8 - lots of Javascript Errors ... sad

especially:

- if you use the browser without TinyMCE there's an error concerning tiny_mc_popup.js / But this is easy to solve with PHP in the index.php
- IE6 - problems with transparent PNG's
- it's possible to create a folder but not delete it
- you can't rename it either
- you can't change the view - (right top)
- it's not possible to copy / paste

Maybe you've a look at that ...

Would be a mighty tool if it works properly in all browsers. Ok forget IE 6 ;-)

Greetings from Austria
Michael

Last edited by mike75 (2010-07-03 10:26:58)

40

Re: Another File Browser

There is a file called upload.php in the swfupload folder. On line 65 is a commented line of code.

//$extension_whitelist = array("jpg", "gif", "png");     //Allowed file extensions

Remove "//" and now only images are allowed. You can add other file types in the array.


You also have to change lines 127 to 136

$is_valid_extension = true;
/*
$is_valid_extension = false;
foreach ($extension_whitelist as $extension) {
    if (strcasecmp($file_extension, $extension) == 0) {
        $is_valid_extension = true;
        break;
    }
}
*/

Change to:

//$is_valid_extension = true;
$is_valid_extension = false;
foreach ($extension_whitelist as $extension) {
    if (strcasecmp($file_extension, $extension) == 0) {
        $is_valid_extension = true;
        break;
    }
}

Chears
John Macklin

hoa management
Georgia Retirement Communities (GA)

41

Re: Another File Browser

uhm ... seems like the downloads are offline?
can anyone re-upload it please? smile

42

Re: Another File Browser

testeee23 wrote:

uhm ... seems like the downloads are offline?
can anyone re-upload it please? smile

Hi Testeee23,

Sorry something has gone terribly wrong. It looks like my hosting provider messed things up. I think they restored an old backup or something because the most recent modified file is from October 2009.

I will contact them tomorrow.

Things will be back online soon.

Thanks,

Guido

43

Re: Another File Browser

Nice plugin. Great work. I found 2 minor bugs.
1) One problem is with open_basedir restriction in rmkdir function - you cannot detect directories from root with is_dir() function. It should start from STARTINGPATH .
2) Function recursiveDelete generates warning when directory is empty.
(Warning:  Invalid argument supplied for foreach() in functions.php on line 111)

44

Re: Another File Browser

hi,

realy nice Demo!!!  fantastic work !!!

indeed, I have some error.
The demo looks presumably, therefore, quite differently than to me (?)

1:

Warning: is_file(): open_basedir restriction in effect. File(/tmp/minify_40223144609a846b6d948e5a76c1f0be) is not within the allowed path(s): (/srv/www/htdocs/ks013/:/usr/share/php) in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 460

Warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/minify_40223144609a846b6d948e5a76c1f0be) is not within the allowed path(s): (/srv/www/htdocs/ks013/:/usr/share/php) in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 389

Warning: file_put_contents(/tmp/minify_40223144609a846b6d948e5a76c1f0be): failed to open stream: Operation not permitted in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 389

PHP-Manuell
PHP-Manuell-Posting

But OK.
To repair this error first = I have put the path by hand

OLD: (line 98, minify.php)

  define('MINIFY_CACHE_DIR', sys_get_temp_dir());

Change to NEW:

  define('MINIFY_CACHE_DIR', '/srv/www/htdocs/ks013/temp');

The Pics:
http://i35.tinypic.com/35kj095.jpg

the complete high end (new folder...? character) points no funktion.

Last edited by lord_icon (2010-08-14 17:52:59)

45

Re: Another File Browser

lord_icon wrote:
Warning: is_file(): open_basedir restriction in effect. File(/tmp/minify_40223144609a846b6d948e5a76c1f0be) is not within the allowed path(s): (/srv/www/htdocs/ks013/:/usr/share/php) in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 460

Warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/minify_40223144609a846b6d948e5a76c1f0be) is not within the allowed path(s): (/srv/www/htdocs/ks013/:/usr/share/php) in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 389

Warning: file_put_contents(/tmp/minify_40223144609a846b6d948e5a76c1f0be): failed to open stream: Operation not permitted in /srv/www/htdocs/ks013/html/werbemittel/open_source/com.moxiecode.tinymce/filebrowser/minify.php on line 389

1. Make sure your provider hasn't got safe_mode switched on (if so change your provider!!).
2. Make sure your directories have sufficient rights so the PHP scripts get access to them.

Greetings from Germany,

Felix Riesterer.
(-> about me and this forum <-)

46

Re: Another File Browser

To 1:
I have own server.
There run own Scripte which need safe fashion ON.
PHP6 will also have safe fashion ON.

It must work also so. Otherwise the tool is not suited for future.

Moreover:
After I have put the temp path by hand, this error was repaired.

2:
Should you have. I have put the tmp folder on 777. Therefore he should be allowed to write.
However, according to Readme.txt no other write permissions have been called.

47

Re: Another File Browser

lord_icon wrote:

There run own Scripte which need safe fashion ON.
PHP6 will also have safe fashion ON.

It must work also so. Otherwise the tool is not suited for future.

What do you mean by "safe fashion"?? Do you refer to PHP's "safe mode" feature? Then you are greatly mistaken, because as of PHP5.3 this safe mode thingy is deprecated!

lord_icon wrote:

I have put the tmp folder on 777. Therefore he should be allowed to write.
However, according to Readme.txt no other write permissions have been called.

The "tmp folder"? Either you get your PHP settings right or you better disable safe mode. I can't give you any better advice.

Greetings from Germany,

Felix Riesterer.
(-> about me and this forum <-)

48

Re: Another File Browser

ok.

My vhost

 <Directory "/srv/www/htdocs/ks013/html">

  Options  +FollowSymLinks  +SymLinksIfOwnerMatch
   <IfModule mod_access.c>
    Allow from all
   </IfModule>
 </Directory>

 <VirtualHost xxx.xx.xx.xx:80>
 ServerName "<domain>.de"
 ServerAlias ks013.www.<domain>.de www.<domain>.de

 SuexecUserGroup ks013 ks013
 DocumentRoot "/srv/www/htdocs/ks013/html"
 ScriptAlias /cgi-bin/ /srv/www/htdocs/ks013/html/cgi-bin/
 <IfModule mod_python.c>
  <Files ~ "\.py$">
   AddHandler python-program .py
   PythonHandler mod_python.publisher
  </Files>
 </IfModule>

 php_admin_flag safe_mode Off
 php_admin_value open_basedir /srv/www/htdocs/ks013/:/usr/share/php
 php_admin_value session.save_path /srv/www/htdocs/ks013/temp
 php_admin_value upload_tmp_dir /srv/www/htdocs/ks013/temp
 php_admin_value safe_mode_exec_dir /srv/www/htdocs/ks013/temp
 php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@<domain>.de"
 php_admin_flag register_globals off
</VirtualHost>

Unfortunately, it does not go yet.

The file (pictures) are indicated below.
A folder cannot be invested.

With the Upload. Behind the text: "Currently uploading in folder:",
There is input feld. This indicates the Upload folder.
With me this is empty.

Below underneath: "Select your file (s)"
A Flash should be indicated = I do not see.

etc. etc. etc.

What can this be?
Meanwhile I have installed it in an empty list. It can block nothing else.

49

Re: Another File Browser

Hi, I'm newbie with TinyMCE, how do I install this plugin?
Thanks!

50

Re: Another File Browser

steht doch da.
http://www.neele.name/filebrowser/     => View Source

Download the Programm.
Upload the Programm in your Wish-Folder.

Add the Code (See: View Source)
Change the: fileBrowserURL