[ Index ]
 

Code source de Dotclear 1.2.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/install/ -> ini-file.php (source)

   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  define('STEP',6);
  24  require dirname(__FILE__).'/prepend.php';
  25  
  26  $p_location = preg_replace('|/install/ini-file.php$|','',$_SERVER['REQUEST_URI']);
  27  $p_blog_name = __('My first weblog');
  28  $p_url_scan = 'query_string';
  29  
  30  # Liste des url_scan
  31  $url_scan_list = array(
  32      'Query string' => 'query_string',
  33      'Path info' => 'path_info'
  34  );
  35  
  36  $done = false;
  37  $err = '';
  38  
  39  if (!empty($_POST['inifile'])) {
  40      $p_location = trim($_POST['p_location']);
  41      $p_blog_name = trim($_POST['p_blog_name']);
  42      $p_url_scan = trim($_POST['p_url_scan']);
  43      
  44      # Création de conf/dotclear.ini
  45      $ini_file = dirname(__FILE__).'/../conf/dotclear.ini';
  46      copy($ini_file.'.in',$ini_file);
  47      @unlink($ini_file.'.in');
  48      chmod($ini_file,0666);
  49      
  50      $objIni = new iniFile(dirname(__FILE__).'/../conf/dotclear.ini');
  51      
  52      if ($p_url_scan == 'path_info') {
  53          $objIni->editVar('dc_blog_url',$p_location.'/index.php/');
  54      } else {
  55          $objIni->editVar('dc_blog_url',$p_location.'/index.php');
  56      }
  57      
  58      $objIni->editVar('dc_app_url',$p_location);
  59      $objIni->editVar('dc_blog_rss',$p_location.'/rss.php');
  60      $objIni->editVar('dc_blog_atom',$p_location.'/atom.php');
  61      $objIni->editVar('dc_trackback_uri',$p_location.'/tb.php');
  62      $objIni->editVar('dc_img_url',$p_location.'/images/');
  63      
  64      $objIni->editVar('dc_blog_name',$p_blog_name);
  65      $objIni->editVar('dc_url_scan',$p_url_scan);
  66      $objIni->editVar('dc_encoding',ENCODING);
  67      
  68      if ($objIni->saveFile() === false) {
  69          $err = '<p class="important">'.__('Unable to write dotclear.ini').'</p>';
  70      } else {
  71          $done = true;
  72          $ses->reg('step',7);
  73      }
  74  }
  75  
  76  require dirname(__FILE__).'/__top.php';
  77  
  78  echo '<h2>'.__('Blog configuration').'</h2>';
  79  
  80  echo $err;
  81  
  82  if ($done)
  83  {
  84      echo '<p>'.__('Weblog successfully configured').'</p>';
  85      echo
  86      '<form action="end-install.php" method="post">'.
  87      '<p><input type="submit" class="submit" value="'.__('End installation').' &#187;" /></p>'.
  88      '</form>';
  89  }
  90  else
  91  {
  92      echo
  93      '<form action="ini-file.php" method="post">'.
  94      '<p>'.sprintf(__('DotClear needs to know in which directory it has been '.
  95      'installed. For example, if DotClear has been installed in %s/dotclear, '.
  96      'then please type "/dotclear" in the field below:'),$_SERVER['HTTP_HOST']).'</p>'.
  97      '<p class="field"><label class="float" for="p_location">'.__('DotClear location').' :</label> '.
  98      form::field('p_location',30,512,$p_location).'</p>'.
  99      
 100      '<p class="field"><label class="float" for="p_blog_name">'.__('Your blog\'s name').' :</label> '.
 101      form::field('p_blog_name',30,255,$p_blog_name).'</p>'.
 102      
 103      '<p class="field">'.__('Your blog archive addresses (permalinks) may be '.
 104      'displayed in various formats. The "Query string" URLs will be displayed '.
 105      'as "index.php?/2002/04". The "Path info" URLs will be displayed as '.
 106      '"index.php/2002/04" (preferred method for search engine optimization). '.
 107      'And the "Get" URLs will be displayed as "index.php?d=2002/04" (only for '.
 108      'mod_rewrite fans).').'</p>'.
 109      '<p>'.__('Please note that "Path info" type could be broken on some Web '.
 110      'hosting configurations.').'</p>'.
 111      '<p class="field"><label class="float" for="p_url_scan">'.__('URLs format').' :</label> '.
 112      form::combo('p_url_scan',$url_scan_list,$p_url_scan).'</p>'.
 113      '<p><input type="submit" class="submit" value="'.__('Save').' &#187;" />'.
 114      form::hidden('inifile',1).'</p>'.
 115      '</form>';
 116  }
 117  ?>
 118  
 119  <?php require dirname(__FILE__).'/__bottom.php'; ?>


Généré le : Fri Feb 23 21:40:15 2007 par Balluche grâce à PHPXref 0.7