fixes assorted bugs
This commit is contained in:
parent
080c350913
commit
5dfe197629
8 changed files with 31 additions and 9 deletions
|
@ -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 = [
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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/');
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
/*
|
||||
|
|
12
app/web.php
12
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue