File/PHPmyBrowser/config.php

Description

The installed package come with this config.php with all default values that offer the best security and the commonly used configuration.

Read details for all variable above, they are all documented.

As I explain in index.php, do not change this file. Copy it in your custom folder. Then, delete the line you want to apply default values, change those you want...

This config apply to all PHPmyBrowser used. But maybe you want one special config for one special template ?
Create a config.php file in $PHPmyBrowserCustom/templates/YOUR_TEMPLATE/ with the values you want to change.

If user have admin rights, if a config_admin.php file exist in custom folder or one template's folder, it'll be applyed only for administrator.

Variables
string $browserTitle (line 57)

Browser Title / Titre de la page dans le navigateur

Default value : 'PHPmyBrowser'

boolean $HIDE_unwantedFiles (line 71)

Hide some files and folders / Masque certains fichiers et répertoires

Enable/Disable the hide-file system

Active/Désactive le système de masquage de certains fichiers

Default value : true. You can turn it false for administrator.

To modify the list of hidden files, see $HiddenFiles in hiddenfiles.php.

boolean $HIDE_denyFromAllFolders (line 87)

Hide folder if they have .htaccess with "deny from all"

Set this to true if you don't want .htaccess "deny from all" protected folder appear in the listings.
It test all dirs, if they have an .htaccess file and look in this file. If there is "deny from all" then the folder is hidden ;-)

Mettre true pour détecter les répertoires protégés par un .htaccess avec "deny from all" Chaque répertoire est testé, et masqué si besoin.

Default value : true. You can turn it false for administrator.

boolean $HIDE_unreadableFolders (line 103)

Hide unreadable folder / Masque les répertoires illisibles

Set this to true to hide folder that can't be browsed (return an error on opendir).
It's recommended to set it to true... for example it hides /System Volume Information/ under Windows 2000/XP.

Mettre à true pour cacher les fichiers qui ne peuvent pas être parcourus (par exemple sur un compte free, le répertoire mysql..., sur Windows 2000/XP, /System Volume Information/) Il est recommandé de le laisser à true

Default value : true

boolean $SECURITY_download_PHP_source (line 124)

Important !! Security for PHP downloads / Sécurité pour le téléchargement de fichiers PHP

If users can download a PHP file (if displayed), you have the choice to let him download the SOURCE or the RESULT of the PHP.
Be careful! if you let him download source, I'm not responsible if user can hack your site, retrieve your passwords...
If you don't know or don't understand what I said, set to false.

