Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('config.php');
- if(!($con=@mysql_connect(G_SERVIDOR,G_USUARIO,G_CLAVE))){
- echo"<h2>Error al conectar a la base de datos</h2><p>Verifique el archivo <code>/config.php</code></p>";
- exit();
- }
- if (!@mysql_select_db(G_BASEDATOS)){
- echo "<h2>Error al seleccionar la base de datos</h2><p>Verifique el archivo <code>/config.php</code></p>";
- exit();
- }
- function tabla_existe($nombre_tb) {
- $tablas = mysql_query("SHOW TABLES") ;
- while (list($tabla) = mysql_fetch_array($tablas)) {
- if ($nombre_tb == $tabla){
- return true;
- break;
- }
- }
- return false;
- }
- if (!tabla_existe("opciones",G_BASEDATOS)) {
- header('Location: admin/install.php');
- exit();
- }else {
- //definicion de variables globales que se usaran en todo el gestor
- if ( !defined('ABSPATH') )
- define('ABSPATH', dirname(__FILE__) . '/');
- //llamar a clase con las opciones basica del sitio
- require(ABSPATH."script/class/rm_opciones.class.php");
- //enlaces amigables
- define('G_ENL_AMIG', $objOpcion->obtener_valor(1,'enlaceamigable'));
- //nombre del servidor http
- define('G_SERVER', $objOpcion->obtener_valor(1,'direccion_url'));
- //tema usado o guardado en cookies
- if(isset($_COOKIE['_ribosoma_style'])){
- define('G_ESTILO', $_COOKIE['_ribosoma_style']);
- }else{
- define('G_ESTILO', $objOpcion->obtener_valor(1,'tema'));
- }
- //valores titulo y descripcion
- define('G_TITULO', $objOpcion->obtener_valor(1,'nombresitio'));
- define('G_SUBTITULO', $objOpcion->obtener_valor(1,'descripcion'));
- //informacion sobre meta tags
- define('G_METAKEYWORDS', $objOpcion->obtener_valor(1,'meta_keywords'));
- define('G_METADESCRIPTION', $objOpcion->obtener_valor(1,'meta_description'));
- //variable global para sesion activa
- session_name('_ribapp');
- session_start();
- if(isset($_SESSION['usr']) and isset($_SESSION['pwd'])) define('G_ACCESOUSUARIO',1);
- else define('G_ACCESOUSUARIO',0);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement