A tumblelog CMS built on AJAX, PHP and MySQL.

update.php 2.0KB

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