Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /* **************************************************************************
  3. * index.php
  4. ***************************************************************************/
  5.  
  6. /* **************************************************************************
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details: <http://www.gnu.org/licenses/gpl.txt>
  17. *
  18. ***************************************************************************/
  19.  
  20. /**
  21. * Welcome to PHPmyBrowser documentation !
  22. *
  23. * <var>Structure of PHPmyBrowser</var>
  24. *
  25. * Here is a quick summary on how PHPmyBrowser works :
  26. * <ul><li>An index PHP launch PHPmyBrowser</li>
  27. * <li>The engine :
  28. * <ul><li>read {@link config.php configs} files ;</li>
  29. * <li>if a plugin (download, upload, comment, convert...) is called by form or url, call it ;</li>
  30. * <li>retrieve a list of the files in the current folder (with some restrictions if you want) ;</li>
  31. * <li>call what I called the "{@link file.php Add-Ons Files}" ;</li>
  32. * <li>sort this list</li>
  33. * <li>call a {@link default.php template}.</li></ul></li>
  34. * <li>Template outputs the HTML page. As templates are PHP/HTML pages, you can really do what you want with
  35. * templates, a lot of {@link functions.php functions} will help you.</li>
  36. * <li>Some of the plug-ins included in the downloaded package are :
  37. * <ul><li>{@link comment.php}: Add comments (visitor or administrator) on files, or everywhere in the page ;</li>
  38. * <li>{@link download.php}: Force download ;</li>
  39. * <li>{@link upload.php}: Enhanced upload script...</li></ul>
  40. * </li></ul>
  41. *
  42. * <br/><br/>
  43. *
  44. * <b>This page is the "launcher". Read it to know how to start using PHPmyBrowser.</b>
  45. *
  46. * You can rename it <kbd>browse.php</kbd> or anything else if you want.
  47. * You'll call http://www.yoursite.com/folder/<this_page>.php?...
  48. *
  49. * This page tells PHP where is PHPmyBrowser folder, and your customized folder.
  50. *
  51. * In this example, we consider we want to use PHPmyBrowser engine in various place in our site :
  52. * - a photo gallery of you holidays (in <kbd>/holidays</kbd> folder) ;
  53. * - a smiley picker for your little forum (in <kbd>/forum/smile</kbd> folder) ;
  54. * - and a F.A.Q. (in <kbd>/faq</kbd> folder).
  55. * Yes! you can do all these things with PHPmyBrowser ! :-)
  56. *
  57. * <var>What to do ?</var>
  58. * <ol><li>download and unzip PHPmyBrowser zip archive ;
  59. * <li>upload <kbd>PHPmyBrowser</kbd> folder content to <kbd>/phpmybrowser</kbd> on your website ;
  60. * <li>For each application where you want to use PHPmyBrowser, upload <kbd>PHPmyBrowserCustom</kbd>
  61. * on your website, e.g. in <kbd>/faq/pmbcustom</kbd>, <kbd>/forum/smile/pmbcustom</kbd>...
  62. * <li>In <kbd>/faq</kbd>, <kbd>/forum/smile</kbd> and <kbd>/holidays</kbd> upload this file
  63. * after some little changes.
  64. * </ol>
  65. *
  66. *
  67. * Before I tell you what changes to do, I must explain what is "Custom" folder !
  68. *
  69. *
  70. * <var>What is Custom folder ?</var>
  71. *
  72. * I _highly_ recommand to change nothing in the <kbd>/phpmybrowser</kbd> folder, so future
  73. * updates will be easier : they'll replace files in <kbd>/phpmybrowser</kbd> without changing
  74. * your custom settings.
  75. *
  76. * The default config {@link config.php} offer you the best security and the more common options
  77. * but you may want to change them. So create a new <kbd>config.php</kbd> in one custom folder
  78. * and write in it the vars you want to change.
  79. *
  80. * PHPmyBrowser looks first in global <kbd>/phpmybrowser/config.php</kbd> and after in
  81. * <kbd>pmbcustom/config.php</kbd>. All files works like that, template, css, icons,
  82. * translations... So if you want to use default template but change the uggly icon for html
  83. * files, just create your 16x16 icon <kbd>_html.gif</kbd> in
  84. * <kbd>pmbcustom/template/default/ico</kbd>.
  85. *
  86. * All files works like that. If you want to change one of them (code, template, translation...) copy it into
  87. * custom folder, recreate the same path if needed.
  88. *
  89. *
  90. * <var>and index.php (this file) content ?</var>
  91. *
  92. * In this file, you tell PHP where is main PHPmyBrowser folder (<kbd>/phpmybrowser</kbd>) :
  93. * <code>$PHPmyBrowserFolder = 'PHPmyBrowser/';</code>
  94. * NOTE : Use <b>relative</b> path and be careful, paths are case sensitive !
  95. *
  96. * Following our example, in <kbd>/faq/index.php</kbd>, <kbd>$PHPmyBrowserFolder = '../phpmybrowser/';</kbd>,<br/>
  97. * in <kbd>/holidays/index.php</kbd>, that's the same,<br/>
  98. * and in <kbd>/forum/smile/index.php</kbd>, <kbd>$PHPmyBrowserFolder = '../../phpmybrowser/';</kbd>.
  99. *
  100. * Now tell PHP where is you custom folder : in all our examples, we create the custom folder
  101. * in same folder than index file (<kbd>./</kbd>), so :
  102. * <code>$PHPmyBrowserCustom = 'pmbcustom/';</code>
  103. * NOTE : Use relative path too !
  104. *
  105. *
  106. * <var>Administration ?</var>
  107. *
  108. * PHPmyBrowser is not delivered with an authorisiation script. You can then include PHPmyBrowser
  109. * in your content generator, your intranet or any protected area... How ?
  110. *
  111. * The only thing to do, is to set <kbd>$adminPHPmyBrowser</kbd> to <kbd>false</kbd> (default)
  112. * if you don't want to be administrator, and set it to <kbd>true</kbd> when you want admin rights.
  113. *
  114. * You can then write in this file a little test.
  115. * <code> if (your_function_to_test_if_user_is_registered())
  116. * $adminPHPmyBrowser = true;</code>
  117. * In {@link config.php} you'll find how to create separate configs for admins and users.
  118. *
  119. * @author Sylvain Machefert <iubito@users.sourceforge.net>
  120. * @copyright Copyright (C) 2004, Sylvain Machefert
  121. * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License
  122. * @package PHPmyBrowser
  123. */
  124.  
  125. /**
  126. * Just one constant to avoid hacking.
  127. *
  128. * All PHP files included by PHPmyBrowser detect if this constant is set.
  129. * <code> if (PHPmyBrowser != 'ok')
  130. * {
  131. * echo 'Hacking attempt!<br/>Qu\'est-ce que tu fous ici ?';
  132. * exit;
  133. * }</code>
  134. *
  135. * DO NOT CHANGE/REMOVE THIS LINE !!! - NE PAS CHANGER/SUPPRIMER CETTE LIGNE !!!
  136. */
  137. define('PHPmyBrowser', 'ok');
  138.  
  139. //*******************************************************************************
  140. //<Configuration>
  141. //*******************************************************************************
  142.  
  143. //Répertoire contenant les autres fichiers de PHPmyBrowser : le css, images, add-ons
  144. //Relative path of the directory which contain PHPmyBrowser main script, CSS, images, add-ons...
  145. //by default/valeur par défaut
  146. //$PHPmyBrowserFolder = 'PHPmyBrowser/';
  147.  
  148. /**
  149. * Relative path to main PHPmyBrowser engine folder. Read the top of this page for more information.
  150. * @global string $PHPmyBrowserFolder
  151. */
  152. $PHPmyBrowserFolder = '../../PHPmyBrowser/';
  153.  
  154. //Répertoire pour les fichiers qui sont variables
  155. //Le moteur (script principal, types, icônes, add-on) est placé à un endroit du site
  156. //par exemple /PHPmyBrowser
  157. //et on peut s'en servir dans plusieurs pages, mais avec des variantes, par exemple
  158. //chaque installation peut "browser" un répertoire différent, avoir un CSS différent
  159. //avoir une config différente
  160. //Default: $PHPmyBrowserCustom = 'PHPmyBrowserCustom/';
  161.  
  162. /**
  163. * Relative path to your custom folder. Read the top of this page for more information.
  164. * @global string $PHPmyBrowserCustom
  165. */
  166. $PHPmyBrowserCustom = 'PHPmyBrowserCustom/';
  167.  
  168. //Set your admin system, PHPmyBrowser can be include in another script which
  169. //have its own admin system
  170.  
  171. /**
  172. * Boolean you can set to <kbd>true</kbd> to activate administrator rights, use your own
  173. * login script, or include it in another application / CMS...
  174. * Read the top of this page for more information.
  175. * @global boolean $adminPHPmyBrowser
  176. */
  177. $adminPHPmyBrowser = false;
  178. $adminPHPmyBrowser = true;
  179.  
  180.  
  181. //*******************************************************************************
  182. //</Configuration>
  183. //*******************************************************************************
  184.  
  185.  
  186.  
  187. /**
  188. * @ignore
  189. */
  190. include($PHPmyBrowserFolder.'main.php');
  191. ?>

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