diff --git a/js/sns.js b/js/sns.js new file mode 100644 index 000000000..38ca4f725 --- /dev/null +++ b/js/sns.js @@ -0,0 +1,16 @@ +$(function() { + $(".share-facebook").click(function() { + window.open($(this).attr("href"), "win_facebook", "menubar=1,resizable=1,width=600,height=400"); + return false; + }); + + $(".share-twitter").click(function() { + window.open($(this).attr("href"), "win_twitter", "menubar=1,resizable=1,width=600,height=350"); + return false; + }); + + $(".share-googleplus").click(function() { + window.open($(this).attr("href"), "win_googleplus", "menubar=1,resizable=1,width=600,height=600"); + return false; + }); +}); \ No newline at end of file diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 0bc105446..17208d845 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -778,6 +778,27 @@ function display_item_icon($it) return $icon; } + +// sns 공유하기 +function get_sns_share_link($sns, $url, $title, $img) +{ + if(!$sns) + return ''; + + switch($sns) { + case 'facebook': + $str = '페이스북에 공유'; + break; + case 'twitter': + $str = '트위터에 공유'; + break; + case 'googleplus': + $str = '구글플러스에 공유'; + break; + } + + return $str; +} //============================================================================== // 쇼핑몰 함수 모음 끝 //============================================================================== diff --git a/mobile/shop/item.php b/mobile/shop/item.php index e70da4e4c..6da8e10df 100644 --- a/mobile/shop/item.php +++ b/mobile/shop/item.php @@ -228,14 +228,13 @@ else
고객선호도 - 페이스북에 공유 - 트위터에 공유 - 구글플러스에 공유 + + +
diff --git a/mobile/shop/list.skin.10.php b/mobile/shop/list.skin.10.php index c7d9b804c..bc953764d 100644 --- a/mobile/shop/list.skin.10.php +++ b/mobile/shop/list.skin.10.php @@ -7,8 +7,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) $href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']); - $sns_send = G4_SHOP_URL.'/sns_send.php?url='.urlencode(G4_SHOP_URL.'/item.php?it_id='.$row['it_id']); - $sns_send .= '&title='.urlencode(cut_str($sns_title, 100)); + $sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; if ($i == 1) echo '
diff --git a/shop/list.skin.10.php b/shop/list.skin.10.php index 635f3a7dc..88968fdf8 100644 --- a/shop/list.skin.10.php +++ b/shop/list.skin.10.php @@ -14,8 +14,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) } $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']); - $sns_send = G4_SHOP_URL.'/sns_send.php?url='.urlencode(G4_SHOP_URL.'/item.php?it_id='.$row['it_id']); - $sns_send .= '&title='.urlencode(cut_str($sns_title, 100)); + $sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; if ($i == 1) echo '