A tumblelog CMS built on AJAX, PHP and MySQL.

update.php 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. if(!defined('entry')) define('entry',true);
  3. /* ===========================
  4. gelato CMS - A PHP based tumblelog CMS
  5. development version
  6. http://www.gelatocms.com/
  7. gelato CMS is a free software licensed under the GPL 2.0
  8. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  9. =========================== */
  10. ?>
  11. <?php
  12. $configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php";
  13. if (!file_exists($configFile)) {
  14. $mensaje = "
  15. <h3 class=\"important\">Error reading configuration file</h3>
  16. <p>There doesn't seem to be a <code>config.php</code> file. I need this before we can get started.</p>
  17. <p>This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.</p>";
  18. die($mensaje);
  19. } else {
  20. require($configFile);
  21. }
  22. require_once('classes/mysql_connection.class.php');
  23. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  24. $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
  25. $db->ejecutarConsulta($sqlStr);
  26. $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('rss_import_frec', '5 minutes');";
  27. $db->ejecutarConsulta($sqlStr);
  28. $sqlStr = "CREATE TABLE `".Table_prefix."feeds` (
  29. `id_feed` int(11) NOT NULL auto_increment,
  30. `url` varchar(255) NOT NULL,
  31. `title` varchar(255) NOT NULL,
  32. `type` tinyint(4) NOT NULL default '1',
  33. `updated_at` datetime NOT NULL,
  34. `error` tinyint(1) NOT NULL default '0',
  35. `credits` int(1) NOT NULL default '0',
  36. `site_url` varchar(255) NOT NULL,
  37. `id_user` int(10) NOT NULL,
  38. PRIMARY KEY (`id_feed`)
  39. ) ENGINE=MyISAM ;";
  40. $db->ejecutarConsulta($sqlStr);
  41. if(!is_dir('upload/CACHE')){
  42. @mkdir('upload/CACHE');
  43. @chmod('upload/CACHE',777);
  44. }
  45. echo "<p><em>Finished!</em></p>";
  46. echo "<p>Now you are running on the new <strong>gelato cioccolato</strong> version!!!</p>";
  47. ?>