forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXT_config.php
64 lines (53 loc) · 1.86 KB
/
EXT_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?
//************************************************************************
// Leonardo XC Server, http://www.leonardoxc.net
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: EXT_config.php,v 1.22 2010/03/14 20:56:10 manolis Exp $
//
//************************************************************************
@session_start();
setVarFromRequest("lng",$PREFS->language);
$currentlang=$lng;
$lang=$currentlang;
$language=$currentlang;
if ( $opMode==1) {
$newlang=$currentlang;
$inside_mod =1;
define('INSIDE_MOD',1);
require_once("../../mainfile.php");
// re-set $module_name;
$tmpDir=dirname(__FILE__);
$tmpParts=split("/",str_replace("\\","/",$tmpDir));
$module_name=$tmpParts[count($tmpParts)-1];
} else if ( $opMode==2) {
// require_once "language/lang-".$currentlang.".php";
define('IN_PHPBB', true);
$phpbb_root_path = dirname(__FILE__).'/../../';
$prefix="phpbb";
require($phpbb_root_path . 'extension.inc');
require($phpbb_root_path . 'common.'.$phpEx);
}
if ( strlen($currentlang)==2) {
$currentlang=array_search($currentlang,$lang2iso);
if (!$currentlang) $currentlang=$PREFS->language;
}
if ($CONF_use_utf) {
define('CONF_LANG_ENCODING_TYPE','utf8');
$CONF_ENCODING='utf-8';
} else {
define('CONF_LANG_ENCODING_TYPE','iso');
$CONF_ENCODING=$langEncodings[$currentlang];
}
if (is_array($lang) )
$lang['ENCODING']=$CONF_ENCODING;
require_once dirname(__FILE__)."/language/".CONF_LANG_ENCODING_TYPE."/lang-".$currentlang.".php";
session_start();
$userID = $_SESSION['userID'];
if ($CONF_use_utf) $db->sql_query("SET NAMES utf8");
?>