- Timestamp:
- 11/26/10 12:53:16 (18 months ago)
- Location:
- branches/1.5/install
- Files:
-
- 5 modified
-
index.php (modified) (8 diffs)
-
install-upgrade.php (modified) (4 diffs)
-
install_functions.php (modified) (1 diff)
-
install_language.php (modified) (2 diffs)
-
install_tables.php (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/install/index.php
r2199 r2243 47 47 "ADMIN" => "/../admin/", 48 48 "INSTALL" => "/", 49 "CACHE" => "/../cache/ 1/",49 "CACHE" => "/../cache/", 50 50 "LIBS" => "/../libs/", 51 51 "EXTENSIONS" => "/../libs/extensions/", … … 504 504 else { 505 505 506 $tables = array('blocked', 'categories', 'comments', 'commentvotes', 'friends', 'messaging', 'miscdata', 'plugins', 'pluginhooks', 'pluginsettings', 'posts', 'postmeta', 'postvotes', ' relates', 'settings', 'site', 'tags', 'tempdata', 'tokens', 'users', 'usermeta', 'useractivity', 'widgets');506 $tables = array('blocked', 'categories', 'comments', 'commentvotes', 'friends', 'messaging', 'miscdata', 'plugins', 'pluginhooks', 'pluginsettings', 'posts', 'postmeta', 'postvotes', 'settings', 'tags', 'tempdata', 'tokens', 'users', 'usermeta', 'useractivity', 'widgets'); 507 507 508 508 // delete *all* tables in db: … … 574 574 // Make sure that the cache folders have been created before we call $h for the first time 575 575 // Since we have defined CACHE in install script, the normal Initialize script will think folders are already present 576 $dirs = array(' ', 'debug_logs/' , 'db_cache/', 'css_js_cache/', 'html_cache/', 'rss_cache/', 'lang_cache/'); // first array item is needed to create the SITEID base folder576 $dirs = array('debug_logs/' , 'db_cache/', 'css_js_cache/', 'html_cache/', 'rss_cache/', 'lang_cache/'); 577 577 578 578 foreach ($dirs as $dir) { … … 593 593 594 594 // Step content 595 echo "<div class='install_content'>" . $lang['install_step3_instructions'] . ":<br /> \n";595 echo "<div class='install_content'>" . $lang['install_step3_instructions'] . ":<br /><br />\n"; 596 596 597 597 $error = 0; … … 747 747 $h = new Hotaru(); // overwrites current global with fully initialized Hotaru object 748 748 749 $phpinfo = $cage->post->getAlpha('phpinfo'); // delete install folder. 750 $delete = $cage->post->getAlpha('delete'); // delete install folder. 751 752 $folder_deleted = 0; 753 754 if ($delete) { 755 // try to delete the folder 756 //$folder_deleted = delTree('install'); 757 $folder_deleted = 2; 758 // if was deleted then redirect to baseurl 759 if ($folder_deleted == 1) header("Location: /index.php" ); 760 } 761 762 if (!$delete && !$phpinfo) { 749 $phpinfo = $cage->post->getAlpha('phpinfo'); 750 751 if (!$phpinfo) { 763 752 //send feedback report 764 753 $systeminfo = new SystemInfo(); … … 773 762 // Step content 774 763 775 if ($folder_deleted == 0)echo "<div class='install_content'>" . $lang['install_step4_installation_complete'] . "</div>\n";764 echo "<div class='install_content'>" . $lang['install_step4_installation_complete'] . "</div>\n"; 776 765 echo "<div class='install_content'>" . $lang['install_step4_installation_delete'] . "</div>\n"; 777 766 … … 811 800 } 812 801 813 if ($folder_deleted == 0) {814 // Confirm delete and continue install815 echo "<div class='install_content'>" . $lang['install_step4_installation_delete_folder'] . "</div>\n";816 echo "<form name='install_admin_reg_form' action='index.php?step=4' method='post'>\n";817 echo "<input type='hidden' name='delete' value='folder' />";818 echo "<input type='hidden' name='step' value='4' />";819 820 echo "<input class='update button' type='submit' value='" . $lang['install_step4_form_delete_folder'] . "' />";821 echo "</div></form>\n";822 } else {823 echo "<br/><img src='../content/admin_themes/admin_default/images/delete.png' style='float:left; margin-left:12px;'>";824 echo "<div class='install_content'><span style='color: red;'>" . $lang['install_step1_warning'] . "</span>: " . $lang['install_step4_installation_delete_failed'] . "</div>\n";825 }826 827 802 echo "<br/><div class='install_content'>" . $lang['install_step4_installation_go_play'] . "</div><br/><br/>\n"; 828 803 … … 853 828 $systeminfo = new SystemInfo(); 854 829 $systeminfo->hotaru_feedback($h); 855 856 //refresh database to get all recent plugin versions857 $systeminfo->plugin_version_getAll($h);858 859 // $plugins = $h->allPluginDetails;860 //861 // foreach ($plugins as $plugin) {862 // if (key($plugin) != 'hooks') {863 // if ($plugin->plugin_latestversion > $plugin->plugin_version) {864 // echo "<b>" . $plugin->plugin_name . "</b> requires an update to <span class='red'>version " . $plugin->plugin_latestversion . "</span><br/>";865 // } else {866 // echo "<b>" . $plugin->plugin_name . "</b> is up to date at version " . $plugin->plugin_version . " <br/>";867 // }868 // }869 // }870 830 871 831 echo "<br/>" . $lang['upgrade_step3_instructions'] . "<br/><br/>\n"; -
branches/1.5/install/install-upgrade.php
r2197 r2243 378 378 if ($old_version == "1.1.2") { 379 379 380 // System Feedback381 $sql = "SELECT settings_name FROM " . TABLE_SETTINGS . " WHERE settings_name = %s";382 $result = $h->db->get_var($h->db->prepare($sql, 'SYS_FEEDBACK'));383 if(!$result) {384 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)";385 $h->db->query($h->db->prepare($sql, 'SYS_FEEDBACK', 'true', 'true', 'Send system report'));386 }387 388 380 // Remove ON from constant names 389 381 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; … … 532 524 } 533 525 } 534 535 // SITE TABLE - for multiple sites 536 if (!$exists = $h->db->table_exists('site')) { 537 $sql = "CREATE TABLE `" . DB_PREFIX . "site` ( 538 `site_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 539 `site_adminuser_id` varchar(64) NULL, 540 `site_url` varchar(128) NOT NULL DEFAULT '', 541 `site_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 542 `site_updateby` int(20) NOT NULL DEFAULT 0 543 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Site Table';"; 544 $h->db->query($sql); 545 } 546 547 //Add site_id column and index to each table 526 527 // reorder the admin settings 528 $desired_order = array('SITE_OPEN', 'SITE_NAME', 'THEME', 'ADMIN_THEME', 'DEBUG', 'FRIENDLY_URLS', 'DB_CACHE', 'DB_CACHE_DURATION', 'CSS_JS_CACHE', 'HTML_CACHE', 'LANG_CACHE', 'RSS_CACHE', 'RSS_CACHE_DURATION', 'SITE_EMAIL', 'SMTP', 'SMTP_HOST', 'SMTP_PORT', 'SMTP_USERNAME', 'SMTP_PASSWORD'); 529 $sql = "SELECT * FROM " . TABLE_SETTINGS; 530 $results = $h->db->get_results($sql); 531 $h->db->query("TRUNCATE TABLE " . TABLE_SETTINGS); 532 533 if ($results) { 534 $i = 0; 535 while (!empty($desired_order)) { 536 foreach ($results as $row) { 537 if (count($desired_order) == 0) { break; } 538 if ($row->settings_name == $desired_order[0]) { 539 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note, settings_show) VALUES(%s, %s, %s, %s, %s)"; 540 $h->db->query($h->db->prepare($sql, $row->settings_name, $row->settings_value, $row->settings_default, $row->settings_note, $row->settings_show)); 541 array_shift($desired_order); 542 } 543 $i++; 544 if ($i > 10000) { break; } // got stuck in a loop 545 } 546 } 547 } 548 549 // update "old version" for next set of upgrades 550 $old_version = "1.3.0"; 551 } 552 553 // 1.3.0 to 1.4.0 554 if ($old_version == "1.3.0") { 555 556 // Drop token_id column from the tokens table 557 if ($h->db->column_exists('tokens', 'token_id')) { 558 $h->db->query("ALTER TABLE " . DB_PREFIX . "tokens DROP token_id"); 559 } 560 561 // update "old version" for next set of upgrades 562 $old_version = "1.4.0"; 563 } 564 565 // 1.4.0 to 1.4.1 566 if ($old_version == "1.4.0") { 567 // update "old version" for next set of upgrades 568 $old_version = "1.4.1"; 569 } 570 571 // 1.4.1 to 1.4.2 572 if ($old_version == "1.4.1") 573 { 574 575 // Change post_title column from `post_title` varchar(255) NULL, to `post_title` text NULL, 576 $exists = $h->db->column_exists('posts', 'post_title'); 577 if ($exists) { 578 $sql = "ALTER TABLE " . TABLE_POSTS . " MODIFY post_title text NULL"; 579 $h->db->query($h->db->prepare($sql)); 580 } 581 582 // remove multi-site option from settings 583 $sql = "DELETE FROM " . TABLE_SETTINGS . " WHERE settings_name = %s"; 584 $h->db->query($h->db->prepare($sql, 'MULTI_SITE')); 585 586 //tables to remove site_id from: 548 587 $tables = array( 549 588 'blocked'=>'blocked','categories'=>'category', … … 554 593 ); 555 594 556 foreach ($tables as $table => $column) { 557 558 if (!$exists = $h->db->column_exists($table, $column . '_siteid')) { 559 // Create a column for index first 560 $sql = "ALTER TABLE " . DB_PREFIX . $table . " ADD " . $column . "_siteid INT NOT NULL DEFAULT 1"; 595 // Remove site_id columns 596 foreach ($tables as $table => $column) 597 { 598 if ($exists = $h->db->column_exists($table, $column . '_siteid')) { 599 // Remove column 600 $sql = "ALTER TABLE " . DB_PREFIX . $table . " DROP " . $column . "_siteid"; 561 601 $h->db->query($sql); 562 } else { 563 // fix to make sure siteid=0 columns are changed to siteid=1 564 $sql = "ALTER TABLE " . DB_PREFIX . $table . " MODIFY " . $column . "_siteid INT NOT NULL DEFAULT 1"; 565 $h->db->query($sql); 566 567 $sql = "UPDATE " . DB_PREFIX . $table . " SET " . $column . "_siteid=1 WHERE " . $column . "_siteid=0"; 568 $h->db->query($sql); 569 } 570 571 602 } 603 604 // Remove site_id indices 572 605 $sql = "SHOW INDEX FROM `" . DB_PREFIX . $table . "` WHERE KEY_NAME = '" . $column . "_siteid'"; 573 606 $result = $h->db->query($sql); 574 if ( !$result) {575 $sql = " ALTER TABLE `" . DB_PREFIX . $table . "` ADD INDEX (" . $column . "_siteid)";607 if ($result) { 608 $sql = "DROP INDEX " . $column . "_siteid ON " . DB_PREFIX . $table; 576 609 $h->db->query($sql); 577 610 } 578 579 // Unique Keys 580 /* 581 * 582 */ 583 if ($exists = $h->db->column_exists('categories', 'category_siteid')) { 584 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` DROP KEY `key`"; 585 $h->db->query($sql); 586 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` ADD UNIQUE KEY `key` (`category_name`, `category_siteid`)"; 587 $h->db->query($sql); 588 } 589 if ($exists = $h->db->column_exists('plugins', 'plugin_siteid')) { 590 $sql = "ALTER TABLE `" . TABLE_PLUGINS . "` DROP KEY `key`"; 591 $h->db->query($sql); 592 $sql = "ALTER TABLE `" . TABLE_PLUGINS . "` ADD UNIQUE KEY `key` (`plugin_folder`, `plugin_siteid`)"; 593 $h->db->query($sql); 594 } 595 if ($exists = $h->db->column_exists('settings', 'settings_siteid')) { 596 $sql = "ALTER TABLE `" . TABLE_SETTINGS . "` DROP KEY `key`"; 597 $h->db->query($sql); 598 $sql = "ALTER TABLE `" . TABLE_SETTINGS . "` ADD UNIQUE KEY `key` (`settings_name`, `settings_siteid`)"; 599 $h->db->query($sql); 600 } 601 if ($exists = $h->db->column_exists('tags', 'tags_siteid')) { 602 $sql = "ALTER TABLE `" . TABLE_TAGS . "` DROP KEY `key`"; 603 $h->db->query($sql); 604 $sql = "ALTER TABLE `" . TABLE_TAGS . "` ADD UNIQUE KEY `key` (`tags_post_id`, `tags_word`, `tags_siteid`)"; 605 $h->db->query($sql); 606 } 607 if ($exists = $h->db->column_exists('users', 'user_siteid')) { 608 $sql = "ALTER TABLE `" . TABLE_USERS . "` DROP KEY `key`"; 609 $h->db->query($sql); 610 $sql = "ALTER TABLE `" . TABLE_USERS . "` ADD UNIQUE KEY `key` (`user_username`, `user_siteid`)"; 611 $h->db->query($sql); 612 } 613 } 614 615 616 // reorder the admin settings 617 $desired_order = array('SITE_OPEN', 'SITE_NAME', 'THEME', 'ADMIN_THEME', 'DEBUG', 'FRIENDLY_URLS', 'DB_CACHE', 'DB_CACHE_DURATION', 'CSS_JS_CACHE', 'HTML_CACHE', 'LANG_CACHE', 'RSS_CACHE', 'RSS_CACHE_DURATION', 'SITE_EMAIL', 'SMTP', 'SMTP_HOST', 'SMTP_PORT', 'SMTP_USERNAME', 'SMTP_PASSWORD', 'SYS_FEEDBACK'); 618 $sql = "SELECT * FROM " . TABLE_SETTINGS; 619 $results = $h->db->get_results($sql); 620 $h->db->query("TRUNCATE TABLE " . TABLE_SETTINGS); 621 622 if ($results) { 623 $i = 0; 624 while (!empty($desired_order)) { 625 foreach ($results as $row) { 626 if (count($desired_order) == 0) { break; } 627 if ($row->settings_name == $desired_order[0]) { 628 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note, settings_show, settings_siteid) VALUES(%s, %s, %s, %s, %s, %d)"; 629 $h->db->query($h->db->prepare($sql, $row->settings_name, $row->settings_value, $row->settings_default, $row->settings_note, $row->settings_show, $row->settings_siteid)); 630 array_shift($desired_order); 631 } 632 $i++; 633 if ($i > 10000) { break; } // got stuck in a loop 634 } 635 } 636 } 637 638 // update "old version" for next set of upgrades 639 $old_version = "1.3.0"; 640 } 641 642 // 1.3.0 to 1.4.0 643 if ($old_version == "1.3.0") { 644 645 // Version Info Auto Update 646 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_note = %s, settings_name = %s WHERE settings_name = %s"; 647 $h->db->query($h->db->prepare($sql, 'Hotaru updates', 'SYS_UPDATES', 'SYS_FEEDBACK')); 648 649 // Version Info Auto Update 650 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_note = %s, settings_name = %s WHERE settings_name = %s"; 651 $h->db->query($h->db->prepare($sql, 'Hotaru updates', 'SYS_UPDATES', 'SYS_FEEDBACK')); 652 653 // MULTI_SITE for SETTINGS table for siteid=1 only (admin) 654 $sql = "SELECT settings_siteid FROM " . TABLE_SETTINGS . " WHERE settings_name = %s AND settings_siteid = %d"; 655 $result = $h->db->get_var($h->db->prepare($sql, 'MULTI_SITE', 1)); 656 657 if (!$result) { 658 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 659 $h->db->query($h->db->prepare($sql, 'MULTI_SITE', 'false', 'false', 'Multiple sites')); 660 } 661 662 // Add siteid to pluginhooks table 663 if (!$exists = $h->db->column_exists('pluginhooks', 'pluginhooks_siteid')) { 664 // Create a column for index first 665 $sql = "ALTER TABLE " . TABLE_PLUGINHOOKS . " ADD pluginhooks_siteid INT NOT NULL DEFAULT 1"; 666 $h->db->query($sql); 667 } 668 669 // Add index for siteid on pluginhooks table 670 $sql = "SHOW INDEX FROM `" . TABLE_PLUGINHOOKS . "` WHERE KEY_NAME = 'pluginhooks_siteid'"; 671 $result = $h->db->query($sql); 672 if (!$result) { 673 $sql = "ALTER TABLE `" . TABLE_PLUGINHOOKS . "` ADD INDEX (pluginhooks_siteid)"; 674 $h->db->query($sql); 675 } 676 677 // Change post_title column from `post_title` varchar(255) NULL, to `post_title` text NULL, 678 $exists = $h->db->column_exists('posts', 'post_title'); 679 if ($exists) { 680 $sql = "ALTER TABLE " . TABLE_POSTS . " MODIFY post_title text NULL"; 681 $h->db->query($h->db->prepare($sql)); 682 } 683 684 // Drop token_id column from the tokens table 685 if ($h->db->column_exists('tokens', 'token_id')) { 686 $h->db->query("ALTER TABLE " . DB_PREFIX . "tokens DROP token_id"); 687 } 688 689 // update "old version" for next set of upgrades 690 $old_version = "1.4.0"; 691 } 692 693 // 1.4.0 to 1.4.1 694 if ($old_version == "1.4.0") { 695 // update "old version" for next set of upgrades 696 $old_version = "1.4.1"; 697 } 698 699 // 1.4.1 to 1.4.2 700 if ($old_version == "1.4.1") 701 { 702 // RELATES TABLE - moved here because it wasn't included in fresh installs prior to 1.4.2 703 if (!$exists = $h->db->table_exists('relates')) { 704 //echo "table doesn't exist. Stopping before creation."; exit; 705 $sql = "CREATE TABLE `" . DB_PREFIX . "relates` ( 706 `relates_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 707 `relates_user_id` int(20) NOT NULL default '0', 708 `relates_post_id` int(20) NOT NULL default '0', 709 `relates_type` varchar(64) default '', 710 `relates_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 711 INDEX (`relates_user_id`), 712 INDEX (`relates_post_id`), 713 INDEX (`relates_type`) 714 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Relates';"; 715 $h->db->query($sql); 716 } 717 718 // Change post_title column from `post_title` varchar(255) NULL, to `post_title` text NULL, 719 $exists = $h->db->column_exists('posts', 'post_title'); 720 if ($exists) { 721 $sql = "ALTER TABLE " . TABLE_POSTS . " MODIFY post_title text NULL"; 722 $h->db->query($h->db->prepare($sql)); 723 } 724 725 // remove language pack option from settings 726 $sql = "DELETE FROM " . TABLE_SETTINGS . " WHERE settings_name = %s"; 727 $h->db->query($h->db->prepare($sql, 'MULTI_SITE')); 728 729 // update "old version" for next set of upgrades 730 //$old_version = "1.4.2"; 611 } 612 613 // Drop unique site_id keys 614 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` DROP INDEX `key`"; 615 $h->db->query($sql); 616 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` ADD UNIQUE KEY `key` (`category_name`)"; 617 $h->db->query($sql); 618 619 $sql = "ALTER TABLE `" . TABLE_PLUGINS . "` DROP INDEX `key`"; 620 $h->db->query($sql); 621 $sql = "ALTER TABLE `" . TABLE_PLUGINS . "` ADD UNIQUE KEY `key` (`plugin_folder`)"; 622 $h->db->query($sql); 623 624 $sql = "ALTER TABLE `" . TABLE_SETTINGS . "` DROP INDEX `key`"; 625 $h->db->query($sql); 626 $sql = "ALTER TABLE `" . TABLE_SETTINGS . "` ADD UNIQUE KEY `key` (`settings_name`)"; 627 $h->db->query($sql); 628 629 $sql = "ALTER TABLE `" . TABLE_TAGS . "` DROP INDEX `key`"; 630 $h->db->query($sql); 631 $sql = "ALTER TABLE `" . TABLE_TAGS . "` ADD UNIQUE KEY `key` (`tags_post_id`, `tags_word`)"; 632 $h->db->query($sql); 633 634 $sql = "ALTER TABLE `" . TABLE_USERS . "` DROP INDEX `key`"; 635 $h->db->query($sql); 636 $sql = "ALTER TABLE `" . TABLE_USERS . "` ADD UNIQUE KEY `key` (`user_username`)"; 637 $h->db->query($sql); 638 639 // Drop Site table 640 $sql = 'DROP TABLE IF EXISTS `' . DB_PREFIX . 'site`;'; 641 $h->db->query($sql); 642 643 // Drop Relates table 644 $sql = 'DROP TABLE IF EXISTS `' . DB_PREFIX . 'relates`;'; 645 $h->db->query($sql); 646 647 // remove the "1" cache folder if permissions allow, otherwise error messages supressed. 648 if (is_dir(CACHE . '1')) 649 { 650 if (is_dir(CACHE . '1/db_cache')) { 651 $h->deleteFiles(CACHE . '1/db_cache'); 652 @rmdir(CACHE . '1/db_cache'); 653 } 654 655 if (is_dir(CACHE . '1/css_js_cache')) { 656 $h->deleteFiles(CACHE . '1/css_js_cache'); 657 @rmdir(CACHE . '1/css_js_cache'); 658 } 659 660 if (is_dir(CACHE . '1/rss_cache')) { 661 $h->deleteFiles(CACHE . '1/rss_cache'); 662 @rmdir(CACHE . '1/rss_cache'); 663 } 664 665 if (is_dir(CACHE . '1/lang_cache')) { 666 $h->deleteFiles(CACHE . '1/lang_cache'); 667 @rmdir(CACHE . '1/lang_cache'); 668 } 669 670 if (is_dir(CACHE . '1/html_cache')) { 671 $h->deleteFiles(CACHE . '1/html_cache'); 672 @rmdir(CACHE . '1/html_cache'); 673 } 674 675 if (is_dir(CACHE . '1/debug_logs')) { 676 $h->deleteFiles(CACHE . '1/debug_logs'); 677 @rmdir(CACHE . '1/debug_logs'); 678 } 679 680 if (file_exists(CACHE . '1/smartloader_cache.php')) { 681 @unlink(CACHE . '1/smartloader_cache.php'); 682 } 683 684 @rmdir(CACHE . '1'); 685 } 686 // update "old version" for next set of upgrades 687 $old_version = "1.4.2"; 731 688 } 732 689 … … 736 693 } 737 694 738 739 740 741 742 743 695 ?> -
branches/1.5/install/install_functions.php
r2198 r2243 140 140 delTree( $file ); 141 141 else 142 unlink( $file );142 @unlink( $file ); 143 143 } 144 144 145 if (is_dir($dir)) return rmdir( $dir );145 if (is_dir($dir)) return @rmdir( $dir ); 146 146 } -
branches/1.5/install/install_language.php
r1968 r2243 48 48 $lang["install_next"] = "Next"; 49 49 $lang["install_back"] = "Back"; 50 $lang["install_trouble"] = "Having trouble? Read the <a href='http:// hotarudocs.com'>Documentation</a> or ask for help in the <a href='http://hotarucms.org/forum.php'>Forums</a>.";50 $lang["install_trouble"] = "Having trouble? Read the <a href='http://docs.hotarucms.org'>Documentation</a> or ask for help in the <a href='http://hotarucms.org/forum.php'>Forums</a>."; 51 51 52 52 /* Install Step 1 */ … … 139 139 $lang["install_step4"] = "Step 4/4: Completion"; 140 140 $lang["install_step4_installation_complete"] = "Installation has been successfully completed."; 141 $lang["install_step4_installation_delete"] = "You <b>must</b> delete the install folder or someone else could run the install script and wipe everything!"; 142 $lang["install_step4_installation_delete_folder"] = "Shall we try and delete the 'install' folder for you?"; 143 $lang["install_step4_form_delete_folder"] = "Delete Folder"; 144 $lang["install_step4_installation_delete_failed"] = "We were not able to delete the install folder. Please delete it manually."; 141 $lang["install_step4_installation_delete"] = "<span style='color: red;'><b>WARNING:</b> You <b>must</b> delete the install folder or someone else could run the install script and wipe everything!</span>"; 145 142 $lang["install_step4_form_check_php"] = "Check PHP Setup"; 146 143 $lang["install_step4_form_check_php_warning"] = "Note: Your server is missing the PHP module: "; -
branches/1.5/install/install_tables.php
r2197 r2243 52 52 `blocked_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 53 53 `blocked_updateby` int(20) NOT NULL DEFAULT 0, 54 `blocked_siteid` int(20) NOT NULL DEFAULT 1,55 INDEX (`blocked_siteid`),56 54 INDEX (`blocked_type`) 57 55 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Blocked IPs, users, emails, etc';"; … … 75 73 `category_order` int(11) NOT NULL DEFAULT '0', 76 74 `category_desc` text NULL, 77 `category_keywords` varchar(255) N OT NULL,75 `category_keywords` varchar(255) NULL, 78 76 `category_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 79 77 `category_updateby` int(20) NOT NULL DEFAULT 0, 80 `category_siteid` int(20) NOT NULL DEFAULT 1, 81 INDEX (`category_siteid`), 82 UNIQUE KEY `key` (`category_name`, `category_siteid`) 78 UNIQUE KEY `key` (`category_name`) 83 79 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Categories';"; 84 80 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; … … 101 97 `comment_user_id` int(20) NOT NULL DEFAULT '0', 102 98 `comment_parent` int(20) DEFAULT '0', 103 `comment_date` timestamp N OT NULL,99 `comment_date` timestamp NULL, 104 100 `comment_status` varchar(32) NOT NULL DEFAULT 'approved', 105 `comment_content` text N OT NULL,101 `comment_content` text NULL, 106 102 `comment_votes_up` smallint(11) NOT NULL DEFAULT '0', 107 103 `comment_votes_down` smallint(11) NOT NULL DEFAULT '0', 108 104 `comment_subscribe` tinyint(1) NOT NULL DEFAULT '0', 109 105 `comment_updateby` int(20) NOT NULL DEFAULT 0, 110 `comment_siteid` int(20) NOT NULL DEFAULT 1,111 INDEX (`comment_siteid`),112 106 FULLTEXT (`comment_content`), 113 107 INDEX (`comment_archived`), … … 131 125 `cvote_user_id` int(11) NOT NULL DEFAULT '0', 132 126 `cvote_user_ip` varchar(32) NOT NULL DEFAULT '0', 133 `cvote_date` timestamp N OT NULL,127 `cvote_date` timestamp NULL, 134 128 `cvote_rating` smallint(11) NOT NULL DEFAULT '0', 135 129 `cvote_reason` tinyint(3) NOT NULL DEFAULT 0, … … 166 160 `message_from` int(20) NOT NULL DEFAULT 0, 167 161 `message_to` int(20) NOT NULL DEFAULT 0, 168 `message_date` timestamp N OT NULL,162 `message_date` timestamp NULL, 169 163 `message_subject` varchar(255) NOT NULL DEFAULT '', 170 164 `message_content` text NULL, … … 185 179 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` ( 186 180 `miscdata_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 187 `miscdata_key` varchar(64) N OT NULL,188 `miscdata_value` text N OT NULL DEFAULT '',189 `miscdata_default` text N OT NULL DEFAULT '',181 `miscdata_key` varchar(64) NULL, 182 `miscdata_value` text NULL, 183 `miscdata_default` text NULL, 190 184 `miscdata_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 191 `miscdata_updateby` int(20) NOT NULL DEFAULT 0, 192 `miscdata_siteid` int(20) NOT NULL DEFAULT 1, 193 INDEX (`miscdata_siteid`) 185 `miscdata_updateby` int(20) NOT NULL DEFAULT 0 194 186 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Miscellaneous Data';"; 195 187 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; … … 241 233 `plugin_updateby` int(20) NOT NULL DEFAULT 0, 242 234 `plugin_latestversion` varchar(8) NOT NULL DEFAULT '0.0', 243 `plugin_siteid` int(20) NOT NULL DEFAULT 1, 244 INDEX (`plugin_siteid`), 245 UNIQUE KEY `key` (`plugin_folder`, `plugin_siteid`) 235 UNIQUE KEY `key` (`plugin_folder`) 246 236 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Application Plugins';"; 247 237 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; … … 258 248 `plugin_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 259 249 `plugin_updateby` int(20) NOT NULL DEFAULT 0, 260 `pluginhooks_siteid` int(20) NOT NULL DEFAULT 1, 261 INDEX (`plugin_folder`), 262 INDEX (`pluginhooks_siteid`) 250 INDEX (`plugin_folder`) 263 251 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Plugins Hooks';"; 264 252 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; … … 271 259 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` ( 272 260 `psetting_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 273 `plugin_folder` varchar(64) N OT NULL,261 `plugin_folder` varchar(64) NULL, 274 262 `plugin_setting` varchar(64) NULL, 275 263 `plugin_value` text NULL, 276 264 `plugin_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 277 265 `plugin_updateby` int(20) NOT NULL DEFAULT 0, 278 `plugin_siteid` int(20) NOT NULL DEFAULT 1,279 INDEX (`plugin_siteid`),280 266 INDEX (`plugin_folder`) 281 267 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Plugins Settings';"; … … 294 280 `post_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 295 281 `post_author` int(20) NOT NULL DEFAULT 0, 296 `post_date` timestamp N OT NULL,297 `post_pub_date` timestamp N OT NULL,282 `post_date` timestamp NULL, 283 `post_pub_date` timestamp NULL, 298 284 `post_status` varchar(32) NOT NULL DEFAULT 'processing', 299 285 `post_type` varchar(32) NULL, … … 310 296 `post_subscribe` tinyint(1) NOT NULL DEFAULT '0', 311 297 `post_updateby` int(20) NOT NULL DEFAULT 0, 312 `post_siteid` int(20) NOT NULL DEFAULT 1,313 INDEX (`post_siteid`),314 298 FULLTEXT (`post_title`, `post_domain`, `post_url`, `post_content`, `post_tags`), 315 299 INDEX (`post_archived`), … … 351 335 `vote_user_id` int(11) NOT NULL DEFAULT '0', 352 336 `vote_user_ip` varchar(32) NOT NULL DEFAULT '0', 353 `vote_date` timestamp N OT NULL,337 `vote_date` timestamp NULL, 354 338 `vote_type` varchar(32) NULL, 355 339 `vote_rating` smallint(11) NOT NULL DEFAULT '0', … … 362 346 } 363 347 364 365 // RELATES TABLE366 367 if ($table_name == "relates") {368 //echo "table doesn't exist. Stopping before creation."; exit;369 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` (370 `relates_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,371 `relates_user_id` int(20) NOT NULL default '0',372 `relates_post_id` int(20) NOT NULL default '0',373 `relates_type` varchar(64) default '',374 `relates_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,375 INDEX (`relates_user_id`),376 INDEX (`relates_post_id`),377 INDEX (`relates_type`)378 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Relates';";379 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n";380 $db->query($sql);381 }382 383 384 348 385 349 // SETTINGS TABLE … … 388 352 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` ( 389 353 `settings_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 390 `settings_name` varchar(64) N OT NULL,391 `settings_value` text N OT NULL DEFAULT '',392 `settings_default` text N OT NULL DEFAULT '',393 `settings_note` text N OT NULL DEFAULT '',354 `settings_name` varchar(64) NULL, 355 `settings_value` text NULL, 356 `settings_default` text NULL, 357 `settings_note` text NULL, 394 358 `settings_show` enum('Y','N') NOT NULL DEFAULT 'Y', 395 359 `settings_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 396 360 `settings_updateby` int(20) NOT NULL DEFAULT 0, 397 `settings_siteid` int(20) NOT NULL DEFAULT 1, 398 UNIQUE KEY `key` (`settings_name`, `settings_siteid`), 399 INDEX (`settings_siteid`) 361 UNIQUE KEY `key` (`settings_name`) 400 362 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Application Settings';"; 401 363 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; … … 480 442 $db->query($db->prepare($sql, 'SMTP_PASSWORD', '', '', '')); 481 443 482 // Sys Feedback483 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)";484 $db->query($db->prepare($sql, 'SYS_UPDATES', 'true', 'true', 'Hotaru updates'));485 486 444 echo $lang['install_step2_adding_data'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n"; 487 445 488 }489 490 491 // SITE TABLE - for multiple sites492 493 if ($table_name == "site") {494 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` (495 `site_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,496 `site_adminuser_id` varchar(64) NULL,497 `site_url` varchar(128) NOT NULL DEFAULT '',498 `site_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,499 `site_updateby` int(20) NOT NULL DEFAULT 0500 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Site Table';";501 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n";502 $db->query($sql);503 446 } 504 447 … … 512 455 `tags_archived` enum('Y','N') NOT NULL DEFAULT 'N', 513 456 `tags_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 514 `tags_date` timestamp N OT NULL,457 `tags_date` timestamp NULL, 515 458 `tags_word` varchar(64) NOT NULL DEFAULT '', 516 459 `tags_updateby` int(20) NOT NULL DEFAULT 0, 517 `tags_siteid` int(20) NOT NULL DEFAULT 1, 518 INDEX (`tags_siteid`), 519 UNIQUE KEY `tags_post_id` (`tags_post_id`,`tags_word`,`tags_siteid`), 460 UNIQUE KEY `tags_post_id` (`tags_post_id`,`tags_word`), 520 461 INDEX (`tags_archived`) 521 462 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Post Tags';"; … … 545 486 if ($table_name == "tokens") { 546 487 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` ( 547 `token_sid` varchar(32) N OT NULL,548 `token_key` CHAR(32) N OT NULL,488 `token_sid` varchar(32) NULL, 489 `token_key` CHAR(32) NULL, 549 490 `token_stamp` INT(11) NOT NULL default '0', 550 491 `token_action` varchar(64), … … 562 503 `user_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 563 504 `user_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 564 `user_username` varchar(32) N OT NULL,505 `user_username` varchar(32) NULL, 565 506 `user_role` varchar(32) NOT NULL DEFAULT 'member', 566 `user_date` timestamp N OT NULL,507 `user_date` timestamp NULL, 567 508 `user_password` varchar(64) NOT NULL DEFAULT '', 568 509 `user_password_conf` varchar(128) NULL, … … 570 511 `user_email_valid` tinyint(3) NOT NULL DEFAULT 0, 571 512 `user_email_conf` varchar(128) NULL, 572 `user_permissions` text N OT NULL DEFAULT '',513 `user_permissions` text NULL, 573 514 `user_ip` varchar(32) NOT NULL DEFAULT '0', 574 515 `user_lastlogin` timestamp NULL, 575 516 `user_lastvisit` timestamp NULL, 576 517 `user_updateby` int(20) NOT NULL DEFAULT 0, 577 `user_siteid` int(20) NOT NULL DEFAULT 1, 578 INDEX (`user_siteid`), 579 UNIQUE KEY `key` (`user_username`, `user_siteid`), 518 UNIQUE KEY `key` (`user_username`), 580 519 KEY `user_email` (`user_email`) 581 520 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Users and Roles';"; … … 618 557 `useract_key2` varchar(255) NULL, 619 558 `useract_value2` text NULL, 620 `useract_date` timestamp N OT NULL,559 `useract_date` timestamp NULL, 621 560 `useract_updateby` int(20) NOT NULL DEFAULT 0, 622 561 INDEX (`useract_userid`) … … 637 576 `widget_function` varchar(255) NULL, 638 577 `widget_args` varchar(255) NULL, 639 `widget_updateby` int(20) NOT NULL DEFAULT 0, 640 `widget_siteid` int(20) NOT NULL DEFAULT 1, 641 INDEX (`widget_siteid`) 578 `widget_updateby` int(20) NOT NULL DEFAULT 0 642 579 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Widgets';"; 643 580 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n";