모바일 쇼핑몰 카카오톡 링크 보내기 수정
This commit is contained in:
@ -1422,7 +1422,7 @@ function get_sns_share_link($sns, $url, $title, $img)
|
||||
$str = '<a href="https://plus.google.com/share?url='.urlencode($url).'" class="share-googleplus" target="_blank"><img src="'.$img.'" alt="구글플러스에 공유"></a>';
|
||||
break;
|
||||
case 'kakaotalk':
|
||||
$str = '<button type="button" onclick="kakaolink_message(this);"><img src="'.$img.'" alt="카카오톡링크 보내기"></button>';
|
||||
$str = '<a href="'.G5_MSHOP_URL.'/kakaolinkform.php?url='.urlencode($url).'&title='.urlencode($title).'" target="_blank"><img src="'.$img.'" alt="카카오톡링크 보내기"></a>';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
15
mobile/shop/kakaolinkform.php
Normal file
15
mobile/shop/kakaolinkform.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$g5['title'] = '카카오톡 메세지 입력';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
$skin = G5_MSHOP_SKIN_PATH.'/kakaolinkform.skin.php';
|
||||
|
||||
if(is_file($skin))
|
||||
include_once($skin);
|
||||
else
|
||||
echo '<p>'.str_replace(G5_PATH.'/', '', $skin).' 파일이 존재하지 않습니다.</p>';
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
@ -6,8 +6,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
?>
|
||||
|
||||
<script src="<?php echo G5_JS_URL; ?>/jquery.nicescroll.min.js"></script>
|
||||
<script src="<?php echo G5_JS_URL; ?>/jquery.fancyalert.js"></script>
|
||||
<script src="<?php echo G5_JS_URL; ?>/kakao.link.js"></script>
|
||||
<script src="<?php echo G5_JS_URL; ?>/jquery.fancyalert.js"></script
|
||||
|
||||
<form name="fitem" action="<?php echo $action_url; ?>" method="post" onsubmit="return fitem_submit(this);">
|
||||
<input type="hidden" name="it_id[]" value="<?php echo $it['it_id']; ?>">
|
||||
@ -458,51 +457,4 @@ function fitem_submit(f)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// 카카오톡 링크 보내기 메세지 입력
|
||||
function kakaolink_message()
|
||||
{
|
||||
var popup = "<div id=\"kakao_message\">";
|
||||
popup += "<form name=\"fkakao\" onsubmit=\"return kakaolink_send(this);\">";
|
||||
popup += "<label for=\"message\">메세지</label>";
|
||||
popup += "<textarea id=\"message\" name=\"message\"></textarea>";
|
||||
popup += "<input type=\"submit\" value=\"보내기\">";
|
||||
popup += "<button type=\"button\" onclick=\"send_cancel();\">취소</button>";
|
||||
popup += "</form>";
|
||||
popup += "</div>";
|
||||
|
||||
$("form[name=fitem]").before(popup);
|
||||
}
|
||||
|
||||
function send_cancel()
|
||||
{
|
||||
$("#kakao_message").remove();
|
||||
}
|
||||
|
||||
// 카카오톡 링크 보내기
|
||||
function kakaolink_send(f)
|
||||
{
|
||||
var msg = f.message.value;
|
||||
if(!msg) {
|
||||
alert("메세지를 입력해 주세요");
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
msg, url, appid, appname은 실제 서비스에서 사용하는 정보로 업데이트되어야 합니다.
|
||||
*/
|
||||
kakao.link("talk").send({
|
||||
msg : msg,
|
||||
url : "<?php echo $sns_url; ?>",
|
||||
appid : "<?php echo $_SERVER['HTTP_HOST']; ?>",
|
||||
appver : "2.0",
|
||||
appname : "<?php echo $config['cf_title']; ?>",
|
||||
type : "link"
|
||||
});
|
||||
|
||||
$("#kakao_message").remove();
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -11,9 +11,10 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
<?php
|
||||
$sql = " select b.* from {$g5['g5_shop_item_relation_table']} a left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id) where a.it_id = '{$it['it_id']}' and b.it_use='1' ";
|
||||
|
||||
$list = new item_list("relation.skin.php", $default['de_rel_list_mod'], 1, $default['de_rel_img_width'], $default['de_rel_img_height']);
|
||||
$list = new item_list("relation.10.skin.php", $default['de_rel_list_mod'], 1, $default['de_rel_img_width'], $default['de_rel_img_height']);
|
||||
$list->set_mobile(true);
|
||||
$list->set_query($sql);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
?>
|
||||
</div>
|
||||
|
||||
45
mobile/skin/shop/basic/kakaolinkform.skin.php
Normal file
45
mobile/skin/shop/basic/kakaolinkform.skin.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<script src="<?php echo G5_JS_URL; ?>/kakao.link.js"></script>
|
||||
|
||||
<div id="kakao_message">
|
||||
<p><?php echo $title; ?></p>
|
||||
<form name="fkakao" onsubmit="return kakaolink_send(this);">
|
||||
<label for="message">메세지</label>
|
||||
<textarea id="message" name="message"></textarea>
|
||||
<input type="submit" value="보내기">
|
||||
<button type="button" onclick="window.close();">취소</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 카카오톡 링크 보내기
|
||||
function kakaolink_send(f)
|
||||
{
|
||||
var msg = f.message.value;
|
||||
if(!msg) {
|
||||
alert("메세지를 입력해 주세요");
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
msg, url, appid, appname은 실제 서비스에서 사용하는 정보로 업데이트되어야 합니다.
|
||||
*/
|
||||
kakao.link("talk").send({
|
||||
msg : msg,
|
||||
url : "<?php echo $url; ?>",
|
||||
appid : "<?php echo $_SERVER['HTTP_HOST']; ?>",
|
||||
appver : "2.0",
|
||||
appname : "<?php echo $config['cf_title']; ?>",
|
||||
type : "link"
|
||||
});
|
||||
|
||||
return false;
|
||||
//window.close();
|
||||
}
|
||||
</script>
|
||||
@ -79,6 +79,8 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
|
||||
}
|
||||
|
||||
if ($this->view_sns) {
|
||||
$sns_url = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
|
||||
echo "<div class=\"sct_sns\">";
|
||||
echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_fb.png');
|
||||
echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_twt.png');
|
||||
@ -1,101 +0,0 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script>
|
||||
|
||||
<!-- 상품진열 10 시작 { -->
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
if ($i == 0) {
|
||||
if ($this->css) {
|
||||
echo "<ul id=\"sct_wrap\" class=\"{$this->css}\">\n";
|
||||
} else {
|
||||
echo "<ul id=\"sct_wrap\" class=\"sct scr_10\">\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<li class=\"sct_li\" style=\"width:{$this->img_width}px\">\n";
|
||||
|
||||
if ($this->href) {
|
||||
echo "<a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a sct_img\">\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_img) {
|
||||
echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
echo "</a>\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_id) {
|
||||
echo "<span class=\"sct_id\"><".stripslashes($row['it_id'])."></span>\n";
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
echo "<a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a sct_txt\">\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_name) {
|
||||
echo stripslashes($row['it_name'])."\n";
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
echo "</a>\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_basic && $row['it_basic']) {
|
||||
echo "<div class=\"sct_basic\">".stripslashes($row['it_basic'])."</div>\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_cust_price || $this->view_it_price) {
|
||||
|
||||
echo "<div class=\"sct_cost\">\n";
|
||||
|
||||
if ($this->view_it_cust_price && $row['it_cust_price']) {
|
||||
echo "<strike>".display_price($row['it_cust_price'])."</strike>\n";
|
||||
}
|
||||
|
||||
if ($this->view_it_price) {
|
||||
echo display_price(get_price($row), $row['it_tel_inq'])."\n";
|
||||
}
|
||||
|
||||
echo "</div>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($this->view_it_icon) {
|
||||
echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
|
||||
}
|
||||
|
||||
if ($this->view_sns) {
|
||||
echo "<div class=\"sct_sns\">";
|
||||
echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_fb.png');
|
||||
echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_twt.png');
|
||||
echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_goo.png');
|
||||
echo get_sns_share_link('kakaotalk', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_kakao.png');
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
echo "</a>\n";
|
||||
}
|
||||
|
||||
echo "</li>\n";
|
||||
}
|
||||
|
||||
if ($i > 0) echo "</ul>\n";
|
||||
|
||||
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
|
||||
?>
|
||||
<!-- } 상품진열 10 끝 -->
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#sct_wrap").fancyList("li.sct_li", "sct_clear");
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user