TShopping

標題: X1.5 FB插件 修改詳解 [打印本頁]

作者: woff    時間: 2011-7-1 21:26
標題: X1.5 FB插件 修改詳解
forum.php
找到
  1. $modcachelist = array(
  2. 'index' => array('announcements', 'onlinelist', 'forumlinks', 'advs_index',
  3. 'heats', 'historyposts', 'onlinerecord', 'userstats'),
  4. 'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
  5. 'icons', 'onlinelist', 'forumstick','threadtable_info', 'threadtableids', 'stamps'),
  6. 'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups', 'ranks',
  7. 'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
  8. 'threadtableids', 'threadtable_info'),
  9. 'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
  10. 'icons', 'domainwhitelist'),
  11. 'space' => array('fields_required', 'fields_optional', 'custominfo'),
  12. 'group' => array('grouptype'),
  13. );
複製代碼
換成
  1. $modcachelist = array(
  2. 'index' => array('announcements', 'onlinelist', 'forumlinks', 'advs_index',
  3. 'heats', 'historyposts', 'onlinerecord', 'userstats', 'plugin'),
  4. 'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
  5. 'icons', 'onlinelist', 'forumstick','threadtable_info', 'threadtableids', 'stamps', 'plugin'),
  6. 'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups', 'ranks',
  7. 'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
  8. 'threadtableids', 'threadtable_info', 'plugin'),
  9. 'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
  10. 'icons', 'domainwhitelist', 'plugin'),
  11. 'space' => array('fields_required', 'fields_optional', 'custominfo', 'plugin'),
  12. 'group' => array('grouptype', 'plugin'),
  13. );
複製代碼
group.php
找到
  1. $cachelist = array('grouptype', 'groupindex');
複製代碼
換成
  1. $cachelist = array('grouptype', 'groupindex', 'plugin');
複製代碼
home.php
找到
  1. $cachelist = array('magic','userapp','usergroups');
複製代碼
換成
  1. $cachelist = array('magic','userapp','usergroups', 'plugin');
複製代碼
misc.php
找到
  1. $modcachelist = array(
  2.         'ranklist' => array('forums'),
  3. );
複製代碼
換成
  1. $modcachelist = array(
  2.         'ranklist' => array('forums', 'plugin'),
  3. );
複製代碼
portal.php
找到
  1. $cachelist = array('userapp', 'portalcategory');
複製代碼
換成

  1. $cachelist = array('userapp', 'portalcategory', 'plugin');
複製代碼
template/default/common/header_common.htm
找到
  1. <html xmlns="http://www.w3.org/1999/xhtml">
複製代碼
換成
  1. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
複製代碼
找到
  1. <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
複製代碼
下面加上
  1. <meta http-equiv="X-UA-Compatible" content="IE=8" />
複製代碼
找到
  1. <meta http-equiv="MSThemeCompatible" content="Yes" />
複製代碼
下面加上
  1. <!--{if $_G[tid]}-->
  2.         <meta property="og:type" content="article"/>
  3.         <meta property="og:site_name" content="$_G['setting']['bbname']"/>
  4.         <meta property="og:title" content="$_G[forum_thread][subject] - $_G['setting']['bbname']"/>
  5.         <meta property="og:description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}"/>
  6.         <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  7.         <meta property="og:url" content="$_G[siteurl]thread-{$_G[tid]}-{$_G}-{if $extra}{echo $extra}{else}{echo 1}{/if}.html"/>
  8.         <!--{else}-->
  9.         <meta property="og:url" content="$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]"/>
  10.         <!--{/if}-->
  11.         <!--{if $iattrs}-->
  12.         <meta property="og:image" content="$iattrs"/>
  13.         <!--{else}-->
  14.         <meta property="og:image" content="$_G[siteurl]{BOARDIMG}"/>
  15.         <!--{/if}-->
  16.         <meta property="fb:app_id" content="$_G['cache']['plugin']['facebook_connect']['appid']"/>
  17.         <!--{/if}-->
複製代碼
template/default/common/footer.htm
找到
  1. <!--{eval output();}-->
複製代碼
上面加上
  1. <div id="fb-root"></div>
  2. <script type="text/javascript">
  3. window.fbAsyncInit = function() {
  4.         FB.init({appId:'$_G['cache']['plugin']['facebook_connect']['appid']', status:true, cookie:true, xfbml:true, channelUrl:'{$_G[siteurl]}channel.html'});
  5. <!--{if $_G[tid]}-->
  6.         <!--{if $_G['like'] == 'no'}-->
  7.         FB.Event.subscribe('edge.create', function() {
  8.                 location.replace('forum.php?mod=viewthread&tid={$_G[tid]}&page={$_G}&todo=like');
  9.         });
  10.         <!--{if $_G['fbc'] && $_G['cache']['plugin']['facebook_ltv']['fctv']}-->
  11.         FB.Event.subscribe('comment.create', function() {
  12.                 location.replace('forum.php?mod=viewthread&tid={$_G[tid]}&page={$_G}&todo=fcomm');
  13.         });
  14.         <!--{/if}-->
  15.         <!--{/if}-->
  16.         FB.Event.subscribe('edge.remove', function() {
  17.                 fbshare();
  18.         });
  19.         <!--{if $_G['like'] && $_G['fbc'] && $_G['cache']['plugin']['facebook_ltv']['fctv']}-->
  20.         FB.Event.subscribe('comment.remove', function() {
  21.                 location.replace('forum.php?mod=viewthread&tid={$_G[tid]}&page={$_G}&todo=unfcomm');
  22.         });
  23.         <!--{/if}-->
  24. <!--{/if}-->
  25. };
  26. (function() {
  27.         var e = document.createElement('script');
  28.         e.src = document.location.protocol + '//connect.facebook.net/zh_TW/all.js';
  29.         e.async = true;
  30.         document.getElementById('fb-root').appendChild(e);
  31. }());
  32. <!--{if $_G[tid]}-->
  33. function fbshare() {
  34.         FB.ui({
  35.                 method: 'feed',
  36.                 name: '$_G[forum_thread][subject]',
  37.                 <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  38.                 link: '$_G[siteurl]thread-{$_G[tid]}-1-1.html',
  39.                 <!--{else}-->
  40.                 link: '$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]',
  41.                 <!--{/if}-->
  42.                 <!--{if $iattrs}-->
  43.                 picture: '$iattrs',
  44.                 <!--{/if}-->
  45.                 caption: '$_G['setting']['bbname']',
  46.                 description: '{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}',
  47.                 message: ''
  48.         }, function(response) {
  49.                 <!--{if $_G['like']}-->
  50.                 if (response && response.post_id) {
  51.                         location.replace('forum.php?mod=viewthread&tid={$_G[tid]}&page={$_G}&todo=unlike');
  52.                 } else {
  53.                         location.replace('forum.php?mod=viewthread&tid={$_G[tid]}&page={$_G}&todo=unlike');
  54.                 }
  55.                 <!--{/if}-->
  56.         });
  57. }
  58. function fbsend() {
  59.         FB.ui({
  60.                 method: 'send',
  61.                 app_id: '$_G['cache']['plugin']['facebook_connect']['appid']',
  62.                 name: '$_G[forum_thread][subject]',
  63.                 <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  64.                 link: '$_G[siteurl]thread-{$_G[tid]}-1-1.html',
  65.                 <!--{else}-->
  66.                 link: '$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]',
  67.                 <!--{/if}-->
  68.                 <!--{if $iattrs}-->
  69.                 picture: '$iattrs',
  70.                 <!--{/if}-->
  71.                 description: '{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}'
  72.         });
  73. }
  74. function fbinvite() {
  75.         FB.ui({
  76.                 method: 'apprequests',
  77.                 message: '{lang facebook_invite_friend_addmsg}',
  78.                 filters: "['app_non_users']",
  79.                 title: '{lang facebook_invite_friend_add} {$_G['setting']['bbname']}'
  80.         });
  81. }
  82. <!--{/if}-->
  83. function fblogin() {
  84.         FB.login(function(response) {
  85.                 if (response.session) {
  86.                         if (response.perms) {
  87.                                 location.replace('fblogin.php?act=logging&rf='+urlencode(location.href));
  88.                         } else {
  89.                                 location.replace('index.php');
  90.                         }
  91.                 } else {
  92.                         location.replace('index.php');
  93.                 }
  94.         }, {perms:'email,user_likes,publish_stream'});
  95. }
  96. function urlencode(str) {
  97.         var output = '', x = 0, regex = /(^[a-zA-Z0-9_.]*)/;
  98.         str = str.toString();
  99.         while (x < str.length) {
  100.                 var match = regex.exec(str.substr(x));
  101.                 if (match != null && match.length > 1 && match[1] != '') {
  102.                         output += match[1];
  103.                         x += match[1].length;
  104.                 } else {
  105.                         if (str[x] == ' ') {
  106.                                 output += '+';
  107.                         } else {
  108.                                 var charCode = str.charCodeAt(x), hexVal = charCode.toString(16);
  109.                                 output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
  110.                         }
  111.                         x++;
  112.                 }
  113.         }
  114.         return output;
  115. }
  116. </script>
