From 693ec6eeb90ad7e189513e8fbf3ffda2ad349a08 Mon Sep 17 00:00:00 2001 From: partydragen Date: Fri, 15 Oct 2021 15:33:58 +0200 Subject: [PATCH 1/2] Fix installer --- upload/modules/Resources/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/modules/Resources/module.php b/upload/modules/Resources/module.php index 0655741..1db9808 100644 --- a/upload/modules/Resources/module.php +++ b/upload/modules/Resources/module.php @@ -62,7 +62,7 @@ public function onInstall(){ $queries = new Queries(); try { $data = $queries->createTable("resources_categories", " `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL, `description` text, `display_order` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); - $data = $queries->createTable("resources", " `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `creator_id` int(11) NOT NULL, `name` varchar(64) NOT NULL, `short_description` varchar(64) NULL DEFAULT NULL, `has_icon` tinyint(1) NOT NULL DEFAULT '0', `icon` varchar(512) NULL DEFAULT NULL, `icon_updated` int(11) NOT NULL, `description` mediumtext NOT NULL, `contributors` text, `views` int(11) NOT NULL DEFAULT '0', `downloads` int(11) NOT NULL DEFAULT '0', `created` int(11) NOT NULL, `updated` int(11) NOT NULL, `github_url` varchar(128) DEFAULT NULL, `github_username` varchar(64) DEFAULT NULL, `github_repo_name` varchar(64) DEFAULT NULL, `rating` int(11) NOT NULL DEFAULT '0', `latest_version` varchar(32) DEFAULT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `price` varchar(16) DEFAULT NULL, `payment_email` varchar(256) DEFAULT NULL, PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); + $data = $queries->createTable("resources", " `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `creator_id` int(11) NOT NULL, `name` varchar(64) NOT NULL, `short_description` varchar(64) NULL DEFAULT NULL, `has_icon` tinyint(1) NOT NULL DEFAULT '0', `icon` varchar(512) NULL DEFAULT NULL, `icon_updated` int(11) NOT NULL DEFAULT '0', `description` mediumtext NOT NULL, `contributors` text, `views` int(11) NOT NULL DEFAULT '0', `downloads` int(11) NOT NULL DEFAULT '0', `created` int(11) NOT NULL, `updated` int(11) NOT NULL, `github_url` varchar(128) DEFAULT NULL, `github_username` varchar(64) DEFAULT NULL, `github_repo_name` varchar(64) DEFAULT NULL, `rating` int(11) NOT NULL DEFAULT '0', `latest_version` varchar(32) DEFAULT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `price` varchar(16) DEFAULT NULL, `payment_email` varchar(256) DEFAULT NULL, PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); $data = $queries->createTable("resources_releases", " `id` int(11) NOT NULL AUTO_INCREMENT, `resource_id` int(11) NOT NULL, `category_id` int(11) NOT NULL, `release_title` varchar(128) NOT NULL, `release_description` mediumtext NOT NULL, `release_tag` varchar(16) NOT NULL, `created` int(11) NOT NULL, `downloads` int(11) NOT NULL DEFAULT '0', `rating` int(11) NOT NULL DEFAULT '0', `download_link` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); $data = $queries->createTable("resources_comments", " `id` int(11) NOT NULL AUTO_INCREMENT, `resource_id` int(11) NOT NULL, `author_id` int(11) NOT NULL, `content` mediumtext NOT NULL, `release_tag` varchar(16) NOT NULL, `created` int(11) NOT NULL, `reply_id` int(11) DEFAULT NULL, `rating` int(11) NOT NULL DEFAULT '0', `hidden` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); $data = $queries->createTable("resources_categories_permissions", " `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `group_id` int(11) NOT NULL, `view` tinyint(1) NOT NULL DEFAULT '1', `post` tinyint(1) NOT NULL DEFAULT '1', `move_resource` tinyint(1) NOT NULL DEFAULT '1', `edit_resource` tinyint(1) NOT NULL DEFAULT '1', `delete_resource` tinyint(1) NOT NULL DEFAULT '1', `edit_review` tinyint(1) NOT NULL DEFAULT '1', `delete_review` tinyint(1) NOT NULL DEFAULT '1', `download` tinyint(1) NOT NULL DEFAULT '0', `premium` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)", "ENGINE=$engine DEFAULT CHARSET=$charset"); From 69f8dad219ad78af36f5521c92269a2da71104d7 Mon Sep 17 00:00:00 2001 From: partydragen Date: Fri, 15 Oct 2021 17:02:16 +0200 Subject: [PATCH 2/2] PHP 8 fix --- upload/modules/Resources/pages/resources/resource.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upload/modules/Resources/pages/resources/resource.php b/upload/modules/Resources/pages/resources/resource.php index ea3f5b2..2520b7d 100644 --- a/upload/modules/Resources/pages/resources/resource.php +++ b/upload/modules/Resources/pages/resources/resource.php @@ -2,7 +2,7 @@ /* * Made by Samerton * https://github.com/NamelessMC/Nameless/ - * NamelessMC version 2.0.0-pr9 + * NamelessMC version 2.0.0-pr12 * * License: MIT * @@ -299,7 +299,7 @@ ); $n++; } - } else $comments_array = null; + } // Get latest update $latest_update = $queries->orderWhere('resources_releases', 'resource_id = ' . $resource->id, 'created', 'DESC LIMIT 1'); @@ -590,7 +590,7 @@ ); $n++; } - } else $comments_array = null; + } // Get latest update $latest_update = $queries->orderWhere('resources_releases', 'resource_id = ' . $resource->id, 'created', 'DESC LIMIT 1');