fix installation css create database connect error

This commit is contained in:
Amberstone 2024-09-26 09:14:38 +09:00
parent 4558d805b1
commit e21a9b9f73
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
2 changed files with 22 additions and 2 deletions

View file

@ -1,7 +1,6 @@
<?php <?php
@include_once "./_common.php"; @include_once "./_common.php";
// CSS 설정 가져오기 // CSS 설정 가져오기
$css_sql = sql_query("select * from {$g5['css_table']}"); $css_sql = sql_query("select * from {$g5['css_table']}");
$css = []; $css = [];

View file

@ -367,17 +367,38 @@ EOD;
// CSS 설정 파일 생성 // CSS 설정 파일 생성
$css_data_path = $g5_path['path'] . "/css"; $css_data_path = $g5_path['path'] . "/css";
$css_data_url = $g5_path['url'] . "/css"; $css_data_url = $g5_path['url'] . "/css";
@mkdir($css_data_path, G5_DIR_PERMISSION); @mkdir($css_data_path, G5_DIR_PERMISSION);
@chmod($css_data_path, G5_DIR_PERMISSION); @chmod($css_data_path, G5_DIR_PERMISSION);
$file = '../' . G5_CSS_DIR . '/_design.config.css'; $file = '../' . G5_CSS_DIR . '/_design.config.css';
$file_path = $css_data_path . '/_design.config.css'; $file_path = $css_data_path . '/_design.config.css';
@unlink($file_path); @unlink($file_path);
$f = @fopen($file, 'a'); $f = @fopen($file, 'a');
?> ?>
<li style="display:none;"> <li style="display:none;">
<?php <?php
if (!isset($g5)) {
$g5 = [];
}
if (!isset($g5['connect_db'])) {
$connect_db = sql_connect($mysql_host, $mysql_user, $mysql_pass) or die('MySQL Connect Error!!!');
$select_db = sql_select_db($mysql_db, $connect_db) or die('MySQL DB Error!!!');
$g5['connect_db'] = $connect_db;
sql_set_charset('utf8', $connect_db);
if (defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE)
sql_query("SET SESSION sql_mode = ''");
if (defined('G5_TIMEZONE'))
sql_query(" set time_zone = '" . G5_TIMEZONE . "'");
}
ob_start(); ob_start();
include("../adm/design_form_css.php"); include "../adm/design_form_css.php";
$css = ob_get_contents(); $css = ob_get_contents();
ob_end_flush(); ob_end_flush();
fwrite($f, $css); fwrite($f, $css);