sns 공유하기 팝업으로 코드 수정

This commit is contained in:
chicpro
2013-05-13 15:26:27 +09:00
parent 0cfc7de653
commit 8995ce6e19
16 changed files with 89 additions and 60 deletions

16
js/sns.js Normal file
View File

@ -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;
});
});

View File

@ -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 = '<a href="https://www.facebook.com/sharer/sharer.php?u='.urlencode($url).'&amp;t='.urlencode($title).'" class="share-facebook" target="_blank"><img src="'.$img.'" alt="페이스북에 공유"></a>';
break;
case 'twitter':
$str = '<a href="https://twitter.com/share?url='.urlencode($url).'&amp;text='.urlencode($title).'" class="share-twitter" target="_blank"><img src="'.$img.'" alt="트위터에 공유"></a>';
break;
case 'googleplus':
$str = '<a href="https://plus.google.com/share?url='.urlencode($url).'" class="share-googleplus" target="_blank"><img src="'.$img.'" alt="구글플러스에 공유"></a>';
break;
}
return $str;
}
//==============================================================================
// 쇼핑몰 함수 모음 끝
//==============================================================================

View File

@ -228,14 +228,13 @@ else
<div id="sit_star_sns">
<?php
$sns_title = get_text($it['it_name']).' | '.get_text($config['cf_title']);
$sns_send = G4_SHOP_URL.'/sns_send.php?url='.urlencode(G4_SHOP_URL.'/item.php?it_id='.$it['it_id']);
$sns_send .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$it['it_id'];
?>
고객선호도 <span>별<?php echo $score?>개</span>
<img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $score?>.png" alt="" class="sit_star">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb2.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt2.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo2.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb2.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt2.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo2.png'); ?>
</div>
<?php } ?>
<table id="sit_ov_tbl">

View File

@ -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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_11">';
?>
@ -30,9 +29,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -6,8 +6,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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_10">';
?>
@ -21,9 +20,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -47,6 +47,8 @@ $sec = get_microtime() - $begin_time;
$file = $_SERVER['PHP_SELF'];
?>
<script src="<?php echo G4_JS_URL; ?>/sns.js"></script>
<?php
include_once(G4_PATH.'/tail.sub.php');
?>

View File

@ -210,14 +210,13 @@ else
<div id="sit_star_sns">
<?php
$sns_title = get_text($it['it_name']).' | '.get_text($config['cf_title']);
$sns_send = G4_SHOP_URL.'/sns_send.php?url='.urlencode(G4_SHOP_URL.'/item.php?it_id='.$it['it_id']);
$sns_send .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$it['it_id'];
?>
고객선호도 <span>별<?php echo $score?>개</span>
<img src="<?php echo G4_URL; ?>/img/shop/s_star<?php echo $score?>.png" alt="" class="sit_star">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb2.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt2.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo2.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb2.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt2.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo2.png'); ?>
</div>
<?php } ?>
<table id="sit_ov_tbl">

View File

@ -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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_10">';
?>
@ -34,9 +33,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_11">';
?>
@ -34,9 +33,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_12">';
?>
@ -34,9 +33,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_13">';
?>
@ -37,9 +36,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++)
<?php echo display_relation_item($row['it_id'], 70, 70, 5); // 관련 상품 ?>
</div>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -13,8 +13,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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_10">';
?>
@ -28,9 +27,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -13,8 +13,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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_11">';
?>
@ -28,9 +27,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -13,8 +13,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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_12">';
?>
@ -30,9 +29,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -13,8 +13,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 .= '&amp;title='.urlencode(cut_str($sns_title, 100));
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_13">';
?>
@ -33,9 +32,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
<?php echo display_relation_item($row['it_id'], 70, 70, 5); // 관련 상품 ?>
</div>
<div class="sct_sns">
<a href="<?php echo $sns_send; ?>&amp;sns=facebook" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=twitter" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="<?php echo $sns_send; ?>&amp;sns=google" target="_blank"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php

View File

@ -47,6 +47,8 @@ $sec = get_microtime() - $begin_time;
$file = $_SERVER['PHP_SELF'];
?>
<script src="<?php echo G4_JS_URL; ?>/sns.js"></script>
<?php
include_once(G4_PATH.'/tail.sub.php');
?>