Si les utilisateurs peuvent télécharger les fichiers PHP (s'ils sont affichés), vous avez la possibilité de leur envoyer la SOURCE ou le RÉSULTAT de l'exécution du script.
Prudence ! si l'utilisateur peut télécharger la source, je ne suis en aucun cas responsable s'il peut hacker votre site, récupérer les mots de passe.
Si vous ne savez pas ou si vous ne comprenez pas ceci, mettez false.

Default value : false

string $DefaultDir (line 216)

Default directory / Répertoire par défaut

$DefaultDir is the "starting" directory showed when you launch PHPmyBrowser.
NOTE : Write directory path with / (slash) and not with \ (back-slash) !

For example $DefaultDir = '/var/www/mysite/pics/';.
On a public host (multimania...) if you don't know the complete path to place where is stored your website, you should leave $DefaultDir = '';. PHPmyBrowser will choose the directory where the script is installed (the starter index.php).

$DefaultDir est le répertoire "de départ" où l'on se situe au lancement du script.
NOTE : Écrire le répertoire avec des / (slash) et pas des \ (anti-slash) !

Exemple : $DefaultDir = '/var/www/monsite/images/'; Dans le cas d'un hébergeur (free, multimania) si on ne connaît pas le répertoire complet /var/www/free.fr/xx/m/o/n/s/monsite..., il est conseillé de mettre '' (chaine vide) le script prendra le répertoire où il est installé comme $DefaultDir.

Default value : ''

string $SECURITY_diskRoot (line 249)

The top-level directory that can be browsed / La racine des répertoires "browsables".

An example is simpler than a big explanation :-P

  1. On a public host (e.g. free.fr) 'mysite.free.fr' is in directory /var/www/free.fr/xx/m/y/s/i/mysite/.
  2. We've uploaded the script in .../mysite/phpmybrowser/.
  3. If browse up to default dir is enabled ($SECURITY_disableBrowseUpToDefaultDir = false), we can go to .../mysite/ but it's not useful to browse /var/www/free.fr because it's not redable (for security of course !).
  4. So we define the disk root-like (or website root if you prefer) to /var/www/..../mysite/.

If you leave $SECURITY_diskRoot = '' PHPmyBrowser automatically detect the root, it open parents dir while it returns no access error.

Un exemple vaut mieux qu'un long discours :-P

  • Sur free.fr, 'monsite.free.fr' se trouve dans /var/www/free.fr/xx/m/o/n/s/monsite/
  • On a uploadé le script dans .../monsite/phpmybrowser/.
  • On autorise de remonter dans l'arborescence ($SECURITY_disableBrowseUpToDefaultDir = false)
    donc on peut aller voir ...monsite/ mais c'est inutile d'aller voir /var/www/free.fr car on n'a pas les droits !
  • Donc on définit la pseudo racine du disque dur (ou plutôt du site) à /var/www/.../monsite/.

En laissant $SECURITY_diskRoot à blanc '' PHPmyBrowser détermine automatiquement la "racine" (il remonte les répertoires jusqu'à ce qu'il n'ai plus les droits de lecture...)

Default value : ''

string $TEMPLATE (line 279)

Choose the template you want ;-) / Choisissez le template désiré

Available templates :

  • default table
  • photo album
  • ...
The template file must be in templates directory, and have .php extension.
$TEMPLATE = 'MyTemplate' => file : templates/MyTemplate.php.
If filename is invalid, default will be used.

Templates disponible :

  • tableau classique
  • album photo
  • ...
Le fichier template doit être dans le répertoire templates et porter l'extension .php.
$TEMPLATE = 'MyTemplate' => fichier : templates/MyTemplate.php.
Si le nom de fichier est incorrect, default sera utilisé.

Default value : 'default', it replace the Apache listings, with more features :)

string $COMMENT_file (line 316)

Name of the XML file which contain comments / Nom du fichier XML contenant les commentaires

See comment.php for details.

Default value : 'PHPmyBrowserComments.xml'

boolean $COMMENT_allowAdminTexts (line 327)

Enable admin texts / Active les textes de l'administrateur

See comment.php for details.

Default value : true

boolean $COMMENT_allowUser (line 337)

Enable visitor' comments / Active les commentaires des visiteurs

See comment.php for details.

Default value : false

boolean $COMMENT_allowVote (line 351)

Enable voting system / Active le système de vote

More than writing comment on files, visitors can note them !

En plus d'écrire une appréciation sur les fichiers, les visiteurs peuvent y attribuer une note !

See comment.php for details.

Default value : true

boolean $COMMENT_enableSmilies (line 362)

Enable/Disable smilies in comments messages.

Set it to true if you want to transform :) or :( into images. :)

See smilies.php for more details

Default value : true

string $ClickAction1 (line 422)

What to do when user click on a file ? / Que faire quand on clique sur un fichier ?

What can we do ? / Qu'est-ce qui est possible ?

  • download / téléchargement
  • a JavaScript stuff / une fonction javascript
  • nothing (just a display...) / rien du tout
  • ...
In the loop, the function print_icon_name_link echo something like this :
Dans la boucle, la fonction print_icon_name_link écrit comme ceci :
  1. $ClickAction1 (<a href="...">)
  2. <img... icon />
  3. <img... a little blank seperator / un petit espace transparent />
  4. filename
  5. $ClickAction2 (</a>)

