public_base_directory() movido a const.php para crear la variable $_RAIZ
[ecomupi.git] / include / const.php
blobc3781ba2c79336cdde2b7a75878cbf7f72da69b4
1 <?
2 $_RAIZ = public_base_directory();
4 /*-----------------------DEFINICIONES-------------------*/
5 define("_NOMBRE_", "Eco Mupis");
6 define("_ACC_", "accion");
7 // Cosas de Sesion
8 require_once("data.php");
9 define("DB_SERVER", $DB_motor);
10 define("DB_USER", $DB_usuario);
11 define("DB_PASS", $DB_clave);
12 define("DB_NAME", $DB_base);
13 define("GOOGLE_MAP_KEY", $MapKey);
14 define("TBL_REGISTRY", "emupi_registro");
15 define("TBL_USERS", "emupi_usuarios");
16 define("TBL_ACTIVE_USERS", "emupi_usuarios_activos");
17 define("TBL_ACTIVE_GUESTS", "emupi_visitantes_activos");
18 define("TBL_COMMENTS", "emupi_comentarios");
19 define("TBL_MUPI", "emupi_mupis");
20 define("TBL_MUPI_ORDERS", "emupi_mupis_pedidos");
21 define("TBL_MUPI_FACES", "emupi_mupis_caras");
22 define("TBL_EVENTS", "emupi_mupis_eventos");
23 define("TBL_GEOCODE_CACHE", "emupi_geocode_cache");
24 define("TBL_STREETS", "emupi_calles");
25 define("TBL_IMG","emupi_imagenes");
26 define("TBL_REFS", "emupi_referencias");
27 define("ADMIN_NAME", "admin");
28 define("GUEST_NAME", "Visitante");
29 define("ADMIN_LEVEL", 9);
30 define("SALESMAN_LEVEL", 5);
31 define("CLIENT_LEVEL", 3);
32 define("USER_LEVEL", 1);
33 define("GUEST_LEVEL", 0);
34 define("TRACK_VISITORS", true);
35 define("USER_TIMEOUT", 10);
36 define("GUEST_TIMEOUT", 5);
37 define("COOKIE_EXPIRE", 60*60*24*100);
38 define("COOKIE_PATH", "/");
39 define("EMAIL_FROM_NAME", _NOMBRE_);
40 define("EMAIL_FROM_ADDR", "administrador@mupi.com.sv");
41 define("EMAIL_WELCOME", true);
42 define("ALL_LOWERCASE", false);
44 Constantes para mensajes
46 define("_M_INFO", 0);
47 define("_M_ERROR", 1);
48 define("_M_NOTA",2);
51 Función necesaria para encontrar nuestra raíz
54 function public_base_directory()
56 $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
57 $url .= $_SERVER['HTTP_HOST'];
58 //get public directory structure eg "/top/second/third"
59 $public_directory = dirname($_SERVER['PHP_SELF']);
60 //place each directory into array
61 $directory_array = explode('/', $public_directory);
62 //get highest or top level in array of directory strings
63 $public_base = max($directory_array);
65 return $url."/".$public_base;