Advertisement
darryljf

boot.include.php - latest

Mar 30th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2. session_start();
  3. // the require_once statement is identical to require except php will check if the file has already,
  4.   // been included, and if so, not include (require) it again
  5.  
  6. require_once(__DIR__.'/config.include.php');
  7. require_once(__DIR__.'/db.include.php');
  8. require_once(__DIR__.'/../vendor/autoload.php');
  9. require_once(__DIR__.'/autoloader.include.php');
  10.  
  11.  
  12. //Setup Smarty
  13. $smarty = new Smarty;
  14. $smarty->setTemplateDir(__DIR__.'/../views')
  15.   ->setPluginsDir(array(__DIR__.'/../smarty/plugins'))
  16.   ->setCompileDir(__DIR__.'/../smarty/templates_c')
  17.   ->setCacheDir(__DIR__.'/../smarty/cache')
  18.   ->setConfigDir(__DIR__.'/../smarty/configs');
  19.  
  20.  
  21. if($_SESSION['is_loggedin']) {
  22.   $User = new User($Conn);
  23.   $active_user_data = $User->getUser($_SESSION['user_data']['user_id']);
  24.   $smarty->assign('user_data',$active_user_data);
  25. }
  26.  
  27.  ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement