From cf9bb5a9ed2456f01439876d44e34357020a179f Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 5 Jul 2017 23:45:57 +0100 Subject: [PATCH] Release v2 pre-release 2 update files Release v2 pre-release 2 update files --- changelog.txt | 84 +++++++++++++++ core/includes/updates/200-pr1.php | 115 +++++++++++++++++++++ core/init.php | 3 +- core/installation/views/installer.view.php | 48 ++++++++- custom/languages/Czech/version.php | 4 +- index.php | 2 +- 6 files changed, 248 insertions(+), 8 deletions(-) create mode 100644 changelog.txt create mode 100644 core/includes/updates/200-pr1.php diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000000..e0a81803b1 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,84 @@ +NamelessMC version 2 Changelog + +2.0.0 pr-1 +- Initial release + +2.0.0 pr-2 +- Fix issue with editing user in AdminCP +- Prevent non-moderators replying to locked topics +- Prevent signature image overflow +- Remove unnecessary header template file +- Fix registration issue +- Fix recaptcha issues in upgrade script +- Minor forum updates +- Update Mojang API URL +- Fix incorrect "last user" information in PMs +- Redirect to previous page after login +- Allow use of HTML in report content +- Add forum labels +- Update panels in AdminCP night theme +- Small AdminCP label fixes +- Update default template Bootstrap version +- Update core Bootstrap version +- Update profile template +- Fix signin issue with numeric usernames +- Fix negative reactions not creating +- Allow creating new instances of custom DB class +- Update AdminCP registrations graph +- Change popover placement in AdminCP +- Increase query interval +- Display success message upon sending PM reply +- Update installer and configuration methods +- Display errors if unable to create config + cache +- Update htaccess +- Fix installation detection +- Separate core JS into templates +- Add maintenance mode +- Allow logging in whilst in maintenance mode +- Prevent admin account switch in AdminCP +- Fix installer not loading +- Allow installer translations +- Add default database address to installer +- Update admin auth screen layout +- Remove deprecated mcrypt requirement, along with a now unused function +- Fix permission check for configuration file +- Add AuthMe integration and Minecraft service status +- Fix invalid charset in installer +- Fix AdminCP mobile navbar toggler not showing +- Update cp_dark.css +- Fix AdminCP auth + password changing +- Add switch to toggle error reporting +- Fix error in 404 page +- Update PasswordHash class +- Update form tokens +- Allow per-user timezones +- Add topics and posts to AdminCP overview stats graph +- Fix potentially incorrect news ordering +- Add card colour for Minecraft service status "Slow" +- Define page on register page +- Update post editor +- Fix minor login/logout issues +- Apply GeSHi to new topics and edited posts +- Fix AdminCP security log sorting +- Add force-HTTPS option to AdminCP +- Fix post word wrapping and temporarily disable the code editor +- Add Minecraft server query to homepage +- Allow editing + deleting Minecraft servers +- Fix sub-server queries +- Fix invalid MySQL column default value +- Fix timezone offsets not displaying minutes correctly +- Minor forum SEO improvements +- Add contact page, new email class and email errors + testing +- Add registration email verification toggle in AdminCP +- Add Minecraft server query error logging +- Add Minecraft server banners +- Allow purging Minecraft query errors +- Complete mcassoc integration +- Add terms and conditions page, and the ability to modify them +- Update installer +- Add avatar configuration, including the ability to upload a default avatar +- Fix AdminCP -> Minecraft PHP notice +- Add forgot password functionality +- Add forum topic label permissions +- Add forum search +- Update Font Awesome \ No newline at end of file diff --git a/core/includes/updates/200-pr1.php b/core/includes/updates/200-pr1.php new file mode 100644 index 0000000000..a0260a696b --- /dev/null +++ b/core/includes/updates/200-pr1.php @@ -0,0 +1,115 @@ +alterTable('custom_pages', 'icon', "varchar(64) DEFAULT NULL"); +} catch(Exception $e){ + // Error, may have already been created - continue anyway +} + +try { + $queries->createTable("forums_labels", " `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) NOT NULL, `html` varchar(64) NOT NULL, PRIMARY KEY (`id`)", "ENGINE=InnoDB DEFAULT CHARSET=latin1"); +} catch(Exception $e){ + // Error +} + +try { + $queries->alterTable('forums_topic_labels', 'gids', "varchar(64) DEFAULT NULL"); +} catch(Exception $e){ + // Error +} + +try { + $queries->createTable("mc_servers", " `id` int(11) NOT NULL AUTO_INCREMENT, `ip` varchar(64) NOT NULL, `query_ip` varchar(64) NOT NULL, `name` varchar(20) NOT NULL, `is_default` tinyint(1) NOT NULL DEFAULT '0', `display` tinyint(1) NOT NULL DEFAULT '1', `pre` tinyint(1) NOT NULL DEFAULT '0', `player_list` tinyint(1) NOT NULL DEFAULT '1', `parent_server` int(11) NOT NULL DEFAULT '0', `bungee` tinyint(1) NOT NULL DEFAULT '0', `port` int(11) DEFAULT NULL, `query_port` int(11) DEFAULT '25565', `banner_background` varchar(32) NOT NULL DEFAULT 'background.png', PRIMARY KEY (`id`)", "ENGINE=InnoDB DEFAULT CHARSET=latin1"); +} catch(Exception $e){ + // Error + try { + $queries->alterTable('mc_servers', 'banner_background', "varchar(32) NOT NULL DEFAULT 'background.png'"); + } catch(Exception $ex){ + // Error + } +} + +try { + $queries->createTable("email_errors", " `id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL, `content` text NOT NULL, `at` int(11) NOT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`)", "ENGINE=InnoDB DEFAULT CHARSET=latin1"); +} catch(Exception $e){ + // Error +} + +// New settings +$update_check = $queries->getWhere('settings', array('name', '=', 'maintenance_message')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'maintenance_message', + 'value' => 'This website is currently in maintenance mode.' + )); + $cache->setCache('maintenance_cache'); + $cache->store('maintenance', array('maintenance' => 'false', 'message' => 'This website is currently in maintenance mode.')); +} + +$update_check = $queries->getWhere('settings', array('name', '=', 'authme')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'authme', + 'value' => 0 + )); +} + +$update_check = $queries->getWhere('settings', array('name', '=', 'authme_db')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'authme_db', + 'value' => null + )); +} + +$update_check = $queries->getWhere('settings', array('name', '=', 'force_https')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'force_https', + 'value' => 'false' + )); +} + +$update_check = $queries->getWhere('settings', array('name', '=', 'default_avatar_type')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'default_avatar_type', + 'value' => 'minecraft' + )); +} + +$update_check = $queries->getWhere('settings', array('name', '=', 'custom_default_avatar')); +if(!count($update_check)){ + $queries->create('settings', array( + 'name' => 'custom_default_avatar', + 'value' => null + )); +} + +$update_check = null; + +// Update version number +$version_number_id = $queries->getWhere('settings', array('name', '=', 'nameless_version')); +$version_number_id = $version_number_id[0]->id; + +if(count($version_number_id)){ + $queries->update('settings', $version_number_id, array( + 'value' => '2.0.0-pr2' + )); +} else { + $version_number_id = $queries->getWhere('settings', array('name', '=', 'version')); + $version_number_id = $version_number_id[0]->id; + + $queries->update('settings', $version_number_id, array( + 'value' => '2.0.0-pr2' + )); +} + +$version_update_id = $queries->getWhere('settings', array('name', '=', 'version_update')); +$version_update_id = $version_update_id[0]->id; + +$queries->update('settings', $version_update_id, array( + 'value' => 'false' +)); \ No newline at end of file diff --git a/core/init.php b/core/init.php index 85729116df..c8d04faf32 100755 --- a/core/init.php +++ b/core/init.php @@ -40,7 +40,8 @@ if(isset($conf) && is_array($conf)) $GLOBALS['config'] = $conf; -else $page = 'install'; +else if(!isset($GLOBALS['config'])) + $page = 'install'; /* * Autoload classes diff --git a/core/installation/views/installer.view.php b/core/installation/views/installer.view.php index 24df18228b..50de84217a 100755 --- a/core/installation/views/installer.view.php +++ b/core/installation/views/installer.view.php @@ -458,18 +458,43 @@ )); // Languages + $queries->create('languages', array( + 'name' => 'Czech', + 'is_default' => 0 + )); + + $queries->create('languages', array( + 'name' => 'Dutch', + 'is_default' => 0 + )); + $queries->create('languages', array( 'name' => 'EnglishUK', 'is_default' => 1 )); + $queries->create('languages', array( + 'name' => 'EnglishUS', + 'is_default' => 0 + )); + $queries->create('languages', array( 'name' => 'German', 'is_default' => 0 )); $queries->create('languages', array( - 'name' => 'EnglishUS', + 'name' => 'Greek', + 'is_default' => 0 + )); + + $queries->create('languages', array( + 'name' => 'Norwegian', + 'is_default' => 0 + )); + + $queries->create('languages', array( + 'name' => 'Portuguese', 'is_default' => 0 )); @@ -565,7 +590,7 @@ $queries->create('settings', array( 'name' => 'nameless_version', - 'value' => '2.0.0-pr1' + 'value' => '2.0.0-pr2' )); $queries->create('settings', array( @@ -754,6 +779,21 @@ 'name' => 'authme_db', 'value' => null )); + + $queries->create('settings', array( + 'name' => 'force_https', + 'value' => 'false' + )); + + $queries->create('settings', array( + 'name' => 'default_avatar_type', + 'value' => 'minecraft' + )); + + $queries->create('settings', array( + 'name' => 'custom_default_avatar', + 'value' => null + )); // Templates $queries->create('templates', array( @@ -1879,12 +1919,12 @@ if(count($version)){ $queries->update('settings', $version[0]->id, array( 'name' => 'nameless_version', - 'value' => '2.0.0-pr1' + 'value' => '2.0.0-pr2' )); } else { $queries->create('settings', array( 'name' => 'nameless_version', - 'value' => '2.0.0-pr1' + 'value' => '2.0.0-pr2' )); } diff --git a/custom/languages/Czech/version.php b/custom/languages/Czech/version.php index 5dc606e48f..7d4f9ffcfe 100644 --- a/custom/languages/Czech/version.php +++ b/custom/languages/Czech/version.php @@ -6,9 +6,9 @@ * * License: MIT * - * EnglishUS Language - Language version + * Czech Language - Language version */ // Which version of NamelessMC is this language file updated to? $language_version = '2.0.0-pr1'; -$language_html = 'en'; \ No newline at end of file +$language_html = 'cs'; \ No newline at end of file diff --git a/index.php b/index.php index f9f2d00277..1a0e0f347d 100644 --- a/index.php +++ b/index.php @@ -47,7 +47,7 @@ Redirect::to('install.php'); } -if(FRIENDLY_URLS == true){ +if(defined('FRIENDLY_URLS') && FRIENDLY_URLS == true){ // Load the main page content // Check modules