diff --git a/app/install/installer.php b/app/install/installer.php index d945d46..258a042 100644 --- a/app/install/installer.php +++ b/app/install/installer.php @@ -457,7 +457,11 @@ UPDATE `%table_prefix%users` SET user_content_views = COALESCE((SELECT SUM(image $engines[$TABLE] = $v['ENGINE']; } - $isUtf8mb4 = version_compare($installed_version, '3.12.10', '>'); + $versionCompare = '3.12.10'; + if (defined('G_APP_GITHUB_REPO')) { + $versionCompare = '1.2.0'; + } + $isUtf8mb4 = version_compare($installed_version, $versionCompare, '>'); // Set the right table schema changes per release $update_table = [ diff --git a/app/lib/classes/class.album.php b/app/lib/classes/class.album.php index edc41d8..32d68dd 100644 --- a/app/lib/classes/class.album.php +++ b/app/lib/classes/class.album.php @@ -35,7 +35,7 @@ class Album if (!is_array($requester)) { $requester = User::getSingle($requester, 'id'); } - if (version_compare(Settings::get('chevereto_version_installed'), '3.9.0', '>=')) { + if (!defined('G_APP_GITHUB_REPO') && version_compare(Settings::get('chevereto_version_installed'), '3.9.0', '>=')) { $joins[] = 'LEFT JOIN ' . $tables['likes'] . ' ON ' . $tables['likes'] . '.like_content_type = "album" AND ' . $tables['albums'] . '.album_id = ' . $tables['likes'] . '.like_content_id AND ' . $tables['likes'] . '.like_user_id = ' . $requester['id']; } } diff --git a/app/lib/classes/class.image.php b/app/lib/classes/class.image.php index b9fcc18..d368acc 100644 --- a/app/lib/classes/class.image.php +++ b/app/lib/classes/class.image.php @@ -70,7 +70,7 @@ class Image if (!is_array($requester)) { $requester = User::getSingle($requester, 'id'); } - if (version_compare(Settings::get('chevereto_version_installed'), '3.7.0', '>=')) { + if (!defined('G_APP_GITHUB_REPO') && version_compare(Settings::get('chevereto_version_installed'), '3.7.0', '>=')) { $joins[] = 'LEFT JOIN ' . $tables['likes'] . ' ON ' . $tables['likes'] . '.like_content_type = "image" AND ' . $tables['images'] . '.image_id = ' . $tables['likes'] . '.like_content_id AND ' . $tables['likes'] . '.like_user_id = ' . $requester['id']; } } diff --git a/app/lib/classes/class.login.php b/app/lib/classes/class.login.php index 1e1d805..49bd95c 100644 --- a/app/lib/classes/class.login.php +++ b/app/lib/classes/class.login.php @@ -57,8 +57,12 @@ class Login public static function isPi() { + $versionCompare = '3.14.0.beta.1'; + if (defined('G_APP_GITHUB_REPO')) { + $versionCompare = '1.2.0'; + } if (!isset(self::$isPi)) { - self::$isPi = version_compare(Settings::get('chevereto_version_installed'), '3.14.0.beta.1', '>='); + self::$isPi = version_compare(Settings::get('chevereto_version_installed'), $versionCompare, '>='); } return self::$isPi; diff --git a/app/lib/functions.render.php b/app/lib/functions.render.php index c5277ba..6112823 100644 --- a/app/lib/functions.render.php +++ b/app/lib/functions.render.php @@ -1007,9 +1007,16 @@ function getPixel($type) function showQueuePixel() { - if (version_compare(CHV\getSetting('chevereto_version_installed'), '3.5.5', '<') || CHV\DB::queryFetchSingle('SELECT EXISTS(SELECT 1 FROM ' . CHV\DB::getTable('queues') . ' WHERE queue_status = "pending") as has')['has'] == 0) { + if (!defined('G_APP_GITHUB_REPO')) { return; } + if (version_compare(CHV\getSetting('chevereto_version_installed'), '3.5.5', '<')) { + return; + } + if (CHV\DB::queryFetchSingle('SELECT EXISTS(SELECT 1 FROM ' . CHV\DB::getTable('queues') . ' WHERE queue_status = "pending") as has')['has'] == 0) { + return; + } + echo getPixel('queue'); } diff --git a/app/loader.php b/app/loader.php index 8c9021c..9bf3d77 100644 --- a/app/loader.php +++ b/app/loader.php @@ -101,7 +101,6 @@ define('CHV_APP_PATH_INSTALL', G_APP_PATH . 'install/'); define('CHV_APP_PATH_CONTENT', G_APP_PATH . 'content/'); define('CHV_APP_PATH_LIB_VENDOR', G_APP_PATH . 'vendor/'); -// Composer autoloader require_once CHV_APP_PATH_LIB_VENDOR . 'autoload.php'; define('CHV_APP_PATH_CONTENT_SYSTEM', CHV_APP_PATH_CONTENT . 'system/'); diff --git a/app/themes/Peafowl/style.css b/app/themes/Peafowl/style.css index 4084a8d..7182d64 100644 --- a/app/themes/Peafowl/style.css +++ b/app/themes/Peafowl/style.css @@ -3,7 +3,7 @@ Theme Name: Peafowl Theme URL: https://chevereto.com/ Version: 3 Author: Rodolfo Berrios -@Chevereto: 3.14.2 +@Chevereto: 3.16.0 @requires peafowl.css */ /* diff --git a/app/web.php b/app/web.php index 24c1ab7..469d54e 100644 --- a/app/web.php +++ b/app/web.php @@ -58,7 +58,11 @@ if (class_exists('CHV\Lock') && Settings::get('enable_automatic_updates_check') } // Handle banned IP address -if (version_compare(Settings::get('chevereto_version_installed'), '3.5.14', '>=') && method_exists('CHV\Ip_ban', 'getSingle')) { +$versionCompare = '3.5.14'; +if (defined('G_APP_GITHUB_REPO')) { + $versionCompare = '1.0.0'; +} +if (version_compare(Settings::get('chevereto_version_installed'), $versionCompare, '>=')) { $banned_ip = Ip_ban::getSingle(); if ($banned_ip) { if (G\is_url($banned_ip['message'])) { @@ -129,7 +133,11 @@ foreach ([ // Let's try this one out... Why not? register_shutdown_function(function () { - if (version_compare(Settings::get('chevereto_version_installed'), '3.9.0', '>=') && class_exists('CHV\Lock')) { + $versionCompare = '3.9.0'; + if (defined('G_APP_GITHUB_REPO')) { + $versionCompare = '1.0.9'; + } + if (version_compare(Settings::get('chevereto_version_installed'), $versionCompare, '>=')) { // Delete expired images if (method_exists('CHV\Image', 'deleteExpired')) { try {