設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 653|回復: 0
打印 上一主題 下一主題

[X2.0] Facebook Connect 教學

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2020-3-7 19:49:35 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
⊙ 插件名稱:Discuz X2 Facebook Connect
⊙ 主要功能:同時登入FB與DZ、自動以FB帳號註冊DZ新會員(新會員可自訂帳號與密碼)、自動以FB帳戶整合DZ舊會員(DZ使用的E-mail與FB註冊的E-mail相同就會自動綁定)
⊙ 插件版本:2.3
⊙ 插件語言:繁體中文、簡體中文
⊙ 適用版本:Discuz X2 (20110629) - BIG5、GBK、UTF8繁中、UTF8簡中
⊙ 插件開發:derek
⊙ 執行環境:建議使用 PHP 5.X (主機須開啟CURL以及allow_url_fopen支援)
⊙ 鄙視收費插件:抵制收費插件、本插件完全免費,各位就別再花錢了,用買的插件不一定好!
⊙ 安裝前請注意:覆蓋檔案前,應先備份原來的檔案,安裝完畢請至後台更新緩存。( 需被覆蓋的檔案若有自行修改過,請勿直接使用本站提供的檔案覆蓋,應自行比對修改。)


⊙ 最後更新時間:2011/7/27 13:20
⊙ 本次更新說明:修正BIG5版本無法使用問題,若非使BIG5版本者,可不需更新
⊙ 本次升級注意:請參閱壓縮檔內的安裝說明,上傳全部檔案覆蓋後,務必先卸載插件再重新安裝,設定完插件後再更新緩存。
關於在 Facebook 建立應用程式之相關教學於本帖底部。

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[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] && $_G['adminid'] > 0) || ($sfb[fbid] && $sfb[showfblink] == 0) || ($sfb[fbid] && $sfb[showfblink] == 1 && $isfriend)) {
  2.                                         $html .= "<li><a href=\"http://www.facebook.com/profile.php?id=$sfb[fbid]\" 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[fbid]\" target=\"_blank\" style=\"background-image:url(static/image/facebook_icon.png);\">".lang('space', 'add_facebook_friend')."</a></li>";
  4.                                 }
複製代碼
./source/language/ 下面文件

lang_message.php


  1. 'post_hide_nopermission' => '抱歉,您沒有權限使用 [hide] 代碼',