複製代碼
template/default/common/editor.css
找到
  1. #e_hide                        { background-position: -120px -40px; }
複製代碼
下面加上
  1. #e_like                        { background-position: -120px -60px; }
複製代碼
template/default/common/module.css
找到
  1. .showhide h4 { margin-bottom: 10px; color: #F66; font-size: 12px; text-align: center; }
複製代碼
下面加上
  1. .like_locked { min-height:100px; margin:10px 0; padding:10px 10px 10px 100px; border:1px dashed #ED442C; background: {WRAPBG} url(http://profile.ak.fbcdn.net/hprofile-ak-snc4/187910_131274550278977_3136957_s.jpg) no-repeat 6px 50%; font-size:14px; }
  2.                 .like_locked:hover { background:url(http://profile.ak.fbcdn.net/hprofile-ak-snc4/187910_131274550278977_3136957_s.jpg) no-repeat 6px 50%; }
  3.                 .like_locked strong { color: {NOTICETEXT}; }
  4.                 .like_locked a { color: {HIGHLIGHTLINK}; }
複製代碼
template/default/forum/discuzcode.htm
找到
  1. function attachlist($attach)
複製代碼
上面加上
  1. function tpl_like_show() {
  2. global $_G;
  3. }
  4. <!--{block return}--><div class="showhide"><h4>{lang post_hide}</h4>\\1</div>
  5. <!--{/block}-->
  6. <!--{eval return $return;}-->
  7. {eval
  8. }

  9. function tpl_like_hidden() {
  10. global $_G;
  11. }
  12. <!--{block return}--><div class="like_locked"><div style="line-height:50px;"><!--{if $_G[uid]}-->{$_G[username]}<!--{else}-->{lang guest}<!--{/if}-->{lang post_hide_like_hidden}<fb:like show_faces="false" layout="button_count" width="80"></fb:like></div><div style="line-height:40px;"><fb:like show_faces="true" width="450"></fb:like></div></div><!--{/block}-->
  13. <!--{eval return $return;}-->
  14. {eval
  15. }

  16. function tpl_hide_reply_like_hidden() {
  17. global $_G;
  18. }
  19. <!--{block return}--><div class="like_locked"><div style="line-height:50px;"><!--{if $_G[uid]}-->{$_G[username]}<!--{else}-->{lang guest}<!--{/if}-->{lang post_hide_reply_like_hidden}<fb:like show_faces="false" layout="button_count" width="80"></fb:like></div><div style="line-height:40px;"><fb:like show_faces="true" width="450"></fb:like></div></div><!--{/block}-->
  20. <!--{eval return $return;}-->
  21. {eval
  22. }

  23. function tpl_first_login() {
  24. global $_G;
  25. }
  26. <!--{block return}--><div class="like_locked">{lang first_login}<a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a> | <fb:login-button size="medium" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></div><!--{/block}-->
  27. <!--{eval return $return;}-->
  28. {eval
  29. }
複製代碼
template/default/forum/forumdisplay_fastpost.htm
找到
  1. <div class="pt hm">{lang login_to_post} <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a></div>
複製代碼
換成
  1. <div class="pt hm">{lang login_to_post} <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a> | <fb:login-button size="small" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></div>
複製代碼
template/default/forum/post.htm
找到
  1. <!--{if $isfirstpost && $_G['group']['allowhidecode']}--><a id="{$editorid}_hide" title="{lang e_hide}">Hide</a><!--{/if}-->
複製代碼
下面加上
  1. <!--{if $canuselike}--><a id="{$editorid}_like" title="{lang e_like}">Like</a><!--{/if}-->
複製代碼
template/default/forum/viewthread_fastpost.htm
找到
  1. <div class="pt hm">{lang login_to_reply} <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a></div>
複製代碼
換成
  1. <div class="pt hm">{lang login_to_reply} <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a> | <fb:login-button size="small" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></div>
複製代碼
template/default/forum/viewthread_node.htm
找到
  1. <!--{if $post[authorid] != $_G[uid]}-->
  2.                                                 <li class="buddy"><a href="home.php?mod=spacecp&ac=friend&op=add&uid=$post[authorid]&handlekey=addfriendhk_{$post[authorid]}" id="a_friend_li_{$post[pid]}" onclick="showWindow(this.id, this.href, 'get', 1, {'ctrlid':this.id,'pos':'00'});">{lang add_to_buddylist}</a></li>
  3.                                         <!--{/if}-->
複製代碼
下面加上
  1. <!--{if $post[fbid]}-->
  2.                                                 <li style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);"><a href="http://www.facebook.com/profile.php?id=$post[fbid]" target="_blank">{lang facebook_profile}</a></li>
  3.                                                 <li style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);"><a href="http://www.facebook.com/addfriend.php?id=$post[fbid]" target="_blank">{lang add_facebook_friend}</a></li>
  4.                                         <!--{/if}-->
複製代碼
template/default/forum/viewthread_node_body.htm
找到
  1. <div class="{if !$_G[forum_thread][special]}t_fsz{else}pcbs{/if}">
  2.                 <!--{if $post['first']}-->
複製代碼
下面加上
  1. <div style="line-height:40px;"><fb:like show_faces="false" send="true" width="450"></fb:like></div>
複製代碼
template/default/home/space_userabout.htm
找到
  1. <li class="ul_pm"><a href="home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_$space[uid]&touid=$space[uid]&pmid=0&daterange=2" id="a_sendpm_$space[uid]" onclick="showWindow('showMsgBox', this.href, 'get', 0)">{lang send_pm}</a></li>
複製代碼
下面加上
  1. <!--{if $sfb[fbid]}-->
  2.                                 <li><a href="http://www.facebook.com/profile.php?id=$sfb[fbid]" target="_blank" style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);">{lang facebook_profile}</a></li>
  3.                                 <li><a href="http://www.facebook.com/addfriend.php?id=$sfb[fbid]" target="_blank" style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);">{lang add_facebook_friend}</a></li>
  4.                         <!--{/if}-->
