A tumblelog CMS built on AJAX, PHP and MySQL.

update.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /* ===========================
  3. gelato CMS - A PHP based tumblelog CMS
  4. development version
  5. http://www.gelatocms.com/
  6. gelato CMS is a free software licensed under the GPL 2.0
  7. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  8. =========================== */
  9. ?>
  10. <?php
  11. $configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php";
  12. if (!file_exists($configFile)) {
  13. $mensaje = "
  14. <h3 class=\"important\">Error reading configuration file</h3>
  15. <p>There doesn't seem to be a <code>config.php</code> file. I need this before we can get started.</p>
  16. <p>This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.</p>";
  17. die($mensaje);
  18. } else {
  19. require($configFile);
  20. }
  21. $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
  22. $sqlStr = "CREATE TABLE `".Table_prefix."comments` (
  23. `id_comment` int(11) NOT NULL auto_increment,
  24. `id_post` int(11) NOT NULL,
  25. `username` varchar(50) NOT NULL,
  26. `email` varchar(100) NOT NULL,
  27. `web` varchar(250) default NULL,
  28. `content` text NOT NULL,
  29. `ip_user` varchar(50) NOT NULL,
  30. `comment_date` datetime NOT NULL,
  31. `spam` tinyint(4) NOT NULL,
  32. PRIMARY KEY (`id_comment`)
  33. ) ENGINE = MYISAM ;";
  34. $db->ejecutarConsulta($sqlStr);
  35. $sqlStr = "CREATE TABLE `".Table_prefix."options` (
  36. `name` varchar(100) NOT NULL,
  37. `val` varchar(255) NOT NULL,
  38. PRIMARY KEY (`name`)
  39. ) ENGINE = MYISAM ;";
  40. $db->ejecutarConsulta($sqlStr);
  41. $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('url_friendly', '1');";
  42. $db->ejecutarConsulta($sqlStr);
  43. $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('rich_text', '0');";
  44. $db->ejecutarConsulta($sqlStr);
  45. $sqlStr = "ALTER TABLE ".Table_prefix."config DROP url_friendly";
  46. $db->ejecutarConsulta($sqlStr);
  47. $sqlStr = "ALTER TABLE ".Table_prefix."config DROP rich_text";
  48. $db->ejecutarConsulta($sqlStr);
  49. echo "<p><em>Finished!</em></p>";
  50. echo "<p>Now you are running on the new version!!!</p>";
  51. ?>