Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
hide version number by default: bump to v3.2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Jun 17, 2019
1 parent afd4499 commit 1eb748c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Lychee-front
11 changes: 7 additions & 4 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3573,8 +3573,8 @@ loadingBar.hide = function (force) {
lychee = {

title: document.title,
version: '3.2.15',
versionCode: '030215', // not really needed anymore
version: '',
versionCode: '', // not really needed anymore

updatePath: 'https://LycheeOrg.github.io/update.json',
updateURL: 'https://github.com/LycheeOrg/Lychee/releases',
Expand Down Expand Up @@ -3673,11 +3673,14 @@ lychee.init = function () {
lychee.sub_albums = data.sub_albums || false;
lychee.update_json = data.update_json;
lychee.update_available = data.update_available;
lychee.versionCode = data.config.version.slice(7, data.config.version);
lychee.landing_page_enable = data.config.landing_page_enable && data.config.landing_page_enable === '1' || false;

if (lychee.api_V2) {
lychee.versionCode = data.config.version;
} else {
lychee.versionCode = data.config.version.slice(7, data.config.version.length);
}
if (lychee.versionCode !== '') {
var digits = lychee.versionCode.match(/.{1,2}/g);
lychee.version = parseInt(digits[0]).toString() + '.' + parseInt(digits[1]).toString() + '.' + parseInt(digits[2]).toString();
}
Expand Down Expand Up @@ -7479,7 +7482,7 @@ view.album = {

switch (album.getID()) {
case 'f':
lychee.setTitle(lychee.locale['STARED'], true);
lychee.setTitle(lychee.locale['STARRED'], true);
break;
case 's':
lychee.setTitle(lychee.locale['PUBLIC'], true);
Expand Down
12 changes: 10 additions & 2 deletions php/Modules/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public function init($public = true) {

} else {

if ($return['config']['hide_version_number'] != '0')
{
$return['config']['version'] = '';
$return['config']['checkForUpdates'] = '0';
}

// Logged out
$return['status'] = LYCHEE_STATUS_LOGGEDOUT;

Expand All @@ -53,13 +59,15 @@ public function init($public = true) {
unset($return['config']['plugins']);
unset($return['config']['php_script_limit']);
unset($return['config']['useExiftool']);
$return['update_json'] = 0;
$return['update_available'] = false;

}

unset($return['config']['hide_version_number']);

$return['locale'] = Lang::get_lang(Settings::get()['lang']);

$return['update_json'] = 0;
$return['update_available'] = false;
if($return['config']['checkForUpdates'] == '1')
{
try {
Expand Down
26 changes: 26 additions & 0 deletions php/database/update_030216.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* Update to version 3.2.16
*/

use Lychee\Modules\Database;
use Lychee\Modules\Response;

// Add php_script_limit to settings
$query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'hide_version_number' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
$result = Database::execute($connection, $query, 'update_030216', __LINE__);

if ($result===false) Response::error('Could not get current hide_version_number from database!');

if ($result->num_rows===0) {

$query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('hide_version_number', '1')", array(LYCHEE_TABLE_SETTINGS));
$result = Database::execute($connection, $query, 'update_030216', __LINE__);

if ($result===false) Response::error('Could not add public_search to database!');
}


// Set version
if (Database::setVersion($connection, 'update_030216')===false) Response::error('Could not update version of database!');
2 changes: 1 addition & 1 deletion version.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.15
3.2.16

0 comments on commit 1eb748c

Please sign in to comment.