관리자 페이지 및 일부 데이터 업데이트 시 Event hook 추가

This commit is contained in:
kkigomi
2023-06-22 15:37:06 +09:00
parent 4eba618a82
commit bbbc568db8
15 changed files with 44 additions and 1 deletions

View File

@ -113,17 +113,20 @@ if ($w == "") {
set co_id = '$co_id', set co_id = '$co_id',
$sql_common "; $sql_common ";
sql_query($sql); sql_query($sql);
run_event('admin_content_created', $co_id);
} elseif ($w == "u") { } elseif ($w == "u") {
$sql = " update {$g5['content_table']} $sql = " update {$g5['content_table']}
set $sql_common set $sql_common
where co_id = '$co_id' "; where co_id = '$co_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_content_updated', $co_id);
} elseif ($w == "d") { } elseif ($w == "d") {
@unlink(G5_DATA_PATH . "/content/{$co_id}_h"); @unlink(G5_DATA_PATH . "/content/{$co_id}_h");
@unlink(G5_DATA_PATH . "/content/{$co_id}_t"); @unlink(G5_DATA_PATH . "/content/{$co_id}_t");
$sql = " delete from {$g5['content_table']} where co_id = '$co_id' "; $sql = " delete from {$g5['content_table']} where co_id = '$co_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_content_deleted', $co_id);
} }
if (function_exists('get_admin_captcha_by')) { if (function_exists('get_admin_captcha_by')) {

View File

@ -30,6 +30,7 @@ if ($w == "")
sql_query($sql); sql_query($sql);
$fa_id = sql_insert_id(); $fa_id = sql_insert_id();
run_event('admin_faq_item_created', $fa_id, $fm_id);
} }
else if ($w == "u") else if ($w == "u")
{ {
@ -37,11 +38,14 @@ else if ($w == "u")
set $sql_common set $sql_common
where fa_id = '$fa_id' "; where fa_id = '$fa_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_faq_item_updated', $fa_id, $fm_id);
} }
else if ($w == "d") else if ($w == "d")
{ {
$sql = " delete from {$g5['faq_table']} where fa_id = '$fa_id' "; $sql = " delete from {$g5['faq_table']} where fa_id = '$fa_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_faq_item_deleted', $fa_id, $fm_id);
} }
if ($w == 'd') if ($w == 'd')

View File

