묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
카카오보내기 애드온 오류좀 잡아주세요!!!
2014.11.23 17:11
<?php if(!defined("__XE__")) exit(); if(Context::getResponseMethod() == "XMLRPC" || Context::get('module') == "admin") return; if($called_position != "before_display_content") return; if($called_position == 'before_display_content' && Context::getResponseMethod() == 'HTML') { $pos_regx = "!<\!--AfterDocument\(([0-9]+),([0-9]+)\)-->!is"; $document_srl = intval(Context::get('document_srl')); $oDocumentModel = &getModel('document'); $oDocument = $oDocumentModel->getDocument(Context::get('document_srl'), false, false); if (!$oDocument) return; $appid = $addon_info->appid; if (!$appid) $appid = 'm.kakao.com'; $appver = $addon_info->appver; if (!$appver) $appver = '2.0'; $apiver = $addon_info->apiver; if (!$apiver) $apiver = '1.0'; $appname = $addon_info->appname; if (!$appname) $appname = '카카오'; $button_align = $addon_info->button_align; $button_width = $addon_info->button_width; if (!$button_width) $button_width = '35'; //밴드 보내기를 위한 알고리즘 $band_sand_title = $oDocument->getTitleText(); //제목 $mypeople_link=$band_sand_url = $oDocument->getPermanentUrl(); //링크주소 $mypeople_prefix=$band_sand_msg = $oDocument->getSummary(100); //글내용 $mypeople_prefix1=$band_sand = rawurlencode("제목 : ".$band_sand_title).urlencode("\n\n").rawurlencode($band_sand_msg).urlencode("\n\n더보기=>").$band_sand_url.urlencode("\n출처:").$appname; //모바일인지 체크 $mobile_agent = '/(iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS)/'; if(preg_match($mobile_agent, $_SERVER['HTTP_USER_AGENT'])){ $before = '<div style="text-align: '.$button_align.';"> <a href="kakaolink://sendurl?msg='.rawurlencode($band_sand_msg).urlencode("\n\n더보기=>").'&url='.$oDocument->getPermanentUrl().'&appid='.$appid.'&appver='.$appver.'&appname='.$appname.'" > <img src="/addons/msn/img/kakaotalkicon.png" width="'.$button_width.'" /></a> <a href="storylink://posting?post='.rawurlencode($band_sand_msg).urlencode("\n\n더보기=>").$oDocument->getPermanentUrl().'&appid='.$appid.'&apiver='.$apiver.'&appver='.$appver.'&appname='.$appname.'" ><img src="/addons/msn/img/kakaostoryicon.png" width="'.$button_width.'" /></a> <a href="bandapp://create/post?text='.$band_sand.'" ><img src="/addons/msn/img/bandicon.png" width="'.$button_width.'" /></a> <a href="https://m.mypeople.daum.net/mypeople/mweb/share.do?link='.$mypeople_link.'&prefix='.$mypeople_prefix.'&source_id=none" > <img src="/addons/msn/img/mypeople.png" border="0" width="'.$button_width.'" alt="마이피플 모바일용"></a> <a href="https://m.facebook.com/sharer.php?u='.$mypeople_link.'&ko='.$mypeople_prefix.'&source_id=none"> <img src="/addons/msn/img/facebook.png" border="0" width="'.$button_width.'" alt="페이스북 모바일용"></a> <a href="https://twitter.com/share?text='.$mypeople_prefix.'&url='.$mypeople_link.'&source_id=none"> <img src="/addons/msn/img/twitter.png" border="0" width="'.$button_width.'" alt="트위터 모바일용"></a> <a href="http://plus.google.com/share?url='.$mypeople_link.'?l=ko='.$mypeople_prefix.'&source_id=none"> <img src="/addons/msn/img/google.png" border="0" width="'.$button_width.'" alt="구글플러스 모바일용"></a> <a href="line://msg/text/'.$mypeople_prefix.'%0D%0A'.$mypeople_link.'&source_id=none"> <img src="/addons/msn/img/line.png" border="0" width="'.$button_width.'" alt="라인 모바일용"></a> </div>'; $output = preg_replace($pos_regx, "<!--AfterDocument($1,$2)-->".$before, $output); }else{ $before = '<div style="text-align: '.$button_align.';"> <img onclick=window.open("http://www.band.us/plugin/share?body='.$band_sand.'","'.$oDocument->getPermanentUrl().'","width=525,height=525,toolbar=no,menubar=no,titlebar=1,status=no,fullscreen=no"); style="CURSOR: pointer" src="/addons/msn/img/bandicon.png" title= "밴드에 공유하기!"width="'.$button_width.'" /> <a href="https://mypeople.daum.net/mypeople/web/share.do?link='.$mypeople_link.'&prefix='.$mypeople_prefix1.'&source_id=none" target="_blank"> <img src="/addons/msn/img/mypeople.png" border="0" width="'.$button_width.'" alt="마이피플 웹용"></a> <a href="https://www.facebook.com/sharer.php?u='.$mypeople_link.'&ko='.$mypeople_prefix.'&source_id=none" target="_blank"> <img src="/addons/msn/img/facebook.png" border="0" width="'.$button_width.'" alt="페이스북 웹용"></a> <a href="https://twitter.com/share?text='.$mypeople_prefix.'&url='.$mypeople_link.'&source_id=none" target="_blank"> <img src="/addons/msn/img/twitter.png" border="0" width="'.$button_width.'" alt="트위터 웹용"></a> <a href="http://plus.google.com/share?url='.$mypeople_link.'?l=ko='.$mypeople_prefix.'&source_id=none" target="_blank"> <img src="/addons/msn/img/google.png" border="0" width="'.$button_width.'" alt="구글플러스 웹용"></a> </div>'; $output = preg_replace($pos_regx, "<!--AfterDocument($1,$2)-->".$before, $output); } } ?>
댓글 2
-
가을풍경
2014.11.23 17:12
-
seyriz
2014.11.23 18:13
http://www.xpressengine.com/index.php?mid=tip&page=4&document_srl=22818572
이거 참조하시면 될 것 같습니다.
<a href="storylink://posting?post='.rawurlencode($band_sand_msg).urlencode("\n\n더보기=>").$oDocument->getPermanentUrl().'&appid='.$appid.'&apiver='.$apiver.'&appver='.$appver.'&appname='.$appname.'" ><img src="/addons/msn/img/kakaostoryicon.png" width="'.$button_width.'" /></a>
이부분 카카오스토리 잘되다가 갑자기 안되기 시작하네요 !!! 카카오스토리가 업데이트 되서 그런가요? 오류를 내면서 종료