A tumblelog CMS built on AJAX, PHP and MySQL.

entry.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. ob_start();
  3. if(!defined('entry') || !entry) die('Not a valid page');
  4. error_reporting (E_ALL);
  5. ini_set('display_errors', '1');
  6. // PHP settings specific to Gelato
  7. ini_set('pcre.backtrack_limit', '10000');
  8. // Globals to be used throughout the application
  9. define('Absolute_Path', dirname(__FILE__).DIRECTORY_SEPARATOR);
  10. $installed = true;
  11. $configFile = Absolute_Path.'config.php';
  12. $dir = (strpos($_SERVER['REQUEST_URI'],'/admin')) ? "../" : "";
  13. if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php'){
  14. header("Location: {$dir}install.php");
  15. exit;
  16. } else {
  17. include_once(Absolute_Path.'classes/install.class.php');
  18. $install = new Install();
  19. if(!$install->is_gelato_installed()){
  20. if(basename($_SERVER['PHP_SELF'])!='install.php'){
  21. header("Location: {$dir}install.php");exit;
  22. }
  23. $installed = false;
  24. }
  25. }
  26. if($installed) {
  27. require_once($configFile);
  28. }
  29. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
  30. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'util.class.php');
  31. //require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'functions.php');
  32. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
  33. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
  34. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
  35. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
  36. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
  37. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
  38. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
  39. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
  40. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
  41. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
  42. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
  43. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugin.class.php');
  44. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugins.class.php');
  45. if($installed){
  46. // Globals to be used throughout the application
  47. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  48. $conf = new configuration();
  49. $tumble = new gelato();
  50. $user = new user();
  51. session_start();
  52. util::init_plugins();
  53. $trigger = plugin::instance();
  54. $trigger->call('gelato_init');
  55. $feeds = new feeds();
  56. $feeds->updateFeeds();
  57. unset($feeds);
  58. }
  59. ?>