There are some predefined actions:
Il y a quelques actions prédéfinies :

  1. $ClickAction1 = 'download' : force the download of the file / force le téléchargement
  2. $ClickAction1 = '' : browse the file normally <a href="the_file"<</kbd> / ouvre le fichier habituellement (juste un lien)</li> <li><kbd>$ClickAction1 = 'display only' : display only, no links... / juste pour affichage, sans lien
  3. javascript:your_function[:(full|relative)] ... :
    • start with 'javascript:' / commence par 'javascript:'.
    • then write the name of your function (e.g.: 'alert' or a function you write in the PHPmyBrowserScript.js file). A click will alert(the_file).
      ensuite écrivez le nom de votre fonction (ex: 'alert' ou une fonction que vous avez écrite dans PHPmyBrowserScript.js). Un click provoque alert(the_file).
      If you want a function with more paramater, you have to write it yourself like below...
      Si vous avez une fonction plus complexe, vous devez écrire vous même $ClickAction1, voir plus bas.
    • optional,
      • 'relative' return the relative path between $DefaultDir and the current file.
        'relative' retourne la chemin relatif entre $DefaultDir et le fichier.
      • 'full' return the entire path of the clicked file. full is not yet implemanted.
        'full' retourne le chemin absolu du fichier. full n'est pas encore implémenté.
    • Enjoy ;-))
  4. else, keep in mind that the $ClickActionX is eval()ed so to help you, here's a tip:
    • first write :
      1. echo '<a href="whatyouwant.php?file='.urlencode($curr.$tabName[$k]).'&foo=bar" target="_blank">';
      2. echo '</a>';
    • and then add « $ClickAction1 = ' » at the start
    • add a « \ » before all quote « ' » => « \' »
    • and add « '; » at the end
    • so it's :
      1. $ClickAction1 = 'echo \'<a href="whatyouwant.php?file=\'.urlencode($curr.$tabName[$idx]).\'&foo=bar" target="_blank">\';';
      2. $ClickAction2 = 'echo \'</a>\';';
    • Another example, with a JavaScript function :
      1. $ClickAction1 = 'echo \'<a href="javascript:void(0)" onClick="alert(\\\'\'
      2. .addslashes(relativePath($curr).$tabName[$idx])
      3. .\'\\\');">\';';
      4. $ClickAction2 = 'echo \'</a>\';';
      replace the 'alert' with the function you want... and write your function in the PHPmyBrowserScript.js.

Default value : ''

string $ClickAction2 (line 434)

End of the $ClickAction1.

If $ClickAction1 is a predefined, $ClickAction2 will be set to </a>.

Si $ClickAction1 est une valeur prédéfinie, $ClickAction2 sera mis à </a>.

string $SECURITY_antiLeech (line 455)

Anti leech

If enabled, avoid direct url to download, rename, delete... or other action.
It means thaat the user must be first on that site to perform this.
If disabled, if anyone give you the url (in a forum for example) with &action=download&filename=one_file it will work.

Si activé, cette option oblige l'utilisateur a passé par le site pour télécharger, renommer, effacer... ou faire toute autre action sur les fichiers.
Si désactivé, si quelqu'un donne l'adresse (par exemple dans un forum) avec &action=download&file=un_fichier... ça marchera.

Default value : true

boolean $UPLOAD_enable (line 468)

true Allow upload, false disable it.

Default value : false

string $UPLOAD_forbiddenFiles (line 498)

Upload accepted/forbidden files

if $UPLOAD_acceptedFiles is not empty, the forbidden list of files format is ignored. but if $UPLOAD_acceptedFiles is empty, $UPLOAD_forbiddenFiles becomes important.

examples :

  1. $UPLOAD_forbiddenFiles = 'prog_php';
  2. $UPLOAD_acceptedFiles = '';
upload will accept all files but not PHP ones (see types.php for details of prog_php item)

  1. $UPLOAD_forbiddenFiles = 'prog_php';
  2. $UPLOAD_acceptedFiles = 'image';
upload will accept ONLY image files, and ignore the forbidden PHP files.

You can set severals file format, e.g. :

  1. $UPLOAD_acceptedFiles = 'jpg|gif';
or
  1. $UPLOAD_acceptedFiles = 'webimage|font|mp3|doc...';
or
  1. $UPLOAD_forbiddenFiles = 'prog_php|htm|html|executable';

If you want no restriction (all files accepted), set both to ''.

By default, $UPLOAD_forbiddenFiles = 'prog_php' and $UPLOAD_acceptedFiles = ''.

string $UPLOAD_acceptedFiles (line 502)

Upload accepted/forbidden files

if $UPLOAD_acceptedFiles is not empty, the forbidden list of files format is ignored. but if $UPLOAD_acceptedFiles is empty, $UPLOAD_forbiddenFiles becomes important.

examples :

  1. $UPLOAD_forbiddenFiles = 'prog_php';
  2. $UPLOAD_acceptedFiles = '';
