카카오링크, 스토리링크, 마이피플 보내기
링크
컨텐츠 정보
- 15,011 조회
- 0 추천
-
목록
본문
참조:http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=31092
\r\n카카오링크, 스토리링크, 마이피플 보내기
\r\n\r\n
- \r\n
참없다 \r\n
- 작성일시 2013.01.06 12:42:03 \r\n
- 조회 721 \r\n
- 댓글 6
관련링크
\r\n\r\nhttp://bikedb.co.kr 74회 연결
\r\n첨부파일
\r\n\r\n본문
\r\n![](http://sir.co.kr/data/thumb/g4_tiptech/31092-8621211b870cdb5a668d4d3ca1f0b242.png)
![](http://sir.co.kr/data/thumb/g4_tiptech/31092-acc062b4f34b5da89c0986410ece67af.png)
![](http://sir.co.kr/data/thumb/g4_tiptech/31092-8db5230a0c6ce331bc79cc99ad630ee6.png)
\r\n
커피는막심 님 소스를 이용해서 만들어 보았습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=26976&sca=&sfl=wr_subject||wr_content&stx=커피는 막심
카카오링크 - http://www.kakao.com/link/ko/api
appid = Mobile Site Domain
appver = Mobile Site Version
appname = Mobile Site의 정확한 이름
스토리링크 - http://www.kakao.com/link/ko/api_story
파라미터 참조
/skin/board/스킨명/view.skin.php 수정
상단 적당한 곳에 추가
<script type="text/javascript" src="<?=$g4[path]?>/js/kakao.link.js"></script>
글 내용 하단에 추가
<?
// utf-8
$send_subject = $view[wr_subject];
// euc-kr
// $send_subject = iconv('euc-kr', 'utf-8', $view[wr_subject]);
$send_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
//$send_url = "http://$_SERVER[SERVER_NAME]/bbs/board.php?bo_table=$bo_table&wr_id=$view[wr_id]";
$kakaotalk_msg = urlencode($send_subject);
$kakaotalk_url = urlencode($send_url);
// 글 내용에서 HTML 제거하기
$kakaotalk_desc = strip_tags(preg_replace('!<img([^\>]*)src="([^\>]*?)\>!is', '', $view[content]));
// 글 내용에서 개행문자 제거하기
$kakaotalk_desc = str_replace("\r", " ", $kakaotalk_desc);
$kakaotalk_desc= str_replace("\n", " ", $kakaotalk_desc);
// euc-kr
//$kakaotalk_desc = iconv('euc-kr', 'utf-8', $kakaotalk_desc);
$kakaotalk_desc = cut_str($kakaotalk_desc, 50, "...");
// 이미지 없을때 기본이미지로...
$kakaotalk_imageurl = "http://".$_SERVER['SERVER_NAME']."/img/logo.jpg";
// 첨부된 이미지가 있다면 첫번째 이미지 사용
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$kakaotalk_imageurl = "http://".$_SERVER['SERVER_NAME']."/data/file/$bo_table/".$view[file][$i][file];
break;
}
}
$mypeople_prefix = urlencode($send_subject);
$mypeople_link = urlencode($send_url);
// 모바일기기 접속일 때
if (preg_match('/iPhone|iPod|iPad|BlackBerry|Android|Windows CE|LG|MOT|SAMSUNG|SonyEricsson|IEMobile|Mobile|lgtelecom|PPC|opera mobi|opera mini|nokia|webos/',$_SERVER['HTTP_USER_AGENT']) ) {
?>
<!-- 카카오스토리 링크 소스 -->
<script type="text/javascript">
function executeKakaoStoryLink()
{
kakao.link("story").send({
post : "<?=$kakaotalk_url?>",
appid : "도메인",
appver : "1.0",
appname : "사이트명",
urlinfo : JSON.stringify({title:"<?=$send_subject?>", desc:"<?=$kakaotalk_desc?>", imageurl:["<?=$kakaotalk_imageurl?>"], type:"article"})
});
}
</script>
<a href="kakaolink://sendurl?msg=<?=$kakaotalk_msg?>&url=<?=$kakaotalk_url?>&appid=도메인&appver=0.1&appname=사이트명"><img src="<?=$board_skin_path?>/img/kakaotalk.png" border="0" align="absmiddle" alt="카카오링크"></a>
<a href="javascript:executeKakaoStoryLink();"><img src="<?=$g4[shop_img_path]?>/kakaostory.png" border="0" align="absmiddle" alt="카카오스토리링크"></a>
<a href="https://m.mypeople.daum.net/mypeople/mweb/share.do?link=<?=$mypeople_link?>&prefix=<?=$mypeople_prefix?>&source_id=none"><img src="<?=$board_skin_path?>/mypeople.png" border="0" align="absmiddle" alt="마이피플 모바일용"></a><br>
<?
// 모바일기기 접속이 아닐때
} else {
?>
<a href="https://mypeople.daum.net/mypeople/web/share.do?link=<?=$mypeople_link?>&prefix=<?=$mypeople_prefix?>&source_id=none"><img src="<?=$g4[shop_img_path]?>/mypeople.png" border="0" align="absmiddle" alt="마이피플 웹용"></a><br>
<?
}
?>
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=26976&sca=&sfl=wr_subject||wr_content&stx=커피는 막심
카카오링크 - http://www.kakao.com/link/ko/api
appid = Mobile Site Domain
appver = Mobile Site Version
appname = Mobile Site의 정확한 이름
스토리링크 - http://www.kakao.com/link/ko/api_story
파라미터 참조
/skin/board/스킨명/view.skin.php 수정
상단 적당한 곳에 추가
<script type="text/javascript" src="<?=$g4[path]?>/js/kakao.link.js"></script>
글 내용 하단에 추가
<?
// utf-8
$send_subject = $view[wr_subject];
// euc-kr
// $send_subject = iconv('euc-kr', 'utf-8', $view[wr_subject]);
$send_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
//$send_url = "http://$_SERVER[SERVER_NAME]/bbs/board.php?bo_table=$bo_table&wr_id=$view[wr_id]";
$kakaotalk_msg = urlencode($send_subject);
$kakaotalk_url = urlencode($send_url);
// 글 내용에서 HTML 제거하기
$kakaotalk_desc = strip_tags(preg_replace('!<img([^\>]*)src="([^\>]*?)\>!is', '', $view[content]));
// 글 내용에서 개행문자 제거하기
$kakaotalk_desc = str_replace("\r", " ", $kakaotalk_desc);
$kakaotalk_desc= str_replace("\n", " ", $kakaotalk_desc);
// euc-kr
//$kakaotalk_desc = iconv('euc-kr', 'utf-8', $kakaotalk_desc);
$kakaotalk_desc = cut_str($kakaotalk_desc, 50, "...");
// 이미지 없을때 기본이미지로...
$kakaotalk_imageurl = "http://".$_SERVER['SERVER_NAME']."/img/logo.jpg";
// 첨부된 이미지가 있다면 첫번째 이미지 사용
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$kakaotalk_imageurl = "http://".$_SERVER['SERVER_NAME']."/data/file/$bo_table/".$view[file][$i][file];
break;
}
}
$mypeople_prefix = urlencode($send_subject);
$mypeople_link = urlencode($send_url);
// 모바일기기 접속일 때
if (preg_match('/iPhone|iPod|iPad|BlackBerry|Android|Windows CE|LG|MOT|SAMSUNG|SonyEricsson|IEMobile|Mobile|lgtelecom|PPC|opera mobi|opera mini|nokia|webos/',$_SERVER['HTTP_USER_AGENT']) ) {
?>
<!-- 카카오스토리 링크 소스 -->
<script type="text/javascript">
function executeKakaoStoryLink()
{
kakao.link("story").send({
post : "<?=$kakaotalk_url?>",
appid : "도메인",
appver : "1.0",
appname : "사이트명",
urlinfo : JSON.stringify({title:"<?=$send_subject?>", desc:"<?=$kakaotalk_desc?>", imageurl:["<?=$kakaotalk_imageurl?>"], type:"article"})
});
}
</script>
<a href="kakaolink://sendurl?msg=<?=$kakaotalk_msg?>&url=<?=$kakaotalk_url?>&appid=도메인&appver=0.1&appname=사이트명"><img src="<?=$board_skin_path?>/img/kakaotalk.png" border="0" align="absmiddle" alt="카카오링크"></a>
<a href="javascript:executeKakaoStoryLink();"><img src="<?=$g4[shop_img_path]?>/kakaostory.png" border="0" align="absmiddle" alt="카카오스토리링크"></a>
<a href="https://m.mypeople.daum.net/mypeople/mweb/share.do?link=<?=$mypeople_link?>&prefix=<?=$mypeople_prefix?>&source_id=none"><img src="<?=$board_skin_path?>/mypeople.png" border="0" align="absmiddle" alt="마이피플 모바일용"></a><br>
<?
// 모바일기기 접속이 아닐때
} else {
?>
<a href="https://mypeople.daum.net/mypeople/web/share.do?link=<?=$mypeople_link?>&prefix=<?=$mypeople_prefix?>&source_id=none"><img src="<?=$g4[shop_img_path]?>/mypeople.png" border="0" align="absmiddle" alt="마이피플 웹용"></a><br>
<?
}
?>
[이 게시물은 관리자님에 의해 2013-11-18 21:29:50 11.H_BBS에서 이동 됨]
관련자료
-
링크
댓글 0
등록된 댓글이 없습니다.