Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html_process가 초기화 되기전에 js/css 파일을 로드 할수 없습니다 #206

Closed
kkigomi opened this issue Nov 16, 2022 · 3 comments

Comments

@kkigomi
Copy link
Contributor

kkigomi commented Nov 16, 2022

add_javascript(), add_stylesheet() 함수가 html_process 클래스의 인스턴스가 생성되어있지 않으면 js/css 파일을 추가할수 없습니다.
hook, extend, plugin 등에서 js/css 파일을 로드해야할때 실행 시점에 따라 로드가 불가능합니다.

static 메소드로 변경하여 실행 시점에 따라 불능 상태가 되지 않도록 개선되면 좋겠습니다.

지금은 어떠한 경고나 안내도 없이 무시되고 있어서 개발에 혼란이 생깁니다.

개선해주세요.

개선 코드를 반영할 의사가 있으시면 코드 제공하겠습니다.

@kkigomi
Copy link
Contributor Author

kkigomi commented Nov 16, 2022

gnuboard5/lib/common.lib.php

Lines 2578 to 2596 in dbc8e16

// 현재접속자 처리
$tmp_sql = " select count(*) as cnt from {$g5['login_table']} where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
$tmp_row = sql_fetch($tmp_sql);
$http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
if ($tmp_row['cnt']) {
$tmp_sql = " update {$g5['login_table']} set mb_id = '{$member['mb_id']}', lo_datetime = '".G5_TIME_YMDHIS."', lo_location = '{$g5['lo_location']}', lo_url = '{$g5['lo_url']}' where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($tmp_sql, FALSE);
} else {
$tmp_sql = " insert into {$g5['login_table']} ( lo_ip, mb_id, lo_datetime, lo_location, lo_url ) values ( '{$_SERVER['REMOTE_ADDR']}', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$g5['lo_location']}', '{$g5['lo_url']}' ) ";
sql_query($tmp_sql, FALSE);
// 시간이 지난 접속은 삭제한다
sql_query(" delete from {$g5['login_table']} where lo_datetime < '".date("Y-m-d H:i:s", G5_SERVER_TIME - (60 * $config['cf_login_minutes']))."' ");
// 부담(overhead)이 있다면 테이블 최적화
//$row = sql_fetch(" SHOW TABLE STATUS FROM `$mysql_db` LIKE '$g5['login_table']' ");
//if ($row['Data_free'] > 0) sql_query(" OPTIMIZE TABLE $g5['login_table'] ");
}

근데 html_process 클래스에 '현재접속자 처리'라는 코드 뭉치가 있네요.
이게 왜 여기에...... 신기하네요.

@thisgun
Copy link
Contributor

thisgun commented Nov 22, 2022

안녕하세요.
의견 주셔서 감사합니다.

아래 내용으로 다음 버전에 적용하겠습니다.

62d0bf5

@kkigomi
Copy link
Contributor Author

kkigomi commented Nov 22, 2022

정상 동작읋 확인했습니다.

감사합니다.

@kkigomi kkigomi closed this as completed Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants