數碼中文坊

 取回密碼
 我要註冊
檢視: 2328|回覆: 0

[分享] Discuz X Facebook Connect

[複製連結]
發表於 2020-9-6 15:33:44 | 顯示全部樓層 |閱讀模式

發佈類型: 外掛(插件)
Discuz! 版本: X 1.x X 2.0 X 2.5 X 3.0 X 3.1 X 3.2 X 3.3 X 3.4 
下載網址: https://bbs.tennyy.com/archiver/tid-40550.html
對映網址: http://www.iot.idv.tw/ucenter/archiver/?tid-3216.html

馬上註冊,結交更多好友,享用更多功能,讓你輕鬆瀏覽論壇。

你需要 登入 才可以下載或檢視,沒有帳號?我要註冊

x
本文章最後由 iothk 於 2020-9-6 04:57 PM 編輯

forum.php

  1. 'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum'),
複製代碼

替換成
  1. 'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum', 'plugin'),
複製代碼


  1. 'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum'),
複製代碼

替換成
  1. 'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum', 'plugin'),
複製代碼


  1. 'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum'),
  2.       'redirect'      => array('threadtableids', 'threadtable_info', 'posttable_info'),
複製代碼

替換成
  1. 'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum', 'plugin'),
  2.       'redirect'      => array('threadtableids', 'threadtable_info', 'posttable_info', 'plugin'),
複製代碼


  1. 'domainwhitelist'),
  2.       'space'                => array('fields_required', 'fields_optional', 'custominfo'),
  3.       'group'                => array('grouptype', 'diytemplatenamegroup'),
複製代碼

替換成
  1. 'domainwhitelist', 'plugin'),
  2.       'space'                => array('fields_required', 'fields_optional', 'custominfo', 'plugin'),
  3.       'group'                => array('grouptype', 'diytemplatenamegroup', 'plugin'),
複製代碼


group.php

  1. $cachelist = array('grouptype', 'groupindex', 'diytemplatenamegroup');
複製代碼

替換成
  1. $cachelist = array('grouptype', 'groupindex', 'diytemplatenamegroup', 'plugin');
複製代碼

home.php

  1. $cachelist = array('magic','userapp','usergroups', 'diytemplatenamehome');
複製代碼

替換成
  1. $cachelist = array('magic','userapp','usergroups', 'diytemplatenamehome', 'plugin');
複製代碼

misc.php

  1. 'ranklist' => array('forums', 'diytemplatename'),
複製代碼

替換成
  1. 'ranklist' => array('forums', 'diytemplatename', 'plugin'),
複製代碼

portal.php

  1. $cachelist = array('userapp', 'portalcategory', 'diytemplatenameportal');
複製代碼

替換成
  1. $cachelist = array('userapp', 'portalcategory', 'diytemplatenameportal', 'plugin');
複製代碼

./source/class 下的文件
class_core.php

  1. $_G['PHP_SELF'] = htmlspecialchars($this->_get_script_url());
複製代碼

