File/pays/flags/index.php

Description

Welcome to PHPmyBrowser documentation !

Structure of PHPmyBrowser

Here is a quick summary on how PHPmyBrowser works :

  • An index PHP launch PHPmyBrowser
  • The engine :
    • read configs files ;
    • if a plugin (download, upload, comment, convert...) is called by form or url, call it ;
    • retrieve a list of the files in the current folder (with some restrictions if you want) ;
    • call what I called the "Add-Ons Files" ;
    • sort this list
    • call a template.
  • Template outputs the HTML page. As templates are PHP/HTML pages, you can really do what you want with templates, a lot of functions will help you.
  • Some of the plug-ins included in the downloaded package are :



This page is the "launcher". Read it to know how to start using PHPmyBrowser.

You can rename it browse.php or anything else if you want. You'll call http://www.yoursite.com/folder/<this_page>.php?...

This page tells PHP where is PHPmyBrowser folder, and your customized folder.

In this example, we consider we want to use PHPmyBrowser engine in various place in our site :

  • a photo gallery of you holidays (in /holidays folder) ;
  • a smiley picker for your little forum (in /forum/smile folder) ;
  • and a F.A.Q. (in /faq folder).
Yes! you can do all these things with PHPmyBrowser ! :-)

What to do ?

  1. download and unzip PHPmyBrowser zip archive ;
  2. upload PHPmyBrowser folder content to /phpmybrowser on your website ;
  3. For each application where you want to use PHPmyBrowser, upload PHPmyBrowserCustom on your website, e.g. in /faq/pmbcustom, /forum/smile/pmbcustom...
  4. In /faq, /forum/smile and /holidays upload this file after some little changes.

Before I tell you what changes to do, I must explain what is "Custom" folder !

What is Custom folder ?

I _highly_ recommand to change nothing in the /phpmybrowser folder, so future updates will be easier : they'll replace files in /phpmybrowser without changing your custom settings.

The default config config.php offer you the best security and the more common options but you may want to change them. So create a new config.php in one custom folder and write in it the vars you want to change.

PHPmyBrowser looks first in global /phpmybrowser/config.php and after in pmbcustom/config.php. All files works like that, template, css, icons, translations... So if you want to use default template but change the uggly icon for html files, just create your 16x16 icon _html.gif in pmbcustom/template/default/ico.

All files works like that. If you want to change one of them (code, template, translation...) copy it into custom folder, recreate the same path if needed.

and index.php (this file) content ?

In this file, you tell PHP where is main PHPmyBrowser folder (/phpmybrowser) :

  1. $PHPmyBrowserFolder = 'PHPmyBrowser/';
NOTE : Use relative path and be careful, paths are case sensitive !

Following our example, in /faq/index.php, $PHPmyBrowserFolder = '../phpmybrowser/';,
in /holidays/index.php, that's the same,
and in /forum/smile/index.php, $PHPmyBrowserFolder = '../../phpmybrowser/';.

Now tell PHP where is you custom folder : in all our examples, we create the custom folder in same folder than index file (./), so :

  1. $PHPmyBrowserCustom = 'pmbcustom/';
NOTE : Use relative path too !

Administration ?

PHPmyBrowser is not delivered with an authorisiation script. You can then include PHPmyBrowser in your content generator, your intranet or any protected area... How ?

The only thing to do, is to set $adminPHPmyBrowser to false (default) if you don't want to be administrator, and set it to true when you want admin rights.

You can then write in this file a little test.

  1. if (your_function_to_test_if_user_is_registered())
  2. $adminPHPmyBrowser = true;
In config.php you'll find how to create separate configs for admins and users.

Constants
PHPmyBrowser = 'ok' (line 137)

Just one constant to avoid hacking.

All PHP files included by PHPmyBrowser detect if this constant is set.

  1. if (PHPmyBrowser != 'ok')
  2. {
  3. echo 'Hacking attempt!<br/>Qu\'est-ce que tu fous ici ?';
  4. exit;
  5. }

DO NOT CHANGE/REMOVE THIS LINE !!! - NE PAS CHANGER/SUPPRIMER CETTE LIGNE !!!

Variables
string $PHPmyBrowserFolder (line 151)

Relative path to main PHPmyBrowser engine folder. Read the top of this page for more information.

string $PHPmyBrowserCustom (line 164)

Relative path to your custom folder. Read the top of this page for more information.

boolean $adminPHPmyBrowser (line 174)

Boolean you can set to true to activate administrator rights, use your own login script, or include it in another application / CMS...

Read the top of this page for more information.

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