2 $_RAIZ = public_base_directory();
4 /*-----------------------DEFINICIONES-------------------*/
5 define("_NOMBRE_", "Eco Mupis");
6 define("_ACC_", "accion");
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("DEMO_LEVEL", 2);
33 define("USER_LEVEL", 1);
34 define("GUEST_LEVEL", 0);
35 define("TRACK_VISITORS", true);
36 define("USER_TIMEOUT", 10);
37 define("GUEST_TIMEOUT", 5);
38 define("COOKIE_EXPIRE", 60*60*24*100);
39 define("COOKIE_PATH", "/");
40 define("EMAIL_FROM_NAME", _NOMBRE_
);
41 define("EMAIL_FROM_ADDR", "administrador@mupi.com.sv");
42 define("EMAIL_WELCOME", true);
43 define("ALL_LOWERCASE", false);
45 Constantes para mensajes
48 define("_M_ERROR", 1);
52 Función necesaria para encontrar nuestra raíz
55 function public_base_directory()
57 $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ?
'https://' : 'http://';
58 $url .= $_SERVER['HTTP_HOST'];
59 //get public directory structure eg "/top/second/third"
60 $public_directory = dirname($_SERVER['PHP_SELF']);
61 //place each directory into array
62 $directory_array = explode('/', $public_directory);
63 //get highest or top level in array of directory strings
64 $public_base = max($directory_array);
66 return $url."/".$public_base;