Skip to content

Commit

Permalink
1:1 문의 답변 오류 및 스킨 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Jan 5, 2021
1 parent 6368a5b commit c5c8924
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bbs/qawrite_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

//모든 회원의 토큰을 검사합니다.
if (!($token && $write_token === $token))
alert('토큰 에러로 삭제 불가합니다.');
alert('올바른 방법으로 이용해 주십시오.');

// 1:1문의 설정값
$qaconfig = get_qa_config();
Expand Down
14 changes: 7 additions & 7 deletions mobile/skin/qa/basic/list.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
?>

<form name="fqalist" id="fqalist" action="./qadelete.php" onsubmit="return fqalist_submit(this);" method="post">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo get_text($token); ?>">

<?php if ($admin_href || $write_href) { ?>
<ul class="btn_top top btn_bo_user">
<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin btn"><i class="fa fa-cog fa-spin fa-fw"></i><span class="sound_only">관리자</span></a></li><?php } ?>
Expand Down Expand Up @@ -41,12 +47,6 @@
<!-- } 카테고리 끝 -->
<?php } ?>

<form name="fqalist" id="fqalist" action="./qadelete.php" onsubmit="return fqalist_submit(this);" method="post">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo get_text($token); ?>">

<?php if ($is_checkbox) { ?>
<div class="all_chk chk_box">
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);" class="selec_chk">
Expand Down Expand Up @@ -93,8 +93,8 @@
<?php if ($i == 0) { echo '<li class="empty_list">게시물이 없습니다.</li>'; } ?>
</ul>
</div>
</form>
</div>
</form>

<?php if($is_checkbox) { ?>
<noscript>
Expand Down
20 changes: 19 additions & 1 deletion mobile/skin/qa/basic/view.answerform.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
?>
<h2>답변등록</h2>

<form name="fanswer" method="post" action="./qawrite_update.php" autocomplete="off">
<form name="fanswer" method="post" action="./qawrite_update.php" onsubmit="return fwrite_submit(this);" autocomplete="off">
<input type="hidden" name="qa_id" value="<?php echo $view['qa_id']; ?>">
<input type="hidden" name="w" value="a">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<?php
$option = '';
$option_hidden = '';
Expand Down Expand Up @@ -104,6 +105,23 @@ function fwrite_submit(f)
return false;
}

$.ajax({
type: "POST",
url: g5_bbs_url+"/ajax.write.token.php",
data: { 'token_case' : 'qa_write' },
cache: false,
async: false,
dataType: "json",
success: function(data) {
if (typeof data.token !== "undefined") {
token = data.token;
if(typeof f.token === "undefined")
$(f).prepend('<input type="hidden" name="token" value="">');
$(f).find("input[name=token]").val(token);
}
}
});

document.getElementById("btn_submit").disabled = "disabled";

return true;
Expand Down
2 changes: 1 addition & 1 deletion mobile/skin/qa/basic/view.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<li>
<button type="button" class="btn_more_opt btn_b03 btn"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>
<ul class="more_opt">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 수정</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" onclick="del(this.href); return false;"><i class="fa fa-trash-o" aria-hidden="true"></i> 삭제</a></li><?php } ?>
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 수정</a></li><?php } ?>
</ul>
</li>
</ul>
Expand Down
18 changes: 18 additions & 0 deletions skin/qa/basic/view.answerform.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<?php
$option = '';
$option_hidden = '';
Expand Down Expand Up @@ -106,6 +107,23 @@ function fwrite_submit(f)
return false;
}

$.ajax({
type: "POST",
url: g5_bbs_url+"/ajax.write.token.php",
data: { 'token_case' : 'qa_write' },
cache: false,
async: false,
dataType: "json",
success: function(data) {
if (typeof data.token !== "undefined") {
token = data.token;
if(typeof f.token === "undefined")
$(f).prepend('<input type="hidden" name="token" value="">');
$(f).find("input[name=token]").val(token);
}
}
});

document.getElementById("btn_submit").disabled = "disabled";

return true;
Expand Down
14 changes: 7 additions & 7 deletions theme/basic/mobile/skin/qa/basic/list.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
?>

<form name="fqalist" id="fqalist" action="./qadelete.php" onsubmit="return fqalist_submit(this);" method="post">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo get_text($token); ?>">

<?php if ($admin_href || $write_href) { ?>
<ul class="btn_top top btn_bo_user">
<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin btn"><i class="fa fa-cog fa-spin fa-fw"></i><span class="sound_only">관리자</span></a></li><?php } ?>
Expand Down Expand Up @@ -41,12 +47,6 @@
<!-- } 카테고리 끝 -->
<?php } ?>

