Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. /* Let's debug our code */
  4. error_reporting(E_ALL);
  5. /* Variables de los directorios a usar */
  6. $def_path = 'default/';
  7. $req_path = 'required/';
  8. $adm_path = 'admin/';
  9. $inc_path = 'includes/';
  10.  
  11.  
  12. /* Checar si existen los directorios y algunos archivos
  13.     para proceder*/
  14. if (!is_dir($def_path)) {
  15.     die('<center><b>No existe el directorio '.$def_path.' y es requerido</b></center>');
  16. }
  17. if (!is_dir($req_path)) {
  18.     die('<center><b>No existe el directorio '.$req_path.' y es requerido</b></center>');
  19. }
  20. if (!is_dir($adm_path)) {
  21.     die('<center><b>No existe el directorio '.$adm_path.' y es requerido</b></center>');
  22. }
  23. if (!is_dir($inc_path)) {
  24.     die('<center><b>No existe el directorio '.$inc_path.' y es requerido</b></center>');
  25. }
  26. if (!file_exists($req_path.'func_prin.php')) {
  27.     die('<center><b>No existe el archivo "'.$req_path.'func_prin.php" y es requerido</b></center>');
  28. }
  29.    
  30. /* Si no existe la instalacion... */
  31. if (!file_exists($req_path.'config.php')) {
  32.     header('Location: '.$def_path.'instalar/index.php');
  33. }else{
  34.     $reg_x_pag = 10;
  35.     $post_id = (isset($_GET['post'])) ? $_GET['post'] : false;
  36.     $autor_id = (isset($_GET['usu'])) ? $_GET['usu'] : false;
  37.     if (isset($_GET['pag'])) {
  38.         if (!is_numeric($_GET['pag'])) {
  39.             include('includes/themes/'.theme_dir().'error.php');
  40.         }else{
  41.             $pag = $_GET['pag'];
  42.             $desde = ($pag - 1) * $reg_x_pag;
  43.         }
  44.     }else{
  45.         $pag = 1;
  46.         $desde = 0;
  47.     }
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement