post_config.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. # ***** BEGIN LICENSE BLOCK *****
  3. # This file is part of DotClear.
  4. # Copyright (c) 2004 Olivier Meunier and contributors. All rights
  5. # reserved.
  6. #
  7. # DotClear is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # DotClear is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with DotClear; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. #
  21. # ***** END LICENSE BLOCK *****
  22. /* --------------------------------------------------------
  23. DO NOT EDIT THIS FILE
  24. NE PAS EDITER CE FICHIER
  25. -------------------------------------------------------- */
  26. #Version de DotClear
  27. if (file_exists(dirname(__FILE__).'/../VERSION')) {
  28. define('DC_VERSION',trim(implode('',file(dirname(__FILE__).'/../VERSION'))));
  29. } else {
  30. define('DC_VERSION','?');
  31. }
  32. # Lancement des session si besoin
  33. define('DC_SESSION_NAME','dc_xd');
  34. if (defined('DC_START_SESSION') && !defined('DC_NO_SESSION')) {
  35. require dirname(__FILE__).'/session.php';
  36. }
  37. # Chargement du fichier ini
  38. require_once dirname(__FILE__).'/classes/class.ini.file.php';
  39. iniFile::read(dirname(__FILE__).'/../conf/dotclear.ini');
  40. # dc_img_root
  41. if (!defined('dc_img_path')) {
  42. define('dc_img_root',$_SERVER['DOCUMENT_ROOT'].'/'.dc_img_url);
  43. } elseif (strpos(dc_img_path,'/') === 0) {
  44. define('dc_img_root',dc_img_path);
  45. } else {
  46. define('dc_img_root',$_SERVER['DOCUMENT_ROOT'].'/'.dc_img_path);
  47. }
  48. # Chargement du layout d'URL
  49. if (dc_url_scan == 'path_info')
  50. {
  51. if (!defined('dc_format_post_url')) { define('dc_format_post_url','%04d/%02d/%02d/%d-%s'); }
  52. if (!defined('dc_format_cat_url')) { define('dc_format_cat_url','%s'); }
  53. if (!defined('dc_format_archive_url')) { define('dc_format_archive_url','%s/%02d'); }
  54. if (!defined('dc_format_day_url')) { define('dc_format_day_url','%s/%02d/%02d'); }
  55. }
  56. elseif (dc_url_scan == 'query_string')
  57. {
  58. if (!defined('dc_format_post_url')) { define('dc_format_post_url','?%04d/%02d/%02d/%d-%s'); }
  59. if (!defined('dc_format_cat_url')) { define('dc_format_cat_url','?%s'); }
  60. if (!defined('dc_format_archive_url')) { define('dc_format_archive_url','?%s/%02d'); }
  61. if (!defined('dc_format_day_url')) { define('dc_format_day_url','?%s/%02d/%02d'); }
  62. }
  63. else
  64. {
  65. if (!defined('dc_format_post_url')) { define('dc_format_post_url','%04d/%02d/%02d/%d-%s'); }
  66. if (!defined('dc_format_cat_url')) { define('dc_format_cat_url','%s'); }
  67. if (!defined('dc_format_archive_url')) { define('dc_format_archive_url','%s/%02d'); }
  68. if (!defined('dc_format_day_url')) { define('dc_format_day_url','%s/%02d/%02d'); }
  69. }
  70. # Chargement des locales
  71. if (!empty($_SESSION['sess_user_lang'])) {
  72. define('DC_LANG',$_SESSION['sess_user_lang']);
  73. } else {
  74. define('DC_LANG',dc_default_lang);
  75. }
  76. require_once dirname(__FILE__).'/libs/lib.l10n.php';
  77. l10n::init();
  78. # On vérifier si le fichie UPDATE est modifiable
  79. define('DC_UPDATE_FILE',dirname(__FILE__).'/../conf/UPDATE');
  80. if (defined('DC_UPDATE_FILE') && is_writable(DC_UPDATE_FILE)) {
  81. define('DC_UPDATE_FILE_W',true);
  82. }
  83. # Répertoire share
  84. define('DC_SHARE_DIR',dirname(__FILE__).'/../share');
  85. ?>