<form name="fqalist" id="fqalist" action="./qadelete.php" onsubmit="return fqalist_submit(this);" method="post">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo get_text($token); ?>">

<?php if ($is_checkbox) { ?>
<div class="all_chk chk_box">
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);" class="selec_chk">
Expand Down Expand Up @@ -93,8 +93,8 @@
<?php if ($i == 0) { echo '<li class="empty_list">게시물이 없습니다.</li>'; } ?>
</ul>
</div>
</form>
</div>
</form>

<?php if($is_checkbox) { ?>
<noscript>
Expand Down
20 changes: 19 additions & 1 deletion theme/basic/mobile/skin/qa/basic/view.answerform.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
?>
<h2>답변등록</h2>

<form name="fanswer" method="post" action="./qawrite_update.php" autocomplete="off">
<form name="fanswer" method="post" action="./qawrite_update.php" onsubmit="return fwrite_submit(this);" autocomplete="off">
<input type="hidden" name="qa_id" value="<?php echo $view['qa_id']; ?>">
<input type="hidden" name="w" value="a">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<?php
$option = '';
$option_hidden = '';
Expand Down Expand Up @@ -104,6 +105,23 @@ function fwrite_submit(f)
return false;
}

$.ajax({
type: "POST",
url: g5_bbs_url+"/ajax.write.token.php",
data: { 'token_case' : 'qa_write' },
cache: false,
async: false,
dataType: "json",
success: function(data) {
if (typeof data.token !== "undefined") {
token = data.token;
if(typeof f.token === "undefined")
$(f).prepend('<input type="hidden" name="token" value="">');
$(f).find("input[name=token]").val(token);
}
}
});

document.getElementById("btn_submit").disabled = "disabled";

return true;
Expand Down
11 changes: 3 additions & 8 deletions theme/basic/mobile/skin/qa/basic/view.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@
<?php } ?>
<li>
<button type="button" class="btn_more_opt btn_b03 btn"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>
<?php ob_start(); ?>
<ul class="more_opt">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 수정</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" onclick="del(this.href); return false;"><i class="fa fa-trash-o" aria-hidden="true"></i> 삭제</a></li><?php } ?>
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 수정</a></li><?php } ?>
</ul>
<?php
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</li>
</ul>
<script>
Expand Down Expand Up @@ -113,8 +108,8 @@

<?php if ($prev_href || $next_href) { ?>
<ul class="bo_v_nb">
<?php if ($prev_href) { ?><li class="bo_v_prev"><a href="<?php echo $prev_href ?>"><i class="fa fa-chevron-up" aria-hidden="true"></i><span class="sound_only">이전글</span> <?php echo $prev_wr_subject;?></a></li><?php } ?>
<?php if ($next_href) { ?><li class="bo_v_next"><a href="<?php echo $next_href ?>"><i class="fa fa-chevron-down" aria-hidden="true"></i><span class="sound_only">다음글</span> <?php echo $next_wr_subject;?></a></li><?php } ?>
<?php if ($prev_href) { ?><li class="bo_v_prev"><a href="<?php echo $prev_href ?>"><i class="fa fa-chevron-up" aria-hidden="true"></i><span class="sound_only">이전글</span> <?php echo $prev_qa_subject;?></a></li><?php } ?>
<?php if ($next_href) { ?><li class="bo_v_next"><a href="<?php echo $next_href ?>"><i class="fa fa-chevron-down" aria-hidden="true"></i><span class="sound_only">다음글</span> <?php echo $next_qa_subject;?></a></li><?php } ?>
</ul>
<?php } ?>
</article>
Expand Down
18 changes: 18 additions & 0 deletions theme/basic/skin/qa/basic/view.answerform.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<?php
$option = '';
$option_hidden = '';
Expand Down Expand Up @@ -106,6 +107,23 @@ function fwrite_submit(f)
return false;
}

$.ajax({
type: "POST",
url: g5_bbs_url+"/ajax.write.token.php",
data: { 'token_case' : 'qa_write' },
cache: false,
async: false,
dataType: "json",
success: function(data) {
if (typeof data.token !== "undefined") {
token = data.token;
if(typeof f.token === "undefined")
$(f).prepend('<input type="hidden" name="token" value="">');
$(f).find("input[name=token]").val(token);
}
}
});

document.getElementById("btn_submit").disabled = "disabled";

return true;
Expand Down

0 comments on commit c5c8924

Please sign in to comment.