替換成
  1. $_G['PHP_SELF'] = htmlspecialchars($_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF']);
複製代碼


  1. $this->var['config']['cookie']['cookiepre'] = $this->var['config']['cookie']['cookiepre'].substr(md5($this->var['config']['cookie']['cookiepath'].'|'.$this->var['config']['cookie']['cookiedomain']), 0, 4).'_';
複製代碼

下面加上
  1. $this->var['authkey'] = md5($_config['security']['authkey'].$_SERVER['HTTP_USER_AGENT']);
複製代碼


  1. } elseif((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api')) && !$this->var['inajax']) {
複製代碼

替換成
  1. } elseif((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api')) && !$this->var['inajax'] && !$_GET['act']) {
複製代碼

class_member.php

  1. function logging_ctl() {
複製代碼

下面加上
  1. loadcache(array('plugin'));
複製代碼


  1. loadcache(array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional', 'fields_register', 'ipctrl'));
複製代碼


替換成
  1. loadcache(array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional', 'fields_register', 'ipctrl', 'plugin'));
複製代碼

./source/function/ 下的文件
function_delete.php

  1. DB::query("DELETE FROM ".DB::table('common_mailcron').", ".DB::table('common_mailqueue')." USING ".DB::table('common_mailcron').", ".DB::table('common_mailqueue')." WHERE ".DB::table('common_mailcron').".touid IN ($uids) AND ".DB::table('common_mailcron').".cid=".DB::table('common_mailqueue').".cid", 'UNBUFFERED');
複製代碼


下面加上
  1. DB::query("DELETE FROM ".DB::table('facebook_connect')." WHERE uid IN ($uids)", 'UNBUFFERED');
複製代碼

function_space.php

  1. global $_G, $space;
複製代碼

替換成
  1. global $_G, $space, $sfb, $isfriend;
複製代碼



  1. $html .= "<li class='ul_pm'><a href="home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_$space&touid=$space&pmid=0&daterange=2" id="a_sendpm_$space" onclick="showWindow('showMsgBox', this.href, 'get', 0)">".lang('space', 'block_profile_sendmessage')."</a></li>";
複製代碼

下面加上
  1. if(($sfb && $_G['adminid'] > 0) || ($sfb && $sfb == 0) || ($sfb && $sfb == 1 && $isfriend)) {
  2.                                         $html .= "<li><a href="http://www.facebook.com/profile.php?id=$sfb" target="_blank" style="background-image:url(static/image/facebook_icon.png);">".lang('space', 'facebook_profile')."</a></li>";
  3.                                         $html .= "<li><a href="http://www.facebook.com/addfriend.php?id=$sfb" target="_blank" style="background-image:url(static/image/facebook_icon.png);">".lang('space', 'add_facebook_friend')."</a></li>";}
複製代碼
facebook_icon.png

facebook_icon2.png



                              
./source/language/ 下面文件
lang_message.php

  1. 'post_hide_nopermission' => '抱歉,您沒有權限使用 代碼',
複製代碼

下面加上
  1. 'post_like_nopermission' => '對不起,你沒有權限使用 代碼,請返回修改。',
  2. 'post_like_dontinreply' => '對不起,回帖不可使用 代碼,請返回修改。',
  3. 'facebook_not_yet_like' => '您還未點讚,請返回。',
  4. 'facebook_not_yet_comm' => '您還未於本帖的Facebook留言版上留言 (請使用FB帳戶進行留言),請返回。',
複製代碼

lang_space.php

  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&tid=$_G">回復</a>',
複製代碼

換成
  1. 'post_hide_reply_hidden' => ',如果您要查看本帖隱藏內容請<a href="forum.php?mod=post&action=reply&fid=$_G&tid=$_G">回覆</a>',
  2. 'post_hide_reply_like_hidden' => ',如果你要查看本帖隱藏內容請 <a href="forum.php?mod=post&action=reply&fid=$_G&tid=$_G">回覆</a> 或 <b>點讚</b>:',
  3. 'post_hide_like_hidden' => ',如果你要查看本帖隱藏內容請<b>點讚</b>:',
  4. 'first_login' => '請先登入會員:',
  5. 'facebook_profile' => '查看FB檔案',
  6. 'add_facebook_friend' => '加入FB好友',
  7. 'facebook_send' => '傳送',
  8. 'facebook_invite_friend_add' => '邀請朋友加入',
  9. 'facebook_invite_friend_addmsg' => '我在 [ {$_G} ] 加入會員了!誠摯邀請您一同加入!',
  10. 'facebook_already_like' => '[ 若您已點過讚,請點此重新檢查 ]',
  11. 'facebook_already_comm' => '[ 已在FB版留言?請點此重新檢查 ]',
  12. 'facebook_already_like_t' => '因為您目前並無登入本論壇,所以必須手動檢查您是否已點過讚。',
  13. 'facebook_already_comm_t' => '因為您目前並無登入本論壇,所以必須手動檢查您是否已在本帖的Facebook留言版上留言 (請使用FB帳戶進行留言)。',
複製代碼


  1. 'facebook_profile' => '看FB檔案',
  2. 'add_facebook_friend' => '加FB好友',
複製代碼

./source/module/forum/ 下的文件
forum_viewthread.php

  1. LEFT JOIN ".DB::table('facebook_connect')." fc USING(uid)
複製代碼



  1. require_once libfile('function/friend');
複製代碼


  1. $postlist[$pid] = viewthread_procpost($post, $_G['member']['lastvisit'], $ordertype);
複製代碼

下面加上
  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) {
  8.                 $iattrs = $_G.$iattrsA;
  9.       } elseif($iattrsB) {
  10.                 if(stristr($iattrsB, "http://")) {
  11.                         $iattrs = $iattrsB;
  12.                 } else {
  13.                         $iattrs = $_G.$iattrsB;
  14.                 }
  15.       } else {
  16.                 $iattrs = $_G['cache']['plugin']['facebook_connect']['dfimg'];
複製代碼

./source/module/home/ 下的文件
home_space.php

  1. <meta http-equiv="MSThemeCompatible" content="Yes" />
複製代碼

下面加上

  1. <!--{if $_G}-->
  2.       <meta property="og:type" content="discuz:thread"/>
  3.       <meta property="og:site_name" content="$_G['setting']['bbname']"/>
  4.       <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  5.       <meta property="og:url" content="$_Gthread-{$_G}-1-1.html"/>
  6.       <!--{else}-->
  7.       <meta property="og:url" content="$_Gforum.php?mod=viewthread&tid=$_G"/>
  8.       <!--{/if}-->
  9.       <meta property="og:title" content="$_G - $_G['setting']['bbname']"/>
  10.       <meta property="og:description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}"/>
  11.       <!--{if $iattrs}-->
  12.       <meta property="og:image" content="$iattrs"/>
  13.       <!--{/if}-->
  14.       <meta property="fb:app_id" content="$_G['cache']['plugin']['facebook_connect']['appid']"/>
  15.       <!--{/if}-->
複製代碼

./template/default/common/ 下的文件
footer.htm

  1. <!--{eval userappprompt();}-->
  2. <!--{if $_G['basescript'] != 'userapp'}-->
  3. <span id="scrolltop">{lang scrolltop}</span>
  4. <script type="text/javascript">_attachEvent(window, 'scroll', function(){showTopLink();});</script>
  5. <!--{/if}-->
複製代碼

下面加上
  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}channel.html'});
  5. <!--{if $_G}-->
  6.       <!--{if $_G['like'] == 'no'}-->
  7.       FB.Event.subscribe('edge.create', function() {
  8.                 location.replace('forum.php?mod=viewthread&tid={$_G}&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}&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}&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}-->
  33. function fbshare() {
  34.       FB.ui({
  35.                 method: 'feed',
  36.                 name: '$_G',
  37.                 <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  38.                 link: '$_Gthread-{$_G}-1-1.html',
  39.                 <!--{else}-->
  40.                 link: '$_Gforum.php?mod=viewthread&tid=$_G',
  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}&page={$_G}&todo=unlike');
  52.                 } else {
  53.                         location.replace('forum.php?mod=viewthread&tid={$_G}&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',
  63.                 <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  64.                 link: '$_Gthread-{$_G}-1-1.html',
  65.                 <!--{else}-->
  66.                 link: '$_Gforum.php?mod=viewthread&tid=$_G',
  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 = /(^*)/;
  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 != '') {
  102.                         output += match;
  103.                         x += match.length;
  104.                 } else {
  105.                         if (str == ' ') {
  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>
複製代碼


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" xmlns:discuz="http://www.discuz.net/ns#">
複製代碼


  1. <meta http-equiv="MSThemeCompatible" content="Yes" />
複製代碼

下面加上
  1. <!--{if $_G}-->
  2.       <meta property="og:type" content="discuz:thread"/>
  3.       <meta property="og:site_name" content="$_G['setting']['bbname']"/>
  4.       <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  5.       <meta property="og:url" content="$_Gthread-{$_G}-1-1.html"/>
  6.       <!--{else}-->
  7.       <meta property="og:url" content="$_Gforum.php?mod=viewthread&tid=$_G"/>
  8.       <!--{/if}-->
  9.       <meta property="og:title" content="$_G - $_G['setting']['bbname']"/>
  10.       <meta property="og:description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}"/>
  11.       <!--{if $iattrs}-->
  12.       <meta property="og:image" content="$iattrs"/>
  13.       <!--{/if}-->
  14.       <meta property="fb:app_id" content="$_G['cache']['plugin']['facebook_connect']['appid']"/>
  15.       <!--{/if}-->
複製代碼

./template/default/forum/ 下的文件
forumdisplay_fastpost.htm

  1. <div class="pt hm">{lang login_to_post} <a href="member.php?mod=logging&action=login" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G}" class="xi2">$_G['setting']['reglinkname']</a> <!--{hook/global_login_text}--></div>
複製代碼

換成

  1. <div class="pt hm">{lang login_to_post} <a href="member.php?mod=logging&action=login" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G}" class="xi2">$_G['setting']['reglinkname']</a> | <a href="javascript:;"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a> <!--{hook/global_login_text}--></div>
複製代碼

viewthread.htm

  1. <div id="post_$post">
  2.                               <!--{subtemplate forum/viewthread_node}-->
  3.                         </div>
複製代碼

下面加入
  1. <!--{if $post['first'] && $_G['fbc']}-->
  2.                               <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
  3.                                         <div id="fbcomm_$post" style="text-align:right;"><fb:comments href="{$_G}thread-{$_G}-1-1.html" num_posts="10" width="960"></fb:comments>
  4.                                         <div style="line-height:5px;background:{$_G};"> </div></div>
  5.                               <!--{else}-->
  6.                                         <div id="fbcomm_$post" style="text-align:right;"><fb:comments href="{$_G}forum.php?mod=viewthread&tid={$_G}" num_posts="10" width="960"></fb:comments>
  7.                                         <div style="line-height:5px;background:{$_G};"> </div></div>
  8.                               <!--{/if}-->
  9.                         <!--{/if}-->
複製代碼

viewthread_fastpost.htm

  1. <div class="pt hm">{lang login_to_reply} <a href="member.php?mod=logging&action=login" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G}" class="xi2">$_G['setting']['reglinkname']</a> <!--{hook/global_login_text}--></div>
複製代碼

換成

  1. <div class="pt hm">{lang login_to_reply} <a href="member.php?mod=logging&action=login" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G}" class="xi2">$_G['setting']['reglinkname']</a> | <a href="javascript:;"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a> <!--{hook/global_login_text}--></div>
複製代碼

viewthread_node.htm

  1. <li class="pm2"><a href="home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_$post&touid=$post&pmid=0&daterange=2&pid=$post&tid=$post" title="{lang viewthread_left_sendpm}" class="xi2">{lang viewthread_left_sendpm}</a></li>
複製代碼

下面加上
  1. <!--{if ($post && $_G['forum']['ismoderator']) || ($post && $post == 0) || ($post && $post == 1 && $isfriend[$post])}-->
  2.                                                 <li style="background-image:url(static/image/facebook_icon.png);"><a href="http://www.facebook.com/profile.php?id=$post" target="_blank">{lang facebook_profile}</a></li>
  3.                                                 <li style="background-image:url(static/image/facebook_icon.png);"><a href="http://www.facebook.com/addfriend.php?id=$post" target="_blank">{lang add_facebook_friend}</a></li>
  4.                                         <!--{/if}-->
複製代碼


  1. <tr><td class="plc plm">
複製代碼

下面加上

  1. <!--{if $post['first']}--><div style="line-height:40px;"><!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}--><fb:like href="$_Gthread-{$_G}-1-1.html" show_faces="false" send="true" width="450"></fb:like><!--{else}--><fb:like href="$_Gforum.php?mod=viewthread&tid=$_G" show_faces="false" send="true" width="450"></fb:like><!--{/if}--></div><!--{/if}-->
複製代碼


  1. <!--{if $post['first'] && $_G && $_G == $post}-->
  2.                               <a href="misc.php?mod=invite&action=thread&id=$_G"><i><img src="{IMGDIR}/activitysmall.gif" alt="{lang invite}" />{lang invite}</i></a>
  3.                         <!--{/if}-->
複製代碼

下面加上
  1. <a href="javascript:;"><i><img src="static/image/facebook_icon2.png" style="margin-right:5px;">{lang thread_share}</i></a>
  2.                         <a href="javascript:;"><i><img src="static/image/facebook_icon2.png" style="margin-right:5px;">{lang facebook_send}</i></a>
  3.                         <a href="javascript:;"><i><img src="static/image/facebook_icon2.png" style="margin-right:5px;">{lang invite}</i></a>
複製代碼

viewthread_node_body.htm

  1. <div class="{if !$_G}t_fsz{else}pcbs{/if}">
  2.                 <!--{if $post['first']}-->
複製代碼

下面加上
  1. <div style="line-height:40px;"><!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}--><fb:like href="$_Gthread-{$_G}-1-1.html" show_faces="false" send="true" width="450"></fb:like><!--{else}--><fb:like href="$_Gforum.php?mod=viewthread&tid=$_G" show_faces="false" send="true" width="450"></fb:like><!--{/if}--></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&touid=$space&pmid=0&daterange=2" id="a_sendpm_$space">{lang send_pm}</a></li>
複製代碼

下面加入

  1. <!--{if ($sfb && $_G['adminid'] > 0) || ($sfb && $sfb == 0) || ($sfb && $sfb == 1 && $isfriend)}-->
  2.                                         <li><a href="http://www.facebook.com/profile.php?id=$sfb" target="_blank" style="background-image:url(static/image/facebook_icon.png);">{lang facebook_profile}</a></li>
  3.                                         <li><a href="http://www.facebook.com/addfriend.php?id=$sfb" target="_blank" style="background-image:url(static/image/facebook_icon.png);">{lang add_facebook_friend}</a></li>
  4.                               <!--{/if}-->
複製代碼

./template/default/member/ 下的檔案
login.htm

  1. <td>
  2.                                                                 <button class="pn pnc" type="submit" name="loginsubmit" value="true" tabindex="1"><strong>{lang login}</strong></button>
  3.                                                       </td>
複製代碼

下面加上
  1. <td><b>Facebook</b> <a href="javascript:;"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a></td>
複製代碼

login_simple.htm

  1. <td class="fastlg_l"><label for="ls_cookietime"><input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" />{lang login_permanent}</label></td>
複製代碼

下面加上
  1. <td class="fastlg_l" rowspan="2"><a href="javascript:;"><img src="static/image/facebook_iconb.png"></a></td>
複製代碼

register.htm

  1. <td><!--{if $this->setting['sitemessage']}--><a href="javascript:;" id="custominfo_register" class="y"><img src="{IMGDIR}/info_small.gif" alt="{lang faq}" /></a><!--{/if}--></td>
複製代碼

下面加入
  1. <td><b>Facebook</b> <a href="javascript:;"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a></td>
複製代碼

1. 修改風格檔 footer.htm:

找到FB.init({appId:'$_G['cache']['plugin']['facebook_connect']['appid']', status:true, cookie:true, xfbml:true, channelUrl:'{$_G}channel.html'});替換為FB.init({appId:'$_G',channelURL:'{$_G}channel.html',status:true,cookie:true,oauth:true,xfbml:true});找到function fblogin() {
        FB.login(function(response) {
                if (response.session) {
                        if (response.perms) {
                                location.replace('fblogin.php?act=logging&rf='+urlencode(location.href));
                        } else {
                                location.replace('index.php');
                        }
                } else {
                        location.replace('index.php');
                }
        }, {perms:'email,user_likes,publish_stream'});
}
替換為function fblogin() {
        FB.login(function(response) {
                if (response.authResponse) {
                        location.replace('fblogin.php?act=logging&rf='+urlencode(location.href));
                } else {
                        location.replace('index.php');
                }
        }, {scope:'email,user_likes,publish_stream'});
}最後儲存上傳覆蓋,後台更新緩存即可,此修改可以暫時解決FB無法正常登入問題,其餘請等待下次完整更新插件發佈。

評分

參與人數 1資歷 +10 收起 理由
hivenus + 10 太棒了

檢視全部評分

你需要登入後才可以回覆 登入 | 我要註冊

本版積分規則

Archiver|禁閉室|手機版|數碼中文坊

GMT+8, 2024-4-24 09:45 PM

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回覆 返回頂端 返回清單