X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fglobals.inc.php.in;h=1e15c817f455a3acdc616aefaca9d0d1eaf67d15;hb=47fa97fed308292ab5e7bed6f870b39f55747aa8;hp=0554899353adb27785a2c751f4d1b447923aead7;hpb=32d9ae72ae511acf33d9d0606bba0c347e8d37f0;p=platal.git diff --git a/include/globals.inc.php.in b/include/globals.inc.php.in index 0554899..1e15c81 100644 --- a/include/globals.inc.php.in +++ b/include/globals.inc.php.in @@ -1,6 +1,6 @@ session = $sess; + public $dbdb = 'x4dat'; + public $dbhost = 'localhost'; + public $dbuser = 'x4dat'; + public $dbpwd = 'x4dat'; + public $dbcharset = 'utf8'; - $base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://'; - $this->baseurl = trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/'); - $this->spoolroot = dirname(dirname(__FILE__)); - - $this->read_config(); - $this->setlocale(); - - require_once dirname(__FILE__) . '/../classes/xdb.php'; - XDB::connect($this->dbhost, $this->dbuser, $this->dbpwd, $this->dbdb, 'utf8', $this->debug); - } - - function read_ini_file($filename) - { - $array = parse_ini_file($filename, true); - if (!is_array($array)) { - return; - } - foreach ($array as $cat => $conf) { - $c = strtolower($cat); - foreach ($conf as $k => $v) { - if ($c == 'core' && property_exists($this, $k)) { - $this->$k=$v; - } else { - if (!isset($this->$c)) { - $this->$c = new stdClass; - } - $this->$c->$k = $v; - } - } - } - } - - function read_config() - { - $this->read_ini_file($this->spoolroot.'/configs/platal.ini'); - - $this->read_ini_file($this->spoolroot.'/configs/platal.conf'); - } + /** default skin */ + public $skin; + public $register_skin; - function setlocale() + public function __construct() { - setlocale(LC_MESSAGES, $this->locale); - setlocale(LC_TIME, $this->locale); - setlocale(LC_CTYPE, $this->locale); - date_default_timezone_set($this->timezone); + parent::__construct(array('platal.ini', 'platal.conf')); + $this->bootstrap(array('NbIns'), 'update_NbIns'); + $this->bootstrap(array('NbValid'), 'update_NbValid'); } - function asso($key=null) + public function asso($key=null) { static $aid = null; @@ -102,7 +53,9 @@ class PlatalGlobals } if ($gp) { - $res = XDB::query('SELECT a.*, d.nom AS domnom + $res = XDB::query('SELECT a.*, d.nom AS domnom, + FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc, + FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub FROM groupex.asso AS a LEFT JOIN groupex.dom AS d ON d.id = a.dom WHERE diminutif = {?}', $gp);