複製代碼
template/default/home/spacecp_avatar.htm
找到
  1. <hr class="l m0" />
複製代碼
下面加上
  1. <!--{if $sfb[fbid]}-->
  2.                                 <form method="post" autocomplete="off" name="setfbpic" id="setfbpic" action="fblogin.php?act=setfbpic" style="width:200px;float:right;margin-top:10px;">
  3.                                 <input name="auid" type="hidden" id="auid" value="$_G[uid]">
  4.                                 <input name="afbid" type="hidden" id="afbid" value="$sfb[fbid]">
  5.                                 <input name="agen" type="hidden" id="agen" value="$sgen[gender]">
  6.                                 <button class="pn pnc" id="setfbpicsubmit" type="submit" name="setfbpicsubmit" value="true" tabindex="1"><span>{lang setting_facebook_avatar}</span></button>
  7.                                 </form>
  8.                         <!--{/if}-->
複製代碼
template/default/member/login.htm
找到
  1. <h4>{lang login_guest}</h4>
複製代碼
都換成
  1. <h4>{lang login_guest}<p><fb:login-button size="small" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></p></h4>
複製代碼
最下面
  1. </script>
複製代碼
上面加上
  1. FB.XFBML.parse();
複製代碼
template/default/member/login_simple.htm
找到
  1. <div class="fastlg_fm y pns">
複製代碼
上面加上
  1. <div class="fastlg_fm y" style="margin-right: 10px; padding-right: 10px">
  2.                         <p><b>Facebook</b></p>
  3.                         <p><fb:login-button size="medium" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></p>
  4.                 </div>
複製代碼
template/default/member/register.htm
找到
  1. <h4>{lang login_now}</h4>
複製代碼
換成
  1. <h4>{lang login_now}<p><fb:login-button size="small" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></p></h4>
