그누보드의 경우 스크랩 할 때 버튼을 누르면 스크랩 팝업창이 뜨고
팝업창 내에서 다시 스크랩을 해야 스크랩이 됩니다.
그런 과정 없이 버튼만 눌렀을때 스크랩 하는 기능입니다.
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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 22349 | |
| 22347 | |
| 22312 | |
| 22308 | |
| 22303 | |
| 22282 | |
| 22269 | |
| 22259 | |
| 22253 | |
| 22234 | |
| 22221 | |
| 22197 | |
| 22191 | |
| 22179 | |
| 22151 | |
| 22144 | |
| 22135 | |
| 22130 | |
| 22118 | |
| 22110 | |
| 22098 | |
| 22095 | |
| 22076 | |
| 22057 | |
| 22053 | |
| 22051 | |
| 22050 | |
| 22046 | |
| 22044 | |
| 22042 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기