그누보드의 경우 스크랩 할 때 버튼을 누르면 스크랩 팝업창이 뜨고
팝업창 내에서 다시 스크랩을 해야 스크랩이 됩니다.
그런 과정 없이 버튼만 눌렀을때 스크랩 하는 기능입니다.
view.skin.php에서 아래 구문을 추가. 해당 구문의 위치는 상관 없습니다
[code]
<form name="f_scrap_popin" action="<?php echo G5_BBS_URL?>/scrap_popin_update.php" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="wr_content" value="">
</form>
<script type="text/javascript">
function scrap_submit() {
var param = $("form[name=f_scrap_popin]").serialize();
$.ajax({
url: g5_bbs_url+"/scrap_popin_update.php",
type: "POST",
data: param,
success:function(data){
//alert("성공");
console.log(data);
var a_comment = /<noscript>(([\s\S]+?[\s\S]))<\/p>/.exec(data);
if (a_comment != null)
{
var content = String(a_comment[1].trim());
content = content.substring(3,content.length);
alert(content);
}
},
error:function(data){
alert("error");
}
});
}
</script>
[/code]
view.skin.php에서 아래 구문을 찾아서
[code]
<?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn btn_b03" onclick="win_scrap(this.href); return false;"><i class="fa fa-thumb-tack" aria-hidden="true"></i> 스크랩</a><?php } ?>
[/code]
[code]
<?php if ($scrap_href) { ?><a href="javascript:;" onclick="scrap_submit()" class="btn btn_b03"><i class="fa fa-thumb-tack" aria-hidden="true"></i> 스크랩</a><?php } ?>
[/code]
로 수정.
댓글 5개
게시글 목록
| 번호 | 제목 |
|---|---|
| 22569 | |
| 22566 | |
| 22565 | |
| 22559 | |
| 22530 | |
| 22527 | |
| 22525 | |
| 22521 | |
| 22518 | |
| 22506 | |
| 22500 | |
| 22490 | |
| 22487 | |
| 22481 | |
| 22480 | |
| 22473 | |
| 22471 | |
| 22468 | |
| 22453 | |
| 22449 | |
| 22440 | |
| 22436 | |
| 22435 | |
| 22415 | |
| 22407 | |
| 22404 | |
| 22376 | |
| 22364 | |
| 22362 | |
| 22353 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기