@ -49,9 +49,13 @@ if ($w == "") {
sql_query($sql); sql_query($sql);
$fm_id = sql_insert_id(); $fm_id = sql_insert_id();
run_event('admin_faq_master_created', $fm_id);
} elseif ($w == "u") { } elseif ($w == "u") {
$sql = " update {$g5['faq_master_table']} $sql_common where fm_id = '$fm_id' "; $sql = " update {$g5['faq_master_table']} $sql_common where fm_id = '$fm_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_faq_master_updated', $fm_id);
} elseif ($w == "d") { } elseif ($w == "d") {
@unlink(G5_DATA_PATH . "/faq/{$fm_id}_h"); @unlink(G5_DATA_PATH . "/faq/{$fm_id}_h");
@unlink(G5_DATA_PATH . "/faq/{$fm_id}_t"); @unlink(G5_DATA_PATH . "/faq/{$fm_id}_t");
@ -63,6 +67,8 @@ if ($w == "") {
// FAQ상세삭제 // FAQ상세삭제
$sql = " delete from {$g5['faq_table']} where fm_id = '$fm_id' "; $sql = " delete from {$g5['faq_table']} where fm_id = '$fm_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_faq_master_deleted', $fm_id);
} }
if ($w == "" || $w == "u") { if ($w == "" || $w == "u") {

View File

@ -19,6 +19,7 @@ for ($i = 0; $i < $post_count_chk; $i++) {
$sql = " delete from {$g5['mail_table']} where ma_id = '$ma_id' "; $sql = " delete from {$g5['mail_table']} where ma_id = '$ma_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_mail_deleted', $ma_id);
} }
goto_url('./mail_list.php'); goto_url('./mail_list.php');

View File

@ -21,6 +21,10 @@ if ($w == '') {
ma_time = '" . G5_TIME_YMDHIS . "', ma_time = '" . G5_TIME_YMDHIS . "',
ma_ip = '{$_SERVER['REMOTE_ADDR']}' "; ma_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql); sql_query($sql);
$ma_id = sql_insert_id();
run_event('admin_mail_created', $ma_id);
} elseif ($w == 'u') { } elseif ($w == 'u') {
$sql = " update {$g5['mail_table']} $sql = " update {$g5['mail_table']}
set ma_subject = '{$ma_subject}', set ma_subject = '{$ma_subject}',
@ -29,9 +33,12 @@ if ($w == '') {
ma_ip = '{$_SERVER['REMOTE_ADDR']}' ma_ip = '{$_SERVER['REMOTE_ADDR']}'
where ma_id = '{$ma_id}' "; where ma_id = '{$ma_id}' ";
sql_query($sql); sql_query($sql);
run_event('admin_mail_updated', $ma_id);
} elseif ($w == 'd') { } elseif ($w == 'd') {
$sql = " delete from {$g5['mail_table']} where ma_id = '{$ma_id}' "; $sql = " delete from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
sql_query($sql); sql_query($sql);
run_event('admin_mail_deleted', $ma_id);
} }
goto_url('./mail_list.php'); goto_url('./mail_list.php');

View File

@ -59,14 +59,16 @@ $sql_common = " nw_device = '{$posts['nw_device']}',
if ($w == "") { if ($w == "") {
$sql = " insert {$g5['new_win_table']} set $sql_common "; $sql = " insert {$g5['new_win_table']} set $sql_common ";
sql_query($sql); sql_query($sql);
$nw_id = sql_insert_id(); $nw_id = sql_insert_id();
run_event('admin_newwin_created', $nw_id);
} elseif ($w == "u") { } elseif ($w == "u") {
$sql = " update {$g5['new_win_table']} set $sql_common where nw_id = '$nw_id' "; $sql = " update {$g5['new_win_table']} set $sql_common where nw_id = '$nw_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_newwin_updated', $nw_id);
} elseif ($w == "d") { } elseif ($w == "d") {
$sql = " delete from {$g5['new_win_table']} where nw_id = '$nw_id' "; $sql = " delete from {$g5['new_win_table']} where nw_id = '$nw_id' ";
sql_query($sql); sql_query($sql);
run_event('admin_newwin_deleted', $nw_id);
} }
if ($w == "d") { if ($w == "d") {

View File

@ -108,6 +108,8 @@ $sql = " update {$g5['qa_config_table']}
qa_5 = '{$_POST['qa_5']}' "; qa_5 = '{$_POST['qa_5']}' ";
sql_query($sql); sql_query($sql);
run_event('admin_qa_config_updated');
if (function_exists('get_admin_captcha_by')) { if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove'); get_admin_captcha_by('remove');
} }

View File

@ -193,6 +193,7 @@ if ($w == "")
ca_name = '$ca_name', ca_name = '$ca_name',
$sql_common "; $sql_common ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_category_created', $ca_id);
} }
else if ($w == "u") else if ($w == "u")
{ {
@ -212,6 +213,7 @@ else if ($w == "u")
$sql .= " and ca_mb_id = '{$member['mb_id']}' "; $sql .= " and ca_mb_id = '{$member['mb_id']}' ";
sql_query($sql); sql_query($sql);
} }
run_event('shop_admin_category_updated', $ca_id);
} }
else if ($w == "d") else if ($w == "d")
{ {
@ -243,6 +245,7 @@ else if ($w == "d")
// 분류 삭제 // 분류 삭제
$sql = " delete from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' "; $sql = " delete from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_category_deleted', $ca_id);
} }
if(function_exists('get_admin_captcha_by')) if(function_exists('get_admin_captcha_by'))

View File

@ -75,6 +75,7 @@ if ($w == "")
$sql_common $sql_common
, ev_id = '$ev_id' "; , ev_id = '$ev_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_event_created', $ev_id);
} }
else if ($w == "u") else if ($w == "u")
{ {
@ -82,6 +83,7 @@ else if ($w == "u")
$sql_common $sql_common
where ev_id = '$ev_id' "; where ev_id = '$ev_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_event_updated', $ev_id);
} }
else if ($w == "d") else if ($w == "d")
{ {
@ -92,6 +94,7 @@ else if ($w == "d")
// 이벤트상품삭제 // 이벤트상품삭제
$sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' "; $sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_event_deleted', $ev_id);
$sql = " delete from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' "; $sql = " delete from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ";
sql_query($sql); sql_query($sql);

View File

@ -19,6 +19,7 @@ if ($w == "u")
iq_answer = '$iq_answer' iq_answer = '$iq_answer'
where iq_id = '$iq_id' "; where iq_id = '$iq_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_item_qa_updated', $iq_id);
if(trim($iq_answer)) { if(trim($iq_answer)) {
$sql = " select a.iq_email, a.iq_hp, b.it_name $sql = " select a.iq_email, a.iq_hp, b.it_name

View File

@ -23,6 +23,7 @@ if ($_POST['act_button'] == "선택삭제") {
$sql = "delete from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iiq_id}' "; $sql = "delete from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iiq_id}' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_item_qa_deleted', $iiq_id);
} }
} }