複製代碼
下面加上
  1.   'post_like_nopermission' => '對不起,你沒有權限使用 [like] 代碼,請返回修改。',
  2.   'post_like_dontinreply' => '對不起,回帖不可使用 [like] 代碼,請返回修改。',
  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[fid]&tid=$_G[tid]" onclick="showWindow(\'reply\', this.href)">回復</a>',
複製代碼
換成
  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>',
  2.   '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> 或 <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[setting][bbname]} ] 加入會員了!誠摯邀請您一同加入!',
  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[1][0]) {
  8.                 $iattrs = $_G[siteurl].$iattrsA[1][0];
  9.         } elseif($iattrsB[1][0]) {
  10.                 if(stristr($iattrsB[1][0], "http://")) {
  11.                         $iattrs = $iattrsB[1][0];
  12.                 } else {
  13.                         $iattrs = $_G[siteurl].$iattrsB[1][0];
  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[tid]}-->
  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="$_G[siteurl]thread-{$_G[tid]}-1-1.html"/>
  6.         <!--{else}-->
  7.         <meta property="og:url" content="$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]"/>
  8.         <!--{/if}-->
  9.         <meta property="og:title" content="$_G[forum_thread][subject] - $_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" onclick="window.scrollTo('0','0')">{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[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>
複製代碼

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[tid]}-->
  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="$_G[siteurl]thread-{$_G[tid]}-1-1.html"/>
  6.         <!--{else}-->
  7.         <meta property="og:url" content="$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]"/>
  8.         <!--{/if}-->
  9.         <meta property="og:title" content="$_G[forum_thread][subject] - $_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" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" 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" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" class="xi2">$_G['setting']['reglinkname']</a> | <a href="javascript:;" onclick="fblogin();"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a> <!--{hook/global_login_text}--></div>
複製代碼
viewthread.htm


  1. <div id="post_$post[pid]">
  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[pid]" style="text-align:right;"><fb:comments href="{$_G[siteurl]}thread-{$_G[tid]}-1-1.html" num_posts="10" width="960"></fb:comments>
  4.                                         <div style="line-height:5px;background:{$_G[style][specialborder]};"> </div></div>
  5.                                 <!--{else}-->
  6.                                         <div id="fbcomm_$post[pid]" style="text-align:right;"><fb:comments href="{$_G[siteurl]}forum.php?mod=viewthread&tid={$_G[tid]}" num_posts="10" width="960"></fb:comments>
  7.                                         <div style="line-height:5px;background:{$_G[style][specialborder]};"> </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" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" 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" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" class="xi2">$_G['setting']['reglinkname']</a> | <a href="javascript:;" onclick="fblogin();"><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[authorid]&touid=$post[authorid]&pmid=0&daterange=2&pid=$post[pid]&tid=$post[tid]" onclick="showWindow('sendpm', this.href);" title="{lang viewthread_left_sendpm}" class="xi2">{lang viewthread_left_sendpm}</a></li>
複製代碼
下面加上
  1. <!--{if ($post[fbid] && $_G['forum']['ismoderator']) || ($post[fbid] && $post[showfblink] == 0) || ($post[fbid] && $post[showfblink] == 1 && $isfriend[$post[authorid]])}-->
  2.                                                 <li style="background-image:url(static/image/facebook_icon.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(static/image/facebook_icon.png);"><a href="http://www.facebook.com/addfriend.php?id=$post[fbid]" 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="$_G[siteurl]thread-{$_G[tid]}-1-1.html" show_faces="false" send="true" width="450"></fb:like><!--{else}--><fb:like href="$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]" show_faces="false" send="true" width="450"></fb:like><!--{/if}--></div><!--{/if}-->
複製代碼

  1. <!--{if $post['first'] && $_G[uid] && $_G[uid] == $post[authorid]}-->
  2.                                 <a href="misc.php?mod=invite&action=thread&id=$_G[tid]" onclick="showWindow('invite', this.href, 'get', 0);"><i><img src="{IMGDIR}/activitysmall.gif" alt="{lang invite}" />{lang invite}</i></a>
  3.                         <!--{/if}-->
複製代碼
下面加上
  1. <a href="javascript:;" onclick="fbshare();"><i><img src="static/image/facebook_icon2.png" style="margin-right:5px;">{lang thread_share}</i></a>
  2.                         <a href="javascript:;" onclick="fbsend();"><i><img src="static/image/facebook_icon2.png" style="margin-right:5px;">{lang facebook_send}</i></a>
  3.                         <a href="javascript:;" onclick="fbinvite();"><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[forum_thread][special]}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="$_G[siteurl]thread-{$_G[tid]}-1-1.html" show_faces="false" send="true" width="450"></fb:like><!--{else}--><fb:like href="$_G[siteurl]forum.php?mod=viewthread&tid=$_G[tid]" 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[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] && $_G['adminid'] > 0) || ($sfb[fbid] && $sfb[showfblink] == 0) || ($sfb[fbid] && $sfb[showfblink] == 1 && $isfriend)}-->
  2.                                         <li><a href="http://www.facebook.com/profile.php?id=$sfb[fbid]" 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[fbid]" 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:;" onclick="fblogin();"><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:;" onclick="fblogin();"><img src="static/image/facebook_iconb.png"></a></td>
複製代碼
register.htm


  1. <td><!--{if $this->setting['sitemessage'][register]}--><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:;" onclick="fblogin();"><img src="static/image/facebook_icon3.png" style="margin-bottom:-5px;"></a></td>
複製代碼
最後把附件上傳,大功告成!







































































分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-2 02:14 , Processed in 0.319556 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表