A tumblelog CMS built on AJAX, PHP and MySQL.

entry.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. define('Absolute_Path', dirname(__FILE__).DIRECTORY_SEPARATOR);
  9. $installed = true;
  10. $configFile = Absolute_Path.'config.php';
  11. $dir = (strpos($_SERVER['REQUEST_URI'],'/admin')) ? "../" : "";
  12. if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php'){
  13. header("Location: {$dir}install.php");
  14. exit;
  15. } else {
  16. include_once(Absolute_Path.'classes/install.class.php');
  17. $install = new Install();
  18. if(!$install->is_gelato_installed()){
  19. if(basename($_SERVER['PHP_SELF'])!='install.php'){
  20. header("Location: {$dir}install.php");exit;
  21. }
  22. $installed = false;
  23. }
  24. }
  25. if($installed) {
  26. require_once($configFile);
  27. }
  28. if (!extension_loaded('json')) {
  29. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'JSON.php');
  30. $GLOBALS['JSON_OBJECT'] = new Services_JSON();
  31. function json_encode($value) {
  32. return $GLOBALS['JSON_OBJECT']->encode($value);
  33. }
  34. function json_decode($value, $none) {
  35. return $GLOBALS['JSON_OBJECT']->decode($value);
  36. }
  37. }
  38. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
  39. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'util.class.php');
  40. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
  41. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
  42. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
  43. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
  44. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
  45. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
  46. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
  47. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
  48. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
  49. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
  50. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
  51. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugin.class.php');
  52. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugins.class.php');
  53. if($installed){
  54. // Globals to be used throughout the application
  55. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  56. $conf = new configuration();
  57. $tumble = new gelato();
  58. $user = new user();
  59. session_start();
  60. util::init_plugins();
  61. $trigger =& plugin::instance(); //DO NOT remove the & after the =
  62. $trigger->call('gelato_init');
  63. $feeds = new feeds();
  64. $feeds->updateFeeds();
  65. unset($feeds);
  66. }
  67. ?>