View File

@ -34,6 +34,7 @@ if ($w == "u")
is_reply_name = '".$member['mb_nick']."' is_reply_name = '".$member['mb_nick']."'
where is_id = '".$posts['is_id']."'"; where is_id = '".$posts['is_id']."'";
sql_query($sql); sql_query($sql);
run_event('shop_admin_item_use_updated', $posts['is_id']);
if( isset($_POST['it_id']) ) { if( isset($_POST['it_id']) ) {
update_use_cnt($_POST['it_id']); update_use_cnt($_POST['it_id']);

View File

@ -40,6 +40,7 @@ for ($i=0; $i<$count_post_chk; $i++)
{ {
$sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$iis_id}' "; $sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$iis_id}' ";
sql_query($sql); sql_query($sql);
run_event('shop_admin_item_use_deleted', $iis_id);
} }
if($iit_id){ if($iit_id){

View File

@ -47,6 +47,8 @@ if ($w == "")
iq_time = '".G5_TIME_YMDHIS."', iq_time = '".G5_TIME_YMDHIS."',
iq_ip = '".$_SERVER['REMOTE_ADDR']."' "; iq_ip = '".$_SERVER['REMOTE_ADDR']."' ";
sql_query($sql); sql_query($sql);
$iq_id = sql_insert_id();
run_event('shop_item_qa_created', $iq_id, $it_id);
$alert_msg = '상품문의가 등록 되었습니다.'; $alert_msg = '상품문의가 등록 되었습니다.';
} }
@ -68,6 +70,7 @@ else if ($w == "u")
iq_question = '$iq_question' iq_question = '$iq_question'
where iq_id = '$iq_id' "; where iq_id = '$iq_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_item_qa_updated', $iq_id, $it_id);
$alert_msg = '상품문의가 수정 되었습니다.'; $alert_msg = '상품문의가 수정 되었습니다.';
} }
@ -128,6 +131,7 @@ else if ($w == "d")
$sql = " delete from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' "; $sql = " delete from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' ";
sql_query($sql); sql_query($sql);
run_event('shop_item_qa_deleted', $iq_id, $it_id);
$alert_msg = '상품문의가 삭제 되었습니다.'; $alert_msg = '상품문의가 삭제 되었습니다.';
} }

View File

@ -59,6 +59,8 @@ if ($w == "")
if (!$default['de_item_use_use']) if (!$default['de_item_use_use'])
$sql .= ", is_confirm = '1' "; $sql .= ", is_confirm = '1' ";
sql_query($sql); sql_query($sql);
$is_id = sql_insert_id();
run_event('shop_item_use_created', $is_id, $it_id);
if ($default['de_item_use_use']) { if ($default['de_item_use_use']) {
$alert_msg = "평가하신 글은 관리자가 확인한 후에 출력됩니다."; $alert_msg = "평가하신 글은 관리자가 확인한 후에 출력됩니다.";
@ -80,6 +82,7 @@ else if ($w == "u")
is_score = '$is_score' is_score = '$is_score'
where is_id = '$is_id' "; where is_id = '$is_id' ";
sql_query($sql); sql_query($sql);
run_event('shop_item_use_updated', $is_id, $it_id);
$alert_msg = "사용후기가 수정 되었습니다."; $alert_msg = "사용후기가 수정 되었습니다.";
} }
@ -118,6 +121,7 @@ else if ($w == "d")
$sql = " delete from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' "; $sql = " delete from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' ";
sql_query($sql); sql_query($sql);
run_event('shop_item_use_deleted', $is_id, $it_id);
$alert_msg = "사용후기를 삭제 하였습니다."; $alert_msg = "사용후기를 삭제 하였습니다.";
} }