바로 스크랩하기.
그누보드의 경우 스크랩 할 때 버튼을 누르면 스크랩 팝업창이 뜨고
팝업창 내에서 다시 스크랩을 해야 스크랩이 됩니다.
그런 과정 없이 버튼만 눌렀을때 스크랩 하는 기능입니다.
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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 22896 | |
| 22895 | |
| 22885 | |
| 22875 | |
| 22872 | |
| 22862 | |
| 22860 | |
| 22855 | |
| 22849 | |
| 22846 | |
| 22824 | |
| 22812 | |
| 22809 | |
| 22801 | |
| 22795 | |
| 22786 | |
| 22765 | |
| 22756 | |
| 22739 | |
| 22735 | |
| 22685 | |
| 22639 | |
| 22636 | |
| 22607 | |
| 22605 | |
| 22603 | |
| 22592 | |
| 22583 | |
| 22578 | |
| 22577 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기