複製代碼
最下面

  1. </script>
複製代碼

上面加上

  1. FB.XFBML.parse();
複製代碼

static/js/editor.js
找到
  1. insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide']) ? true : false);
複製代碼
換成
  1. insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide', 'like']) ? true : false);
複製代碼
找到
  1. if(in_array(cmd, ['sml', 'url', 'quote', 'code', 'free', 'hide', 'aud', 'vid', 'fls', 'attach', 'image']) || cmd == 'tbl' || in_array(cmd, ['fontname', 'fontsize', 'forecolor']) && !arg) {
複製代碼
換成
  1. if(in_array(cmd, ['sml', 'url', 'quote', 'code', 'free', 'hide', 'like', 'aud', 'vid', 'fls', 'attach', 'image']) || cmd == 'tbl' || in_array(cmd, ['fontname', 'fontsize', 'forecolor']) && !arg) {
複製代碼
找到
  1. case 'hide':
複製代碼
下面加上
  1. case 'like':
複製代碼
找到
  1. var lang = {'quote' : '請輸入要插入的引用', 'code' : '請輸入要插入的代碼', 'hide' : '請輸入要隱藏的信息內容', 'free' : '如果您設置了帖子售價,請輸入購買前免費可見的信息內容'};
複製代碼
換成
  1. var lang = {'quote' : '請輸入要插入的引用', 'code' : '請輸入要插入的代碼', 'hide' : '請輸入要隱藏的信息內容', 'like' : '請輸入要點讚才能看的內容', 'free' : '如果您設置了帖子售價,請輸入購買前免費可見的信息內容'};
複製代碼
source/archiver/forum/viewthread.php
找到
  1. return nl2br(preg_replace(array('/&amp;(#\d{3,5};)/', "/\[hide=?\d*\](.+?)\[\/hide\]/is"),
  2.                 array('&\\1', '<b>**** Hidden Message *****</b>'),
複製代碼
換成
  1. return nl2br(preg_replace(array('/&amp;(#\d{3,5};)/', "/\[hide=?\d*\](.+?)\[\/hide\]/is", "/\[like](.*?)\[\/like]/si"),
  2.                 array('&\\1', '<b>**** Hidden Message *****</b>', '<b>**** Hidden Message *****</b>'),
複製代碼
source/function/function_delete.php
找到
  1. DB::query("DELETE FROM ".DB::table('common_member')." WHERE uid IN ($uids)", 'UNBUFFERED');
複製代碼
下面加上
  1. DB::query("DELETE FROM ".DB::table('facebook_connect')." WHERE uid IN ($uids)", 'UNBUFFERED');
複製代碼
source/function/function_discuzcode.php
找到
  1. if($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) {
  2.                         if(strpos($msglower, '') !== FALSE && $pid) {
  3.                                 if(strpos($msglower, '[hide]') !== FALSE) {
  4.                                         if($authorreplyexist === null) {
  5.                                                 $posttable = getposttablebytid($_G['tid']);
  6.                                                 $authorreplyexist = !$_G['forum']['ismoderator'] ? DB::result_first("SELECT pid FROM ".DB::table($posttable)." WHERE tid='$_G[tid]' AND ".($_G['uid'] ? "authorid='$_G[uid]'" : "authorid=0 AND useip='$_G[clientip]'")." LIMIT 1") : TRUE;
  7.                                         }
  8.                                         if($authorreplyexist) {
  9.                                                 $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", tpl_hide_reply(), $message);
  10.                                         } else {
  11.                                                 $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", tpl_hide_reply_hidden(), $message);
  12.                                                 $message .= '<script type="text/javascript">replyreload += \',\' + '.$pid.';</script>';
  13.                                         }
  14.                                 }
  15.                                 if(strpos($msglower, '[hide=') !== FALSE) {
  16.                                         $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "creditshide(\\1,'\\2', $pid)", $message);
  17.                                 }
  18.                         }
  19.                         include('function_discuzcode_i.php');
  20.                 }
複製代碼
source/function/function_post.php
找到
  1. "/\[hide=?\d*\](.+?)\[\/hide\]/is",
複製代碼
下面加上
  1. "/\[like](.*?)\[\/like]/si",
複製代碼
找到
  1. "[b]$language[post_hidden][/b]",
複製代碼
下面加上
  1. "[b]$language[post_hidden][/b]",
複製代碼
source/function/function_space.php
找到
  1. global $_G, $space;
複製代碼
換成
  1. global $_G, $space, $sfb;
複製代碼
找到
  1. $html .= "<li class='ul_pm'><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_$space[uid]&touid=$space[uid]&pmid=0&daterange=2\" id=\"a_sendpm_$space[uid]\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">".lang('space', 'block_profile_sendmessage')."</a></li>";
複製代碼
下面加上
  1. if($sfb[fbid]) {
  2.                                         $html .= "<li><a href=\"http://www.facebook.com/profile.php?id=$sfb[fbid]\" target=\"_blank\" style=\"background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);\">".lang('space', 'facebook_profile')."</a></li>";
  3.                                         $html .= "<li><a href=\"http://www.facebook.com/addfriend.php?id=$sfb[fbid]\" target=\"_blank\" style=\"background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);\">".lang('space', 'add_facebook_friend')."</a></li>";
  4.                                 }
複製代碼
source/include/post/post_editpost.php
找到
  1. $poll = $temppoll = '';
複製代碼
下面加上
  1. $canuselike = 1;
  2.         $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
  3.         if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
  4.                 if($isfirstpost) {
  5.                         if(!in_array($_G['groupid'], $gidarr)) {
  6.                                 $canuselike = 0;
  7.                         }
  8.                 } else {
  9.                         if(!in_array($_G['groupid'], $gidarr) || !$_G['cache']['plugin']['facebook_ltv']['cuirp']) {
  10.                                 $canuselike = 0;
  11.                         }
  12.                 }
  13.         } else {
  14.                 $canuselike = 0;
  15.         }
複製代碼
source/include/post/post_newreply.php
找到
  1. if(!submitcheck('replysubmit', 0, $seccodecheck, $secqaacheck)) {
複製代碼
下面加上
  1. $canuselike = 1;
  2.         $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
  3.         if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
  4.                 if(!in_array($_G['groupid'], $gidarr) || !$_G['cache']['plugin']['facebook_ltv']['cuirp']) {
  5.                         $canuselike = 0;
  6.                 }
  7.         } else {
  8.                 $canuselike = 0;
  9.         }
複製代碼
找到
  1. $post['message'] = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "[b]$language[post_hidden][/b]", $post['message']);
複製代碼
下面加上
  1. $post['message'] = preg_replace("/\[like](.*?)\[\/like]/si", "[b]$language[post_hidden][/b]", $post['message']);
複製代碼
source/include/post/post_newthread.php
找到
  1. $showthreadsorts = !empty($sortid) || $_G['forum']['threadsorts']['required'] && empty($special);
複製代碼
下面加上
  1. $canuselike = 1;
  2.         $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
  3.         if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
  4.                 if(!in_array($_G['groupid'], $gidarr)) {
  5.                         $canuselike = 0;
  6.                 }
  7.         } else {
  8.                 $canuselike = 0;
  9.         }
複製代碼
source/include/ thread/thread_printable.php
找到
  1. $post['message'] = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", '', $post['message']);
複製代碼
下面加上
  1. $post['message'] = preg_replace("/\[like\]\s*(.+?)\s*\[\/like\]/is", '', $post['message']);
複製代碼
source/language/lang_message.php
找到
  1. 'post_hide_nopermission' => '對不起,你沒有權限使用 [hide] 代碼,請返回修改。',
複製代碼
下面加上
  1. 'post_like_nopermission' => '對不起,你沒有權限使用 [like] 代碼,請返回修改。',
  2.         'post_like_dontinreply' => '對不起,回帖不可使用 [like] 代碼,請返回修改。',
複製代碼
source/language/lang_space.php
找到
  1. 'feed_view_only' => '只看此類動態',
複製代碼
下面加上
  1. 'facebook_profile' => '看FB檔案',
  2.         'add_facebook_friend' => '加FB好友',
複製代碼
source/language/forum/lang_template.php
找到
  1. 'post_hide_reply_hidden' => ',如果你要查看本帖隱藏內容請<a href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]" onclick="showWindow(\'reply\', this.href)">回復</a>',
複製代碼
下面加上
  1. 'post_hide_reply_like_hidden' => ',如果你要查看本帖隱藏內容請 <a href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]" onclick="showWindow(\'reply\', this.href)">回覆</a> 或 點讚:',
  2.   'post_hide_like_hidden' => ',如果你要查看本帖隱藏內容請點讚:',
  3.   'first_login' => '請先登入會員:',
  4.   'please_share_to_facebook' => '請點擊發佈分享到Facebook,謝謝!',
  5.   'thanks_for_fbshare' => '本帖已發佈到Facebook,感謝分享!',
  6.   'fbshare_ok' => '分享成功',
  7.   'facebook_profile' => '查看FB檔案',
  8.   'add_facebook_friend' => '加入FB好友',
複製代碼
找到
  1. 'e_hide' => '添加隱藏內容',
複製代碼
下面加上
  1. 'e_like' => '添加需點Facebook讚才可看的隱藏內容',
複製代碼
source/language/home/lang_template.php
找到
  1. 'view_blog' => '查看日誌',
複製代碼
下面加上
  1. 'facebook_profile' => '看FB檔案',
  2.   'add_facebook_friend' => '加FB好友',
複製代碼
找到
  1. 'setting_my_new_avatar' => '設置我的新頭像',
複製代碼
下面加上
  1. 'setting_facebook_avatar' => '自動設定成FB頭像',
複製代碼
source/module/forum/forum_post.php
找到
  1. if(empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) {
  2.         showmessage('post_hide_nopermission');
  3. }
複製代碼
下面加上
  1. if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
  2.         $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
  3.         if(empty($bbcodeoff) && !empty($message) && preg_match("/\[like](.*?)\[\/like]/si", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message)) && !in_array($_G['groupid'], $gidarr)) {
  4.                 showmessage('post_like_nopermission');
  5.         }
  6.         if(empty($bbcodeoff) && !empty($message) && preg_match("/\[like](.*?)\[\/like]/si", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message)) && !$_G['cache']['plugin']['facebook_ltv']['cuirp'] && ((!$orig['first'] && $_G['gp_action'] == 'edit') || $_G['gp_action'] == 'reply')) {
  7.                 showmessage('post_like_dontinreply');
  8.         }
  9. } else {
  10.         if(empty($bbcodeoff) && !empty($message) && preg_match("/\[like](.*?)\[\/like]/si", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) {
  11.                 showmessage('post_like_nopermission');
  12.         }
  13. }
複製代碼
129行下加
  1. if($_G['gp_action'] == 'edit') {
  2.         $orig = DB::fetch_first("SELECT first FROM ".DB::table(forum_post)." WHERE pid='$pid'");        
  3. }
複製代碼
source/module/forum/forum_viewthread.php
找到
  1. $query = DB::query("SELECT m.uid, m.username, m.groupid, m.adminid, m.regdate, m.credits, m.email, m.status AS memberstatus,
  2.                         ms.lastactivity, ms.lastactivity, ms.invisible AS authorinvisible,
  3.                         mc.*, mp.gender, mp.site, mp.icq, mp.qq, mp.yahoo, mp.msn, mp.taobao, mp.alipay,
  4.                         mf.medals, mf.sightml AS signature, mf.customstatus $fieldsadd
  5.                         FROM ".DB::table('common_member')." m
  6.                         LEFT JOIN ".DB::table('common_member_field_forum')." mf USING(uid)
  7.                         LEFT JOIN ".DB::table('common_member_status')." ms USING(uid)
  8.                         LEFT JOIN ".DB::table('common_member_count')." mc USING(uid)
  9.                         LEFT JOIN ".DB::table('common_member_profile')." mp USING(uid)
  10.                         $verifyadd
  11.                         WHERE m.uid IN (".dimplode(array_keys($postusers)).")");
複製代碼
換成
  1. $query = DB::query("SELECT m.uid, m.username, m.groupid, m.adminid, m.regdate, m.credits, m.email, m.status AS memberstatus,
  2.                         ms.lastactivity, ms.lastactivity, ms.invisible AS authorinvisible,
  3.                         mc.*, mp.gender, mp.site, mp.icq, mp.qq, mp.yahoo, mp.msn, mp.taobao, mp.alipay,
  4.                         mf.medals, mf.sightml AS signature, mf.customstatus, fc.fbid $fieldsadd
  5.                         FROM ".DB::table('common_member')." m
  6.                         LEFT JOIN ".DB::table('common_member_field_forum')." mf USING(uid)
  7.                         LEFT JOIN ".DB::table('common_member_status')." ms USING(uid)
  8.                         LEFT JOIN ".DB::table('common_member_count')." mc USING(uid)
  9.                         LEFT JOIN ".DB::table('common_member_profile')." mp USING(uid)
  10.                         LEFT JOIN ".DB::table('facebook_connect')." fc USING(uid)
  11.                         $verifyadd
  12.                         WHERE m.uid IN (".dimplode(array_keys($postusers)).")");
複製代碼
找到
  1. $postlist[$pid]['message'] = preg_replace("/\[attach\]\d+\[\/attach\]/i", '', $postlist[$pid]['message']);
複製代碼
下面加上
  1. if($postlist[$pid]['first'] == 1) {
  2.                         $getmsgi = $postlist[$pid]['message'];
  3.                 }
  4.         }
  5.         preg_match_all('/<img.+file=[\'"]([^\'"]+)[\'"].*>/i', $getmsgi, $iattrsA);
  6.         preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $getmsgi, $iattrsB);
  7.         if($iattrsA[1][0]) {
  8.                 $iattrs = $_G[siteurl].$iattrsA[1][0];
  9.         } elseif($iattrsB[1][0]) {
  10.                 $iattrs = $iattrsB[1][0];
  11.         } else {
  12.                 $iattrs = false;
複製代碼
source/module/home/home_space.php
找到
  1. if($uid) {
複製代碼
下面加上
  1. $sfb = DB::fetch_first("SELECT fbid FROM ".DB::table('facebook_connect')." WHERE uid='$uid' LIMIT 1");
複製代碼
source/module/home/home_spacecp.php
找到
  1. $space = getspace($_G['uid']);
複製代碼
上面加上
  1. $sfb = DB::fetch_first("SELECT fbid FROM ".DB::table('facebook_connect')." WHERE uid='$_G[uid]' LIMIT 1");
  2. $sgen = DB::fetch_first("SELECT gender FROM ".DB::table('common_member_profile')." WHERE uid='$_G[uid]' LIMIT 1");
複製代碼

※ 本次FB官方更新(12/19),提供臨時初步手動方式修改,若有急用的朋友,可按照下方步驟修改,有時間會發佈完整更新插件。
1. 修改風格檔 footer.htm:
找到

  1. FB.init({appId:'$_G['cache']['plugin']['facebook_connect']['appid']', status:true, cookie:true, xfbml:true, channelUrl:'{$_G[siteurl]}channel.html'});
複製代碼

替換為
  1. FB.init({appId:'$_G[cache][plugin][facebook_connect][appid]',channelURL:'{$_G[siteurl]}channel.html',status:true,cookie:true,oauth:true,xfbml:true});
複製代碼

找到
  1. function fblogin() {
  2.         FB.login(function(response) {
  3.                 if (response.session) {
  4.                         if (response.perms) {
  5.                                 location.replace('fblogin.php?act=logging&rf='+urlencode(location.href));
  6.                         } else {
  7.                                 location.replace('index.php');
  8.                         }
  9.                 } else {
  10.                         location.replace('index.php');
  11.                 }
  12.         }, {perms:'email,user_likes,publish_stream'});
  13. }
複製代碼

替換為
  1. function fblogin() {
  2.         FB.login(function(response) {
  3.                 if (response.authResponse) {
  4.                         location.replace('fblogin.php?act=logging&rf='+urlencode(location.href));
  5.                 } else {
  6.                         location.replace('index.php');
  7.                 }
  8.         }, {scope:'email,user_likes,publish_stream'});
  9. }
複製代碼


作者: siu-yee    時間: 2011-7-2 23:37
請問x2可以同用嗎

作者: woff    時間: 2011-7-2 23:40
沒試過 不過應該差不了多少 要試試看才知道
作者: 0917344886    時間: 2012-2-10 05:50
謝謝!謝謝!謝謝!
作者: HuangRu    時間: 2013-7-12 13:47
TEST TEST TEST TEST TEST TEST TEST




歡迎光臨 TShopping (http://www.tshopping.com.tw/) Powered by Discuz! X3.2