upload will accept all files but not PHP ones (see types.php for details of prog_php item)

  1. $UPLOAD_forbiddenFiles = 'prog_php';
  2. $UPLOAD_acceptedFiles = 'image';
upload will accept ONLY image files, and ignore the forbidden PHP files.

You can set severals file format, e.g. :

  1. $UPLOAD_acceptedFiles = 'jpg|gif';
or
  1. $UPLOAD_acceptedFiles = 'webimage|font|mp3|doc...';
or
  1. $UPLOAD_forbiddenFiles = 'prog_php|htm|html|executable';

If you want no restriction (all files accepted), set both to ''.

By default, $UPLOAD_forbiddenFiles = 'prog_php' and $UPLOAD_acceptedFiles = ''.

int $UPLOAD_maxFileSize (line 516)

Maximal file size for upload.

0 set the value to the server upload_max_filesize var
> 0 set the value to lowest between $UPLOAD_maxFileSize and upload_max_filesize in php.ini (in Kilo Bytes)

Default value : 0

int $UPLOAD_nbFiles (line 524)

Number of file for simultaneous upload

Default value : 1

boolean $UPLOAD_overwrite (line 534)

Overwrite file when uploading ?

If false (by default!) then don't accept overwrite.

Default value : false

String $UPLOADIMG_convertTo (line 554)

A misc option that convert all uploaded images (gif, png, bmp) into $UPLOADIMG_convertTo format.

Allowed values : '', 'jpg', 'png', 'gif'.

If '' doesn't convert but resize if $UPLOADIMG_resizeWidth and $UPLOADIMG_resizeHeight are not 0.

Note that GD library may not support some format (GD > 1.6 doesn't support GIF).

If source or convert image format is not supported, source image will be upload without any conversion.
If destination format is not supported, image is resized but save in the same format.

Default value : ''

int $UPLOADIMG_resizeWidth (line 565)

A misc option that resize all uploaded images.

If one of $UPLOADIMG_resizeWidth or $UPLOADIMG_resizeHeight is 0 then there is no resize.

Default value : 0

int $UPLOADIMG_resizeHeight (line 576)

A misc option that resize all uploaded images.

If one of $UPLOADIMG_resizeWidth or $UPLOADIMG_resizeHeight is 0 then there is no resize.

Default value : 0

boolean $CREATEFOLDER_enable (line 586)

Set true to enable user to create a new folder.

Default value : false

int $CREATEFOLDER_maxLength (line 594)

You can set a max length for the new folder name. 0 = no limit.

Default value : 50

string $LOG_file (line 609)

Log file

Log file is writed in custom folder.

Default value : 'PHPmyBrowser.log'. Set it to '' to disable log system.

boolean $LOG_browse (line 617)

Log each time a folder is browsed

Default value : false

boolean $LOG_download (line 625)

Log each download

Default value : false

boolean $LOG_upload (line 633)

Log each upload

Default value : true

boolean $LOG_comment (line 641)

Log when visitor add a comment

Default value : false

boolean $LOG_leech (line 649)

Log each leech, referer, IP....

Default value : true;

boolean $NEW_enable (line 665)

If enabled, display a "new" symbol/pic (new.gif) next to file names if files are new.

Default value : true

int $NEW_delay (line 676)

Number of day files must be younger to be marked as "new"

if 0, PHPmyBrowser set a cookie to remember date of last visit :) if > 0, display "NEW" if file is "younger" than $NEW_delay days

Default value : 0

boolean $SORT_folderOnTop (line 688)

Folder on top / Afficher les répertoires en premier

