Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php
  2. // Let's debug our code and start buffering
  3. error_reporting(E_ALL);
  4. ob_start();
  5.  
  6. // Check the principal directory, if it exists, run the start and connect core
  7. if (!is_dir("pg-core/"))
  8.     die ('<center><b>No existe el directorio pg-core/ y es requerido</b></center>');
  9. include('pg-core/start-core.php');
  10. include('pg-core/connect-core.php');
  11.  
  12. // Call start core and connect core
  13. $start = new Start();
  14. $conn = new Connect();
  15. // Check directories, import config
  16. $start->check_dir(array('pg-required', 'install'));
  17. $conn->Import('pg-required/config.php');
  18.  
  19. // Now, check the installation
  20. $start->check_install();
  21.  
  22. // Let's get the post and autor ID
  23. $pid = (isset($_GET['post'])) ? $_GET['post'] : false;
  24. $aid = (isset($_GET['usu'])) ? $_GET['usu'] : false;
  25.  
  26. // Reg per page
  27. $rpp = $conn->reg_pp();
  28.  
  29. //If is set a page and is not number value, send error
  30. if ($start->check_pag('pag')) {
  31.     if (!$start->is_num('pag')) {
  32.         include('includes/themes/'.$conn->theme_dir().'error.php');
  33.     }else{
  34.         $pag = $_GET['pag'];
  35.         $from = ($pag - 1) * $rpp;
  36.     }
  37. }else{
  38.     $pag = 1;
  39.     $from = 0;
  40. }
  41.  
  42. // Let's destroy objects and send the buffer
  43. unset($start);
  44. unset($conn);
  45. ob_end_flush();
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement