그누보드의 경우 스크랩 할 때 버튼을 누르면 스크랩 팝업창이 뜨고
팝업창 내에서 다시 스크랩을 해야 스크랩이 됩니다.
그런 과정 없이 버튼만 눌렀을때 스크랩 하는 기능입니다.
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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 20141 | |
| 20129 | |
| 20120 | |
| 20114 | |
| 20106 | |
| 20099 | |
| 20097 | |
| 20091 | |
| 20050 | |
| 20042 | |
| 20039 | |
| 20010 | |
| 19996 | |
| 19978 | |
| 19969 | |
| 19954 | |
| 19911 | |
| 19908 | |
| 19907 | |
| 19905 | |
| 19904 | |
| 19892 | |
| 19882 | |
| 19864 | |
| 19861 | |
| 19844 | |
| 19831 | |
| 19829 | |
| 19820 | |
| 19805 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기