A tumblelog CMS built on AJAX, PHP and MySQL.

entry.php 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. ob_start();
  3. if(!defined('entry') || !entry) die('Not a valid page');
  4. /*
  5. * Created on Sep 15, 2007
  6. * Modified on Oct 30, 2008
  7. *
  8. * Known Entry Points
  9. * api.php
  10. * archive.php
  11. * install.php
  12. * index.php
  13. * login.php
  14. * update.php
  15. * rss.php
  16. * admin/bm.php
  17. * admin/index.php
  18. * admin/close.php
  19. * admin/ajax.php
  20. * admin/settings.php
  21. * admin/options.php
  22. * admin/admin.php
  23. * admin/comments.php
  24. * admin/user.php
  25. * admin/feeds.php
  26. * classes/imgsize.php
  27. */
  28. error_reporting (E_ALL);
  29. ini_set('display_errors', '1');
  30. // PHP settings specific to Gelato
  31. ini_set('pcre.backtrack_limit', '10000');
  32. // Globals to be used throughout the application
  33. define('Absolute_Path', dirname(__FILE__).DIRECTORY_SEPARATOR);
  34. $installed = true;
  35. $configFile = Absolute_Path.'config.php';
  36. $dir = (strpos($_SERVER['REQUEST_URI'],'/admin')) ? "../" : "";
  37. if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php'){
  38. header("Location: {$dir}install.php");
  39. exit;
  40. } else {
  41. include_once(Absolute_Path.'classes/install.class.php');
  42. $install = new Install();
  43. if(!$install->is_gelato_installed()){
  44. if(basename($_SERVER['PHP_SELF'])!='install.php'){
  45. header("Location: {$dir}install.php");exit;
  46. }
  47. $installed = false;
  48. }
  49. }
  50. if($installed) {
  51. require_once($configFile);
  52. }
  53. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
  54. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'functions.php');
  55. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
  56. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
  57. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
  58. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
  59. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
  60. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
  61. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
  62. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
  63. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
  64. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
  65. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
  66. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugin.class.php');
  67. require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugins.class.php');
  68. if($installed){
  69. // Globals to be used throughout the application
  70. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  71. $user = new user();
  72. $tumble = new gelato();
  73. $conf = new configuration();
  74. session_start();
  75. //print_r($conf->plugins);
  76. //die();
  77. init_plugins();
  78. $trigger = plugin::instance();
  79. //echo "plugins.instances: ";
  80. //print_r(plugins::$instances);
  81. //echo "<br />";
  82. //die();
  83. //echo "plugin.actions: ";
  84. //$plugEngine = plugin::instance();
  85. //print_r($plugEngine->actions);
  86. //die();
  87. $trigger->call('add_post');
  88. $feeds = new feeds();
  89. $feeds->updateFeeds();
  90. unset($feeds);
  91. }
  92. ?>