그누보드의 경우 스크랩 할 때 버튼을 누르면 스크랩 팝업창이 뜨고
팝업창 내에서 다시 스크랩을 해야 스크랩이 됩니다.
그런 과정 없이 버튼만 눌렀을때 스크랩 하는 기능입니다.
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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 22041 | |
| 22035 | |
| 22033 | |
| 22028 | |
| 22019 | |
| 22006 | |
| 22005 | |
| 21995 | |
| 21989 | |
| 21978 | |
| 21972 | |
| 21961 | |
| 21956 | |
| 21944 | |
| 21934 | |
| 21932 | |
| 21924 | |
| 21922 | |
| 21921 | |
| 21910 | |
| 21908 | |
| 21897 | |
| 21883 | |
| 21881 | |
| 21875 | |
| 21854 | |
| 21852 | |
| 21851 | |
| 21829 | |
| 21817 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기