Last login value, minor update for array to [, smarty include core

When logged in, the last loggedin time is stored in the edit_user table,
additional to the normal logging.

More array() to [] conversion in config files, etc

Javascript: add math.round

Basic Class: Fix key length array mapping to more efficiont loop run
DB/IO: some name fixes in get key function description/comments
SmartyExtended: add CORE CSS/JS file include if exists. Follows after
MAIN and BEFORE page and special
This commit is contained in:
Clemens Schwaighofer
2021-01-21 06:55:28 +09:00
parent 85f701ab2a
commit 50073479d4
11 changed files with 105 additions and 88 deletions

View File

@@ -8,8 +8,8 @@
*********************************************************************/
// please be VERY carefull only to change the right side
$DB_CONFIG = array(
'test' => array(
$DB_CONFIG = [
'test' => [
'db_name' => 'gullevek',
'db_user' => 'gullevek',
'db_pass' => 'gullevek',
@@ -19,7 +19,7 @@ $DB_CONFIG = array(
'db_type' => 'pgsql',
'db_encoding' => '',
'db_ssl' => 'disable' // allow, disable, require, prefer
)
);
]
];
// __END__

View File

@@ -21,9 +21,9 @@
// );
// each host has a different db_host
$SITE_CONFIG = array(
$SITE_CONFIG = [
// development host
'soba.tokyo.tequila.jp' => array(
'soba.tokyo.tequila.jp' => [
// db config selection
'db_host' => 'test',
// other db connections
@@ -37,8 +37,8 @@ $SITE_CONFIG = array(
'site_lang' => 'en_utf8',
// enable/disable login override
'login_enabled' => true
),
],
// 'other.host.com' => $__LOCAL_CONFIG
);
];
// __END__

View File

@@ -185,7 +185,7 @@ if (file_exists(BASE.CONFIGS.'config.host.php')) {
require BASE.CONFIGS.'config.host.php';
}
if (!isset($SITE_CONFIG)) {
$SITE_CONFIG = array();
$SITE_CONFIG = [];
}
/************* DB ACCESS *****************/
if (file_exists(BASE.CONFIGS.'config.db.php')) {
@@ -238,7 +238,7 @@ if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVE
}
// define the db config set name, the db config and the db schema
define('DB_CONFIG_NAME', $SITE_CONFIG[HOST_NAME]['db_host']);
define('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAME] : array());
define('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAME] : []);
// define('DB_CONFIG_TARGET', SITE_CONFIG[$HOST_NAME]['db_host_target']);
// define('DB_CONFIG_OTHER', SITE_CONFIG[$HOST_NAME]['db_host_other']);
// override for login and global schemas

View File

@@ -11,11 +11,11 @@
/************* CONVERT *******************/
// this only needed if the external thumbnail create is used
$paths = array(
$paths = [
'/bin',
'/usr/bin',
'/usr/local/bin'
);
];
// find convert
foreach ($paths as $path) {
if (file_exists($path.DS.'convert') && is_file($path.DS.'convert')) {

View File

@@ -10,12 +10,12 @@
// File and Folder paths
// ID is TARGET (first array element)
/*$PATHS = array(
'test' => array(
/*$PATHS = [
'test' => [
'csv_path' => '',
'perl_bin' => '',
'other_url' => '',
)
)*/
]
]*/
// __END__

View File

@@ -22,7 +22,7 @@ if (!defined('DS')) {
exit('Base config unloadable');
}
// find trigger name "admin/" or "frontend/" in the getcwd() folder
foreach (array('admin', 'frontend') as $folder) {
foreach (['admin', 'frontend'] as $folder) {
if (strstr(getcwd(), DS.$folder)) {
define('CONTENT_PATH', $folder.DS);
break;