#91 에 따른 sns 공유 기능 추가

This commit is contained in:
chicpro
2013-05-02 16:14:55 +09:00
parent 5c2a585bbd
commit 4fd3c33fde
6 changed files with 67 additions and 17 deletions

View File

@ -199,7 +199,7 @@ function is_null_time($datetime)
// 1.02.01 $ca_id 추가
function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
{
global $member, $g4;
global $member, $g4, $config;
// 상품의 갯수
$items = $list_mod * $list_row;

View File

@ -11,11 +11,16 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$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));
if ($i == 1) echo '<ul class="sct sct_10">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_s', $img_width, $img_height, '', $type); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height, '', $type); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
@ -23,9 +28,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<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>
</div>
</li>
<?php }

View File

@ -11,11 +11,16 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$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));
if ($i == 1) echo '<ul class="sct sct_11">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_s', $img_width, $img_height, '', $type); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height, '', $type); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
@ -23,9 +28,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<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>
</div>
</li>
<?php }

View File

@ -11,12 +11,17 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$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));
if ($i == 1) echo '<ul class="sct sct_12">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_s', $img_width, $img_height, '', $type); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height, '', $type); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
@ -25,9 +30,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
</span>
</a>
<div class="sct_sns">
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<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>
</div>
</li>
<?php }

View File

@ -11,12 +11,17 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$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));
if ($i == 1) echo '<ul class="sct sct_13">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_s', $img_width, $img_height, '', $type); ?></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'].'_m', $img_width, $img_height, '', $type); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
@ -28,9 +33,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="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
<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>
</div>
</li>
<?php }

30
shop/sns_send.php Normal file
View File

@ -0,0 +1,30 @@
<?php
include_once('./_common.php');
$url = $_REQUEST['url'];
$title = str_replace('\"', '"',$_REQUEST['title']);
$title_url = $title.' : '.$url;
//$title = strcut_utf8($title, 140);
switch($_REQUEST['sns']) {
case 'facebook' :
header("Location:http://www.facebook.com/sharer/sharer.php?s=100&p[url]=".$url."&p[title]=".$title);
break;
case 'twitter' :
header("Location:http://twitter.com/home?status=".$title_url);
break;
case 'me2day' :
header("Location:http://me2day.net/posts/new?new_post[body]=".$title_url);
break;
case 'yozm' :
header("Location:http://yozm.daum.net/api/popup/prePost?sourceid=41&prefix=".$title_url);
break;
case 'google' :
header("Location:https://plus.google.com/share?url=".$url);
break;
default :
echo 'Error';
break;
}
?>