hook 함수명 수정

This commit is contained in:
thisgun committed 2019-03-18 16:19:11 +09:00
1 parent 9af0d855b3
commit eb803ae9c9
35 files changed
+80 -80

No files matched your search

+2 -2
View File
@@ -100,7 +100,7 @@ class G5_URI {
$url=parse_url($string_url);
$page_name = basename($url['path'],".php");
$array_page_names = apply_replace('url_clean_page_names', array('board', 'write'));
$array_page_names = run_replace('url_clean_page_names', array('board', 'write'));
if( strpos($string_url, G5_BBS_URL) === false || ! in_array($page_name, $array_page_names) ){ //게시판이 아니면 리턴
return $string_url;
@@ -142,7 +142,7 @@ class G5_URI {
if( isset($url['host']) ){
$array_file_paths = apply_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$array_file_paths = run_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$str_path = isset($url['path']) ? $url['path'] : '';
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
+1 -1
View File
@@ -76,7 +76,7 @@ function g5_delete_all_cache(){
delete_cache_latest($board_table);
}
start_event('adm_cache_delete', $board_tables);
run_event('adm_cache_delete', $board_tables);
}
+9 -9
View File
@@ -155,7 +155,7 @@ function alert($msg='', $url='', $error=true, $post=false)
global $g5, $config, $member;
global $is_admin;
start_event('alert', $msg, $url, $error, $post);
run_event('alert', $msg, $url, $error, $post);
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
@@ -173,7 +173,7 @@ function alert_close($msg, $error=true)
{
global $g5;
start_event('alert_close', $msg, $error);
run_event('alert_close', $msg, $error);
$msg = strip_tags($msg, '<br>');
@@ -251,7 +251,7 @@ function url_auto_link($str)
$str = preg_replace("/\t_gt_\t/", "&gt;", $str);
*/
return apply_replace('url_auto_link', $str);
return run_replace('url_auto_link', $str);
}
@@ -741,7 +741,7 @@ function get_group($gr_id, $is_cache=false)
$sql = " select * from {$g5['group_table']} where gr_id = '$gr_id' ";
$cache[$key] = apply_replace('get_group', sql_fetch($sql), $gr_id, $is_cache);
$cache[$key] = run_replace('get_group', sql_fetch($sql), $gr_id, $is_cache);
return $cache[$key];
}
@@ -764,7 +764,7 @@ function get_member($mb_id, $fields='*', $is_cache=false)
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ";
$cache[$mb_id][$key] = apply_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
$cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
return $cache[$mb_id][$key];
}
@@ -857,7 +857,7 @@ function is_admin($mb_id)
$is_authority = 'board';
}
return apply_replace('is_admin', $is_authority, $mb_id);
return run_replace('is_admin', $is_authority, $mb_id);
}
@@ -2543,7 +2543,7 @@ class html_process {
array_multisort($order, SORT_ASC, $index, SORT_ASC, $links);
$links = apply_replace('html_process_css_files', $links);
$links = run_replace('html_process_css_files', $links);
foreach($links as $link) {
if(!trim($link[1]))
@@ -2571,7 +2571,7 @@ class html_process {
array_multisort($order, SORT_ASC, $index, SORT_ASC, $scripts);
$scripts = apply_replace('html_process_script_files', $scripts);
$scripts = run_replace('html_process_script_files', $scripts);
foreach($scripts as $js) {
if(!trim($js[1]))
@@ -2789,7 +2789,7 @@ function get_qa_config($fld='*')
}
$sql = " select * from {$g5['qa_config_table']} ";
$cache = apply_replace('get_qa_config', sql_fetch($sql));
$cache = run_replace('get_qa_config', sql_fetch($sql));
return $cache;
}
+10 -10
View File
@@ -6,14 +6,14 @@ function get_config($is_cache=false){
static $cache = array();
$cache = apply_replace('get_config_cache', $cache, $is_cache);
$cache = run_replace('get_config_cache', $cache, $is_cache);
if( $is_cache && !empty($cache) ){
return $cache;
}
$sql = " select * from {$g5['config_table']} ";
$cache = apply_replace('get_config', sql_fetch($sql));
$cache = run_replace('get_config', sql_fetch($sql));
return $cache;
}
@@ -68,7 +68,7 @@ function get_board_db($bo_table, $is_cache=false){
static $cache = array();
$cache = apply_replace('get_board_db_cache', $cache, $bo_table, $is_cache);
$cache = run_replace('get_board_db_cache', $cache, $bo_table, $is_cache);
$key = md5($bo_table);
@@ -77,7 +77,7 @@ function get_board_db($bo_table, $is_cache=false){
return $cache[$key];
}
if( !($cache[$key] = apply_replace('get_board_db', array(), $bo_table)) ){
if( !($cache[$key] = run_replace('get_board_db', array(), $bo_table)) ){
$sql = " select * from {$g5['board_table']} where bo_table = '$bo_table' ";
@@ -259,7 +259,7 @@ function get_db_charset($charset){
$add_charset .= ' COLLATE utf8mb4_unicode_ci';
}
return apply_replace('get_db_charset', $add_charset, $charset);
return run_replace('get_db_charset', $add_charset, $charset);
}
function get_db_create_replace($sql_str){
@@ -284,7 +284,7 @@ function get_class_encrypt(){
return $cache;
}
$cache = apply_replace('get_class_encrypt', new str_encrypt());
$cache = run_replace('get_class_encrypt', new str_encrypt());
return $cache;
}
@@ -315,7 +315,7 @@ function get_permission_debug_show(){
$bool = true;
}
return apply_replace('get_permission_debug_show', $bool, $member);
return run_replace('get_permission_debug_show', $bool, $member);
}
function get_check_mod_rewrite(){
@@ -332,7 +332,7 @@ function get_check_mod_rewrite(){
function get_mb_icon_name($mb_id){
if( $icon_name = apply_replace('get_mb_icon_name', '', $mb_id) ){
if( $icon_name = run_replace('get_mb_icon_name', '', $mb_id) ){
return $icon_name;
}
@@ -348,7 +348,7 @@ function get_bo_table_banned_word(){
$folders[] = basename($dir);
}
return apply_replace('get_bo_table_banned_word', $folders);
return run_replace('get_bo_table_banned_word', $folders);
}
function get_board_sfl_select_options($sfl){
@@ -366,7 +366,7 @@ function get_board_sfl_select_options($sfl){
$str .= '<option value="wr_name,1" '.get_selected($sfl, 'wr_name,1').'>글쓴이</option>';
$str .= '<option value="wr_name,0" '.get_selected($sfl, 'wr_name,0').'>글쓴이(코)</option>';
return apply_replace('get_board_sfl_select_options', $str, $sfl);
return run_replace('get_board_sfl_select_options', $str, $sfl);
}
// 읽지 않은 메모 갯수 반환
+4 -4
View File
@@ -28,14 +28,14 @@ function get_hook_class(){
return null;
}
function put_event($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
function add_event($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
if( $hook = get_hook_class() ){
$hook->addAction($tag, $func, $priority, $args);
}
}
function start_event($tag, $arg = ''){
function run_event($tag, $arg = ''){
if( $hook = get_hook_class() ){
@@ -65,7 +65,7 @@ function start_event($tag, $arg = ''){
}
}
function put_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
function add_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
if( $hook = get_hook_class() ){
return $hook->addFilter($tag, $func, $priority, $args);
@@ -74,7 +74,7 @@ function put_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
return null;
}
function apply_replace($tag, $arg = ''){
function run_replace($tag, $arg = ''){
if( $hook = get_hook_class() ){
+6 -6
View File
@@ -13,7 +13,7 @@ function get_pretty_url($folder, $no='', $query_string='', $action='')
$segments = array();
$url = $add_query = '';
if( $url = apply_replace('get_pretty_url', $url, $folder, $no, $query_string, $action) ){
if( $url = run_replace('get_pretty_url', $url, $folder, $no, $query_string, $action) ){
return $url;
}
@@ -108,7 +108,7 @@ function short_url_clean($string_url, $add_qry=''){
$url=parse_url($string_url);
$page_name = basename($url['path'],".php");
$array_page_names = apply_replace('url_clean_page_names', array('board', 'write'));
$array_page_names = run_replace('url_clean_page_names', array('board', 'write'));
if( strpos($string_url, G5_BBS_URL) === false || ! in_array($page_name, $array_page_names) ){ //게시판이 아니면 리턴
return $string_url;
@@ -150,7 +150,7 @@ function short_url_clean($string_url, $add_qry=''){
if( isset($url['host']) ){
$array_file_paths = apply_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$array_file_paths = run_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$str_path = isset($url['path']) ? $url['path'] : '';
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
@@ -231,7 +231,7 @@ function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
$exists_title = $row['co_seo_title'];
} else {
return apply_replace('exist_check_seo_title', $seo_title, $type, $write_table, $sql_id);
return run_replace('exist_check_seo_title', $seo_title, $type, $write_table, $sql_id);
}
if ($exists_title)
@@ -296,7 +296,7 @@ function get_nginx_conf_rules($return_string=false){
$rules[] = '#### '.G5_VERSION.' nginx rules BEGIN #####';
$rules[] = 'if (!-e $request_filename){';
if( $add_rules = apply_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string) ){
if( $add_rules = run_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string) ){
$rules[] = $add_rules;
}
@@ -329,7 +329,7 @@ function get_mod_rewrite_rules($return_string=false){
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -d';
$rules[] = 'RewriteRule ^ - [L]';
if( $add_rules = apply_replace('add_mod_rewrite_rules', '', $get_path_url, $base_path, $return_string) ){
if( $add_rules = run_replace('add_mod_rewrite_rules', '', $get_path_url, $base_path, $return_string) ){
$rules[] = $add_rules;
}