게시글 수정 / 공유 기능 추가

dev_bert
kyebyungha 3 years ago
parent 6b0aebc751
commit e729d440b1

@ -134,23 +134,18 @@ public class M_Bf_boardBOImpl extends AbstractBOManager implements M_Bf_boardBO
generalDAO.delete("delete_bf_board_img_by_b_no", paramMap);
String bd_no = RenaStringUtil.getData(paramMap, "bd_no");
DataMap map_img = new DataMap();
map_img.put("bd_no", bd_no);
int pick_img_index = RenaStringUtil.getDataToInt(paramMap, "pick_img_index");
for(int img_index = 0; img_index < pick_img_index; img_index++){
String append_src_img_file = RenaStringUtil.getData(paramMap, "append_src_img_file_" + img_index);
String append_300_img_file = RenaStringUtil.getData(paramMap, "append_300_img_file_" + img_index);
if(RenaStringUtil.isNullOrEmpty(append_src_img_file) == false){
map_img.put("append_src_img_file", append_src_img_file);
map_img.put("append_300_img_file", append_src_img_file);
DataMap dm = new DataMap();
dm.put("bd_no", bd_no);
generalDAO.update("insert_bf_board_img_by_b_no", map_img);
ArrayList list_file_key = (ArrayList) paramMap.get("list_file_key");
if(list_file_key !=null) {
for(int idx = 0; idx < list_file_key.size(); idx++){
dm.put("file_seq", list_file_key.get(idx));
generalDAO.insert("insert_bf_board_img_by_b_no", dm);
}
}
DataMap dm = new DataMap();
dm.put("bd_no", bd_no);
generalDAO.delete("delete_bf_board_vote_by_b_no", paramMap);
ArrayList list_vote_content = (ArrayList) paramMap.get("list_vote_content");
for(int idx = 0; idx < list_vote_content.size(); idx++){

@ -15,6 +15,14 @@
padding: 0;
border: 0;
</style>
<head>
<meta property="og:url" content="https://marsland.tistory.com" />
<meta property="og:type" content="website" />
<meta property="og:title" content="삽질하는 프로그래머 통통만두" />
<meta property="og:description" content="삽질하는 프로그래머 통통만두의 퐌타스틱한 삽질기" />
<meta property="og:image" content="https://t1.daumcdn.net/cfile/tistory/9983C83C5AFB757A18" />
<head>
<body>
<!-- wrap -->
@ -50,11 +58,11 @@
<div class="count_cont">
<div>
<div class="like_icon"></div>
<span>${model ['rm']['l_nt']!}</span>
<span class="like_cnt">${model ['rm']['l_nt']!}</span>
</div>
<div>
<div class="comment_icon"></div>
<span>${model ['rm']['c_nt']!}</span>
<span class="comment_cnt">${model ['rm']['c_nt']!}</span>
</div>
</div>
</div>
@ -114,7 +122,7 @@
<#if model['lm_pick_img']?has_content >
<#list model['lm_pick_img'] as item>
<div class="swiper-slide img_box" onclick="layer_open('#detail_img_pop');">
<img src="${URL_ROOT}/file/get.do?mt_file_seq=${item['mt_file_seq']!}">
<img class="main-img" src="${URL_ROOT}/file/get.do?mt_file_seq=${item['mt_file_seq']!}">
</div>
</#list>
</#if>
@ -308,17 +316,17 @@
<div class="shared">
<div class="item">
<a>
<div class="img"><img src="${URL_ROOT}/m/img/Icon_Share_Facebook.png"></div>
<div class="img facebook"><img src="${URL_ROOT}/m/img/Icon_Share_Facebook.png"></div>
페이스북
</a>
</div>
<div class="item">
<div class="item kakao" id="linkedKakao" >
<a>
<div class="img"><img src="${URL_ROOT}/m/img/Icon_Share_Kakao.png"></div>
카카오톡
</a>
</div>
<div class="item">
<div class="item copy">
<a>
<div class="img"><img src="${URL_ROOT}/m/img/Icon_Share_Clip.png"></div>
URL 복사
@ -331,7 +339,36 @@
<!-- //modal-wrapper -->
<div id="shareCopy" class="modal-wrapper">
<div class="modal_content" style="width: 400px;">
<div class="head">
<div class="title">공유하기</div>
<div class="modal_close_btn"><img src="../img/close_ico.png"></div>
</div>
<div class="content">
<p class="single-txt">URL이 복사 되었습니다. <br />원하는 곳에 붙여넣기 해 주세요.</p>
</div>
</div>
</div>
<script>
<!-- 페이스북 공유 -->
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0&appId=352672679497045";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
$("meta[property='og:title']").attr("property","og:title").attr("content" , "[이유식당]"+"${model ['rm']['title']!}");
$("meta[property='og:image']").attr("property","og:image").attr("content" , $(".main-img")[0].src);
$("meta[property='og:url']").attr("property","og:url").attr("content" , location.href);
$("meta[property='og:type']").attr("property","og:type").attr("content" , 'website');
$("meta[property='og:description']").attr("property","og:description").attr("content", "${model ['rm']['content']!}");
var $ct_no ;
var $reply_new_yn = "Y" ;
function fncRemove(e) {
@ -343,6 +380,84 @@
obj.style.height = (6+obj.scrollHeight)+"px";
}
$("#share-list").on("click", function() {
$('#sharePopup').addClass('open');
});
$('.modal_close_btn').on('click', function() {
$('.modal-wrapper').removeClass('open');
});
$(".copy .copy_text").val(window.location.href);
var pageTitle = "[이유식당]"+"${model ['rm']['title']!}";
var pageUrl = location.href
var shareUrlFB = "https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(pageUrl)+"&t="+encodeURI(pageTitle);
$(".facebook").on("click" , function(e) {
debugger;
FB.ui({
method : 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:url': '${URL_ROOT}/m/bf_board/view_bf_detail_board.do?bd_no=${model ['rm']['bd_no']!}',
'og:title': '${model ['rm']['title']!}',
'og:description': '${model ['rm']['content']!}',
'og:image': $(".main-img").length >0 ? $(".main-img")[0].src : "" ,
}
})
});
/*
e.preventDefault();
window.open(shareUrlFB, '', 'scrollbars=no, width=584, height=635');
*/
});
$(".kakao").on("click" , function(e) {
e.preventDefault();
});
$(".copy").on("click" , function(e) {
e.preventDefault();
var target = $("#copy");
target.val("${model ['rm']['content']!}");
var urlbox = document.getElementById( 'copy' );
urlbox.select();
document.execCommand('copy');
$("#shared").removeClass("open");
Swal.fire({text:"댓글 이 복사 되었습니다."});
});
Kakao.init("c0c39f65c1435fe0670ff76fe2296b06"); //41afd760326f3eb50892555cd0b16a8e > cheewoo
Kakao.Link.createDefaultButton({
container: '#linkedKakao',
objectType: 'feed',
content: {
title: "[이유식당]"+"${model ['rm']['title']!}",
description: "${model ['rm']['content']!}",
imageUrl: $(".main-img").length >0 ? $(".main-img")[0].src : "",
link: {
mobileWebUrl: window.location.href,
webUrl: window.location.href,
},
},
buttons: [
{
title: '상세 보기',
link: {
mobileWebUrl: window.location.href,
webUrl: window.location.href,
},
}
]
});
$(".vote_box").on("click", function() {
$(".result").toggleClass("active")

@ -1,42 +1,3 @@
<!-- 팝업 : 공유하기 -->
<!--
<div id="sharePopup" class="modal-wrapper">
<div class="modal_content" style="width: 320px;">
<div class="head">
<div class="title">공유하기</div>
<div class="modal_close_btn"><img src="../img/close_ico.png"></div>
</div>
<div class="content">
<ul class="share-list">
<li class="kakao" id="linkedKakao" style="padding-left:40px;padding-right:40px;"><a href="#"><img src="/bf/m/img/Icon_Share_Kakao.png" alt="" style="width:40px;" /></a></li>
<li class="facebook" style="padding-right:40px;"><a href="#"><img src="/bf/m/img/Icon_Share_Facebook.png" style="width:40px;" /></a></li>
<li class="copy">
<a href="#popup-url-copy" class="copy_btn" >
<img src="/bf/m/img/Icon_Share_Clip.png" alt="" style="width:60px;margin-top:-10px;"/>
<input type="hidden" class="copy_text" value=""/>
</a>
</li>
</ul>
</div>
</div>
</div>
-->
<!-- .popup-wrap -->
<!--
<div id="shareCopy" class="modal-wrapper">
<div class="modal_content" style="width: 400px;">
<div class="head">
<div class="title">공유하기</div>
<div class="modal_close_btn"><img src="../img/close_ico.png"></div>
</div>
<div class="content">
<p class="single-txt">URL이 복사 되었습니다. <br />원하는 곳에 붙여넣기 해 주세요.</p>
</div>
</div>
</div>
-->
<script>
$(document).ready(function(){
<#if model['script_msg']?exists>
@ -47,123 +8,11 @@
timer: 2000
});
</#if>
/*
$("#share-list").on("click", function() {
$('#sharePopup').addClass('open');
});
$('.modal_close_btn').on('click', function() {
$('.modal-wrapper').removeClass('open');
});
$(".copy .copy_text").val(window.location.href);
var pageTitle = document.title;
var pageUrl = location.href
var shareUrlFB = "https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(pageUrl)+"&t="+encodeURI(pageTitle);
$(".facebook").on("click" , function(e) {
e.preventDefault();
window.open(shareUrlFB, '', 'scrollbars=no, width=584, height=635');
});
$(".kakao").on("click" , function(e) {
e.preventDefault();
});
$(".copy").on("click" , function(e) {
e.preventDefault();
var target = $(this);
target.find("input").attr("type" , "text");
target.find("input").get(0).select();
target.find("input").get(0).setSelectionRange(0, 9999); // 추가
var success = document.execCommand("copy");
target.find("input").attr("type" , "hidden");
$('.modal-wrapper').removeClass('open');
$("#shareCopy").addClass('open');
});
// Kakao.init("c58d022c1221001970311eda6c640329"); //41afd760326f3eb50892555cd0b16a8e > cheewoo
Kakao.init("c0c39f65c1435fe0670ff76fe2296b06"); //41afd760326f3eb50892555cd0b16a8e > cheewoo
Kakao.Link.createDefaultButton({
container: '#linkedKakao',
objectType: 'feed',
content: {
title: pageTitle,
description: '이유식당 전문가 리뷰',
imageUrl:
'http://mud-kage.kakao.co.kr/dn/NTmhS/btqfEUdFAUf/FjKzkZsnoeE4o19klTOVI1/openlink_640x640s.jpg',
link: {
mobileWebUrl: window.location.href,
androidExecutionParams: window.location.href,
},
},
itemContent: {
profileText: 'Kakao',
profileImageUrl: 'http://mud-kage.kakao.co.kr/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
titleImageUrl: 'http://mud-kage.kakao.co.kr/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
titleImageText: 'Cheese cake',
titleImageCategory: 'Cake',
items: [
{
item: 'Cake1',
itemOp: '1000원',
},
{
item: 'Cake2',
itemOp: '2000원',
},
{
item: 'Cake3',
itemOp: '3000원',
},
{
item: 'Cake4',
itemOp: '4000원',
},
{
item: 'Cake5',
itemOp: '5000원',
},
],
sum: 'Total',
sumOp: '15000원',
},
social: {
likeCount: 10,
commentCount: 20,
sharedCount: 30,
},
buttons: [
{
title: '웹으로 이동',
link: {
mobileWebUrl: 'https://developers.kakao.com',
},
},
{
title: '앱으로 이동',
link: {
mobileWebUrl: 'https://developers.kakao.com',
},
},
]
});
*/
});
function fncGoRecommend() {
<#--location.href = "${URL_ROOT}/m/bf_food/list_bf_homemade_recommend.do?smc_no=" + $("#smc_no").val() + "&return_url=list_bf_homemade_recommend";-->
location.href = "${URL_ROOT}/m/bf_food/list_bf_homemade_recommend.do?return_url=list_bf_homemade_recommend";
}
</script>
</html>
Loading…
Cancel
Save