root/trunk/includes/includes.inc.php

Revision 16, 2.2 KB (checked in by alexx, 7 years ago)
  • cleanup crapy code in dotnode-xml.php
  • include new Smarty_dotnode object to fix #14
  • modify reset_data.sh bash script to fix log problem
  • remove hardcoded ini_set error_log in config (it must bi fixed in vhost, or if not possible: in config_server.inc.php
  • fix impossibility to change language in dotpage (cookie name not set correctly)
Line 
1<?php
2/****************************************************** Open .node ***
3 * Description:   
4 * Status:        Stable.
5 * Author:        Alexandre Dath <alexandre@dotnode.com>
6 * $Id$
7 *
8 * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25include('config.inc.php');
26
27include('Mail.php'); // PEAR
28
29include('DB.php'); // PEAR
30
31include('smarty.inc.php');
32include('functions.inc.php');
33
34// To handle difference in PHP_SELF under Apache1 and Apache2
35if( ereg("\?", $_SERVER['REQUEST_URI']) )
36    list($_SERVER['PHP_SELF']) = split("\?", $_SERVER['REQUEST_URI']);
37else
38    $_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'];
39
40if(valid_lang(normalize_lang($_COOKIE['lang'])))
41{
42    $lang = normalize_lang($_COOKIE['lang']);
43}
44elseif($_SERVER['HTTP_ACCEPT_LANGUAGE'])
45{
46    $accepted_language = get_pref_language_array($_SERVER['HTTP_ACCEPT_LANGUAGE']);
47    foreach($accepted_language as $language)
48    {
49        list($lang) =  split('-',$language);
50        if(valid_lang(normalize_lang($lang)))
51        {
52            $lang = normalize_lang($lang);
53            break;
54        }
55    }
56}
57
58if(!isset($lang))
59{
60    $lang = 'en_US';
61}
62
63$nyrk['lang'] = $lang;
64$_SMARTY['lang'] = $lang;
65putenv("LANG=$lang.UTF-8");
66
67setlocale (LC_TIME, $lang.'.UTF-8');
68setlocale (LC_MESSAGES, $lang.'.UTF-8');
69
70# setlocale (LC_TIME, $lang.'.UTF-8');
71
72bindtextdomain('dotnode', LOCALEPATH);
73textdomain('dotnode');
74bind_textdomain_codeset('dotnode', 'UTF-8');
75
76include('labels.inc.php');
77include('menus.inc.php');
78include('table_fields.inc.php');
79include('access_fields.inc.php');
80
81?>
Note: See TracBrowser for help on using the browser.