false = do not display folder on top of the list (like apache listings) true = display folder on top of the list (like in windows explorer) false = affiche les répertoires au milieu des fichiers (comme dans apache) true = affiche les répertoire au début de la liste (comme dans l'explorateur windows)

Default value : true

boolean $SORT_folderOnTopEvenOnDesc (line 704)

Set folder on top even when desc order / Met les répertoires en tête, même en ordre descandant

In Windows explorer, when you select desc order, folders are at the end of the list. Set this to false to display folder at the end. Set it to true if you prefer folder always on top

Dans l'Explorateur Windows, lors d'un tri par ordre inversé, les répertoires sont affichés en bas de la liste. Mettre à false pour faire pareil, mettre à true pour afficher les répertoires toujours en tête de liste.

Default value (clever than 'dows Explorer ^^) : true

string $SORT_defaultCriteria (line 726)

Default sort criteria / Critère tri par défaut

The list can be sorted by the user, but by default you can choose criteria and order (e.g. date, desc).
La liste peut être triée par l'utilisateur, mais par défaut vous pouvez choisir un critère et un ordre (par exemple par date, descendant).

See $SORT_defaultOrder for the default sort order.

Accepted values :

  • 'n' => Name/Nom ;
  • 's' => Size/Taille ;
  • 'd' => Date ;
  • 't' => Type ;
  • 'h' => Hit (number of download) ;
Default value : 'n', by Name

string $SORT_defaultOrder (line 740)

Default sort order

See $SORT_defaultCriteria for the default sort criteria.

Accepted values :

  • 'asc' ;
  • 'desc'.
Default value : 'asc', Ascendant.

boolean $SORT_allowChange (line 753)

Allow user to change the sort order ?

if set to false, user can't change the sort order/criteria (no links to change, no accepted parameters in URL).

Default value : true.

boolean $HITS_countDownloads (line 764)

Count the number of downloads.

Enable or disable the count download feature.
In your template, you can use

  1. print_sort_link('h');

Default value : false.

string $HITS_file (line 775)

File where number of download are stored.

This is a simple text file with filename|hits on each line.

Default value : 'PHPmyBrowserCount.cnt'

boolean $LIST_hideKnownExtension (line 783)

Hide file extensions when file format is known, or always show ?

Default value : false. Extensions are not hidden.

boolean $LIST_displayFolderSize (line 799)

Display folder size / Affiche la taille d'un répertoire

Be careful, this option may be time consuming if you turn it true.
If false, don't display size for folders.
If true, calculates the size of folder and subfolders.

Attention, si cette option est activée, elle peut consommer beaucoup de ressources !
Désactivée, aucune taille n'est affichée.
Activée, elle affiche la taille d'un répertoire et de ses sous-répertoires.

Default value : false.

boolean $LIST_displayParentFolderLabel (line 807)

Display [Parent Folder] next to '..' ? / Affiche [Répertoire Parent] à côté de '..' ?

Default value : true

bool $ShowExecutionTime (line 819)

Show execution time / Affiche le temps d'éxecution de la page

Display "Page generated in x.xx second".

Affiche "Page générée en x.xx secondes".

Default value : false;

int $LIST_fileSizeFormat (line 839)

Number format for file size / Format des nombres pour la taille des fichiers

Accepted values :

  • 1 :
    display all sizes in KB (Kilo Bytes)
    Affiche toutes les tailles en Ko (Kilo octet)
    English : 7,057.0 KB / Français : 7 057,0 Ko.
  • 2 :
    display more precise size (in bytes, kilo, mega...) but a bit hard to read
    Affiche avec plus de précision (o, Ko, Mo...) mais moins facile à lire
    258 MB - 20.0 MB - 5.00 MB - 881 KB - 20.1 KB - 2.07 KB - 123 B...
  • 0 :
    AUTO. Each file size in mode 1 / taille de chaque fichier en mode 1
    Total dir size in mode 2 / taille totale du répertoire en mode 2
    Max upload size in mode 2 / taille maxi d'upload en mode 2

Default value : 0. The clever, like in Windows explorer.

boolean $ADDON_enable (line 855)

Enable the add-ons.

If enable, PHPmyBrowser will execute add-ons.

Default value : true

boolean $ADDON_allowDirectPreview (line 866)

Enable or disable the display of thumbnails images or myriad plug-in... in the listing page.

If add-on is well coded ;-p it should take care of this variable, and display directly in the page if true, else only in popup.

Default value : true

int $IMG_maxSize (line 892)

Add-on "images" : image maximal file size. If greater create thumbnails

If you want to display directly in the page images (or thumbnails) in the page, see $ADDON_allowDirectPreview.

It's possible to limit (file size or image measurement) to filter images that'll be displayed directly, because of slow modems...

If filesize > $IMG_maxSize, or dimensions > $IMG_maxWidth x $IMG_maxHeight, then image will not be displayed directly, but in popup.
Depending on $IMG_displayThumbnail value, the page will display a little icon or a thumbnail and on click it opens popup.

If you want no image in the page (all in popup), set all values to 0 or turn $ADDON_allowDirectPreview to false.

  Default value : 20 (in Kilo Bytes)

int $IMG_maxWidth (line 899)

Add-on "images" : image maximal width. If greater create thumbnails

If you want to display directly in the page images (or thumbnails) in the page, see $ADDON_allowDirectPreview.

It's possible to limit (file size or image measurement) to filter images that'll be displayed directly, because of slow modems...

If filesize > $IMG_maxSize, or dimensions > $IMG_maxWidth x $IMG_maxHeight, then image will not be displayed directly, but in popup.
Depending on $IMG_displayThumbnail value, the page will display a little icon or a thumbnail and on click it opens popup.

If you want no image in the page (all in popup), set all values to 0 or turn $ADDON_allowDirectPreview to false.

  Default value : 65 (in pixels)

int $IMG_maxHeight (line 906)

Add-on "images" : image maximal height. If greater create thumbnails

If you want to display directly in the page images (or thumbnails) in the page, see $ADDON_allowDirectPreview.

It's possible to limit (file size or image measurement) to filter images that'll be displayed directly, because of slow modems...

If filesize > $IMG_maxSize, or dimensions > $IMG_maxWidth x $IMG_maxHeight, then image will not be displayed directly, but in popup.
Depending on $IMG_displayThumbnail value, the page will display a little icon or a thumbnail and on click it opens popup.

If you want no image in the page (all in popup), set all values to 0 or turn $ADDON_allowDirectPreview to false.

  Default value : 65 (in pixels)

boolean $IMG_displayThumbnail (line 913)

Add-on "images" : do you want thumbnails ?

If you want to display directly in the page images (or thumbnails) in the page, see $ADDON_allowDirectPreview.

It's possible to limit (file size or image measurement) to filter images that'll be displayed directly, because of slow modems...

If filesize > $IMG_maxSize, or dimensions > $IMG_maxWidth x $IMG_maxHeight, then image will not be displayed directly, but in popup.
Depending on $IMG_displayThumbnail value, the page will display a little icon or a thumbnail and on click it opens popup.

If you want no image in the page (all in popup), set all values to 0 or turn $ADDON_allowDirectPreview to false.

  Default value : true (enable thumbnails)

int $MYRIAD_maxFileSize (line 930)

Add-on Myriad music plug-in : max file size.

Display in the page (if $ADDON_allowDirectPreview is true) and if .mus/.mu3/.myr file size is lighter than $MYRIAD_maxFileSize, using $MYRIAD_pluginParams plug-in parameters, else display in popup.
Highly recommanded to set $MYRIAD_maxFileSize to 0 (=> all in popup) if directory contain a lot of myriad file, it takes a bit of time to load each Myriad plug-in...
If displayed in popup, plug-in parameters are $MYRIAD_pluginParamsInPopup, and you can set the popup size $MYRIAD_pluginHeight x $MYRIAD_pluginWidth.

Default value : 0, in KB.

string $MYRIAD_pluginParamsInPopup (line 948)

Params for Myriad plug-in, when in popup.

By default it display the score and buttons, and start automatically to play the music.

int $MYRIAD_pluginHeight (line 955)

Myriad plug-in popup height

int $MYRIAD_pluginWidth (line 962)

Myriad plug-in popup width

int $FONTPREVIEW_imageWidth (line 972)

Plug-in Font Preview : image width

This plug-in show a preview of a TTF font, in a image in popup, set the size of the popup.

Default value : 400

int $FONTPREVIEW_imageHeight (line 981)

Plug-in Font Preview : image height

This plug-in show a preview of a TTF font, in a image in popup, set the size of the popup.

Default value : 200

array $FONTPREVIEW_backgroundColor (line 993)

Plug-in Font Preview : background color

Set the colors you want for text and background.
array(0,0,0) is black, array(255,255,255) is white.

Default value : array(13,10,43)

array $FONTPREVIEW_textColor (line 1004)

Plug-in Font Preview : text color

Set the colors you want for text and background.
array(0,0,0) is black, array(255,255,255) is white.

Default value : array(223,255,255)

Documentation generated on Sat, 28 Aug 2004 16:53:04 +0200 by phpDocumentor 1.3.0RC3