BMLT Root Server
comdef-config.inc.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************************/
3 /** \file comdef-config.inc.php
4  \brief The basic configuration file for a CoMDEF server.
5 */
6  defined('BMLT_EXEC') or die('Cannot Execute Directly'); // Makes sure that this file is in the correct context.
7  defined('BMLT_COOKIE') or define('BMLT_COOKIE', 'bmlt_cookie'); // The base name for the BMLT cookie.
8  defined('_LANG_COOKIE_NAME') or define('_LANG_COOKIE_NAME', 'bmlt_admin_lang_pref'); // The special admin language selector cookie.
9  ini_set('display_errors', 0); // Keep it all in the family.
10 
11  global $comdef_global_language; ///< The local server language enum (Will default to English)
12  global $comdef_global_languages; ///< This is an array of all available languages.
13  global $comdef_global_more_details_address; ///< This is a format string for the way the address line is displayed in the "more details" screen.
14  global $comdef_global_list_address; ///< The same, but for the list.
15 
16  // This is new for 2.6.2. We have a default set of hunt ranges that can be overidden.
18  // These are specified in whatever unit system we are using for our display ('mi' or 'km').
19  $comdef_map_radius_ranges = array ( 0.0625, 0.125, 0.1875, 0.25, 0.4375, 0.5, 0.5625, 0.75, 0.8125, 1.0,
20  1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0,
21  5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0,
22  11.0, 12.0, 13.0, 14.0, 15.0,
23  17.5, 20.0, 22.5, 25.0, 27.5, 30.0,
24  35.0, 40.0, 45.0, 50.0,
25  60.0, 70.0, 80.0, 90.0, 100.0,
26  150, 200 );
27 
28  /// We default to English.
29  $comdef_global_language = "en";
30  $comdef_global_languages = array ();
31 
32  global $_COMDEF_DEBUG; ///< This flag, when set to true, will cause extra debug information to be output.
33  $_COMDEF_DEBUG = false;
34  /** Uncomment this for debug mode. */
35  // $_COMDEF_DEBUG = true;
36 
37  /** We scan through the "lang" directory, and pick out the available localizations.
38  These will be kept in the comdef_global_languages array.
39  */
40  if ($handle = opendir(dirname(__FILE__).'/../../local_server/server_admin/lang')) {
41  while (false !== ($file = readdir($handle))) {
42  if (!('.' == $file[0])
43  && is_dir(dirname(dirname(dirname(__FILE__))).'/local_server/server_admin/lang/'.$file)
44  && file_exists(dirname(dirname(dirname(__FILE__))).'/local_server/server_admin/lang/'.$file.'/name.txt')
45  && file_exists(dirname(dirname(dirname(__FILE__))).'/local_server/server_admin/lang/'.$comdef_global_language.'/format_codes.php') ) {
46  /// The "name.txt" file contains -ONLY- the language name, in its local language.
47  $name = file_get_contents(dirname(dirname(dirname(__FILE__))).'/local_server/server_admin/lang/'.$file.'/name.txt');
48  /// Each language has a text file, which has its name, in local language.
49  $comdef_global_languages[$file] = $name;
50  }
51  }
52  }
53 
54  $comdef_global_more_details_address = '@@%%location_text%%, @@%%location_street%%@@ (%%location_info%%)@@, %%location_city_subsection%%@@, %%location_municipality%%@@ (%%location_neighborhood%%)@@, %%location_province%%@@ %%location_postal_code_1%%';
55  $comdef_global_list_address = '@@%%location_text%%, @@%%location_street%% @@%%location_info%%';
56 
57  /// Include the automatically generated configuration.
58  if (file_exists(dirname(__FILE__)."/get-config.php")) {
59  include(dirname(__FILE__)."/get-config.php");
60  } else {
61  throw ( new Exception("No get-config.php file!") );
62  }
global $comdef_global_languages
This is an array of all available languages.
defined('BMLT_COOKIE') or define('BMLT_COOKIE'
global $comdef_map_radius_ranges
if($handler instanceof c_comdef_admin_ajax_handler)
const _LANG_COOKIE_NAME
Definition: index.php:19
global $comdef_global_language
The local server language enum (Will default to English)
global $comdef_global_more_details_address
This is a format string for the way the address line is displayed in the "more details" screen...
global $_COMDEF_DEBUG
This flag, when set to true, will cause extra debug information to be output.
global $comdef_global_list_address
The same, but for the list.