A tumblelog CMS built on AJAX, PHP and MySQL.

entry.php 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. if (!extension_loaded('json')) {
  30. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'JSON.php');
  31. $GLOBALS['JSON_OBJECT'] = new Services_JSON();
  32. function json_encode($value) {
  33. return $GLOBALS['JSON_OBJECT']->encode($value);
  34. }
  35. function json_decode($value, $none) {
  36. return $GLOBALS['JSON_OBJECT']->decode($value);
  37. }
  38. }
  39. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
  40. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'util.class.php');
  41. //require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'functions.php');
  42. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
  43. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
  44. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
  45. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
  46. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
  47. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
  48. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
  49. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
  50. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
  51. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
  52. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
  53. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugin.class.php');
  54. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugins.class.php');
  55. if($installed){
  56. // Globals to be used throughout the application
  57. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  58. $conf = new configuration();
  59. $tumble = new gelato();
  60. $user = new user();
  61. session_start();
  62. util::init_plugins();
  63. $trigger = plugin::instance();
  64. $trigger->call('gelato_init');
  65. $feeds = new feeds();
  66. $feeds->updateFeeds();
  67. unset($feeds);
  68. }
  69. ?>