woff 發表於 2011-7-1 21:26:14

X1.5 FB插件 修改詳解

forum.php
找到 $modcachelist = array(
'index' => array('announcements', 'onlinelist', 'forumlinks', 'advs_index',
'heats', 'historyposts', 'onlinerecord', 'userstats'),
'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
'icons', 'onlinelist', 'forumstick','threadtable_info', 'threadtableids', 'stamps'),
'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups', 'ranks',
'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
'threadtableids', 'threadtable_info'),
'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
'icons', 'domainwhitelist'),
'space' => array('fields_required', 'fields_optional', 'custominfo'),
'group' => array('grouptype'),
);換成 $modcachelist = array(
'index' => array('announcements', 'onlinelist', 'forumlinks', 'advs_index',
'heats', 'historyposts', 'onlinerecord', 'userstats', 'plugin'),
'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
'icons', 'onlinelist', 'forumstick','threadtable_info', 'threadtableids', 'stamps', 'plugin'),
'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups', 'ranks',
'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
'threadtableids', 'threadtable_info', 'plugin'),
'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
'icons', 'domainwhitelist', 'plugin'),
'space' => array('fields_required', 'fields_optional', 'custominfo', 'plugin'),
'group' => array('grouptype', 'plugin'),
);group.php
找到 $cachelist = array('grouptype', 'groupindex');換成 $cachelist = array('grouptype', 'groupindex', 'plugin');home.php
找到 $cachelist = array('magic','userapp','usergroups');換成 $cachelist = array('magic','userapp','usergroups', 'plugin');misc.php
找到 $modcachelist = array(
      'ranklist' => array('forums'),
);換成 $modcachelist = array(
      'ranklist' => array('forums', 'plugin'),
);portal.php
找到 $cachelist = array('userapp', 'portalcategory');換成
$cachelist = array('userapp', 'portalcategory', 'plugin');template/default/common/header_common.htm
找到 <html xmlns="http://www.w3.org/1999/xhtml">換成 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">找到 <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />下面加上 <meta http-equiv="X-UA-Compatible" content="IE=8" />找到 <meta http-equiv="MSThemeCompatible" content="Yes" />下面加上 <!--{if $_G}-->
      <meta property="og:type" content="article"/>
      <meta property="og:site_name" content="$_G['setting']['bbname']"/>
      <meta property="og:title" content="$_G - $_G['setting']['bbname']"/>
      <meta property="og:description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}"/>
      <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
      <meta property="og:url" content="$_Gthread-{$_G}-{$_G}-{if $extra}{echo $extra}{else}{echo 1}{/if}.html"/>
      <!--{else}-->
      <meta property="og:url" content="$_Gforum.php?mod=viewthread&tid=$_G"/>
      <!--{/if}-->
      <!--{if $iattrs}-->
      <meta property="og:image" content="$iattrs"/>
      <!--{else}-->
      <meta property="og:image" content="$_G{BOARDIMG}"/>
      <!--{/if}-->
      <meta property="fb:app_id" content="$_G['cache']['plugin']['facebook_connect']['appid']"/>
      <!--{/if}-->template/default/common/footer.htm
找到 <!--{eval output();}-->上面加上 <div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
      FB.init({appId:'$_G['cache']['plugin']['facebook_connect']['appid']', status:true, cookie:true, xfbml:true, channelUrl:'{$_G}channel.html'});
<!--{if $_G}-->
      <!--{if $_G['like'] == 'no'}-->
      FB.Event.subscribe('edge.create', function() {
                location.replace('forum.php?mod=viewthread&tid={$_G}&page={$_G}&todo=like');
      });
      <!--{if $_G['fbc'] && $_G['cache']['plugin']['facebook_ltv']['fctv']}-->
      FB.Event.subscribe('comment.create', function() {
                location.replace('forum.php?mod=viewthread&tid={$_G}&page={$_G}&todo=fcomm');
      });
      <!--{/if}-->
      <!--{/if}-->
      FB.Event.subscribe('edge.remove', function() {
                fbshare();
      });
      <!--{if $_G['like'] && $_G['fbc'] && $_G['cache']['plugin']['facebook_ltv']['fctv']}-->
      FB.Event.subscribe('comment.remove', function() {
                location.replace('forum.php?mod=viewthread&tid={$_G}&page={$_G}&todo=unfcomm');
      });
      <!--{/if}-->
<!--{/if}-->
};
(function() {
      var e = document.createElement('script');
      e.src = document.location.protocol + '//connect.facebook.net/zh_TW/all.js';
      e.async = true;
      document.getElementById('fb-root').appendChild(e);
}());
<!--{if $_G}-->
function fbshare() {
      FB.ui({
                method: 'feed',
                name: '$_G',
                <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
                link: '$_Gthread-{$_G}-1-1.html',
                <!--{else}-->
                link: '$_Gforum.php?mod=viewthread&tid=$_G',
                <!--{/if}-->
                <!--{if $iattrs}-->
                picture: '$iattrs',
                <!--{/if}-->
                caption: '$_G['setting']['bbname']',
                description: '{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}',
                message: ''
      }, function(response) {
                <!--{if $_G['like']}-->
                if (response && response.post_id) {
                        location.replace('forum.php?mod=viewthread&tid={$_G}&page={$_G}&todo=unlike');
                } else {
                        location.replace('forum.php?mod=viewthread&tid={$_G}&page={$_G}&todo=unlike');
                }
                <!--{/if}-->
      });
}
function fbsend() {
      FB.ui({
                method: 'send',
                app_id: '$_G['cache']['plugin']['facebook_connect']['appid']',
                name: '$_G',
                <!--{if in_array('forum_viewthread', $_G['setting']['rewritestatus'])}-->
                link: '$_Gthread-{$_G}-1-1.html',
                <!--{else}-->
                link: '$_Gforum.php?mod=viewthread&tid=$_G',
                <!--{/if}-->
                <!--{if $iattrs}-->
                picture: '$iattrs',
                <!--{/if}-->
                description: '{if !empty($metadescription)}{echo htmlspecialchars($metadescription)}{/if}'
      });
}
function fbinvite() {
      FB.ui({
                method: 'apprequests',
                message: '{lang facebook_invite_friend_addmsg}',
                filters: "['app_non_users']",
                title: '{lang facebook_invite_friend_add} {$_G['setting']['bbname']}'
      });
}
<!--{/if}-->
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 urlencode(str) {
      var output = '', x = 0, regex = /(^*)/;
      str = str.toString();
      while (x < str.length) {
                var match = regex.exec(str.substr(x));
                if (match != null && match.length > 1 && match != '') {
                        output += match;
                        x += match.length;
                } else {
                        if (str == ' ') {
                              output += '+';
                        } else {
                              var charCode = str.charCodeAt(x), hexVal = charCode.toString(16);
                              output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
                        }
                        x++;
                }
      }
      return output;
}
</script>template/default/common/editor.css
找到 #e_hide                        { background-position: -120px -40px; }下面加上 #e_like                        { background-position: -120px -60px; }template/default/common/module.css
找到 .showhide h4 { margin-bottom: 10px; color: #F66; font-size: 12px; text-align: center; }下面加上 .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; }
                .like_locked:hover { background:url(http://profile.ak.fbcdn.net/hprofile-ak-snc4/187910_131274550278977_3136957_s.jpg) no-repeat 6px 50%; }
                .like_locked strong { color: {NOTICETEXT}; }
                .like_locked a { color: {HIGHLIGHTLINK}; }template/default/forum/discuzcode.htm
找到 function attachlist($attach)上面加上 function tpl_like_show() {
global $_G;
}
<!--{block return}--><div class="showhide"><h4>{lang post_hide}</h4>\\1</div>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}

function tpl_like_hidden() {
global $_G;
}
<!--{block return}--><div class="like_locked"><div style="line-height:50px;"><!--{if $_G}-->{$_G}<!--{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}-->
<!--{eval return $return;}-->
{eval
}

function tpl_hide_reply_like_hidden() {
global $_G;
}
<!--{block return}--><div class="like_locked"><div style="line-height:50px;"><!--{if $_G}-->{$_G}<!--{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}-->
<!--{eval return $return;}-->
{eval
}

function tpl_first_login() {
global $_G;
}
<!--{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}" 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}-->
<!--{eval return $return;}-->
{eval
}template/default/forum/forumdisplay_fastpost.htm
找到 <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}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a></div>換成 <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}" 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
找到 <!--{if $isfirstpost && $_G['group']['allowhidecode']}--><a id="{$editorid}_hide" title="{lang e_hide}">Hide</a><!--{/if}-->下面加上 <!--{if $canuselike}--><a id="{$editorid}_like" title="{lang e_like}">Like</a><!--{/if}-->template/default/forum/viewthread_fastpost.htm
找到 <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}" onclick="showWindow('register', this.href)" class="xi2">$_G['setting']['reglinkname']</a></div>換成 <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}" 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
找到 <!--{if $post != $_G}-->
                                                <li class="buddy"><a href="home.php?mod=spacecp&ac=friend&op=add&uid=$post&handlekey=addfriendhk_{$post}" id="a_friend_li_{$post}" onclick="showWindow(this.id, this.href, 'get', 1, {'ctrlid':this.id,'pos':'00'});">{lang add_to_buddylist}</a></li>
                                        <!--{/if}-->下面加上 <!--{if $post}-->
                                                <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" target="_blank">{lang facebook_profile}</a></li>
                                                <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" target="_blank">{lang add_facebook_friend}</a></li>
                                        <!--{/if}-->template/default/forum/viewthread_node_body.htm
找到 <div class="{if !$_G}t_fsz{else}pcbs{/if}">
                <!--{if $post['first']}-->下面加上 <div style="line-height:40px;"><fb:like show_faces="false" send="true" width="450"></fb:like></div>template/default/home/space_userabout.htm
找到 <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 send_pm}</a></li>下面加上 <!--{if $sfb}-->
                              <li><a href="http://www.facebook.com/profile.php?id=$sfb" target="_blank" style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);">{lang facebook_profile}</a></li>
                              <li><a href="http://www.facebook.com/addfriend.php?id=$sfb" target="_blank" style="background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);">{lang add_facebook_friend}</a></li>
                        <!--{/if}-->template/default/home/spacecp_avatar.htm
找到 <hr class="l m0" />下面加上 <!--{if $sfb}-->
                              <form method="post" autocomplete="off" name="setfbpic" id="setfbpic" action="fblogin.php?act=setfbpic" style="width:200px;float:right;margin-top:10px;">
                              <input name="auid" type="hidden" id="auid" value="$_G">
                              <input name="afbid" type="hidden" id="afbid" value="$sfb">
                              <input name="agen" type="hidden" id="agen" value="$sgen">
                              <button class="pn pnc" id="setfbpicsubmit" type="submit" name="setfbpicsubmit" value="true" tabindex="1"><span>{lang setting_facebook_avatar}</span></button>
                              </form>
                        <!--{/if}-->template/default/member/login.htm
找到 <h4>{lang login_guest}</h4>都換成 <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>最下面 </script>上面加上 FB.XFBML.parse();template/default/member/login_simple.htm
找到 <div class="fastlg_fm y pns">上面加上 <div class="fastlg_fm y" style="margin-right: 10px; padding-right: 10px">
                        <p><b>Facebook</b></p>
                        <p><fb:login-button size="medium" length="short" show-faces="false" perms="email,user_likes,publish_stream" onlogin="fblogin();"></fb:login-button></p>
                </div>template/default/member/register.htm
找到 <h4>{lang login_now}</h4>換成 <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>最下面
</script>
上面加上
FB.XFBML.parse();
static/js/editor.js
找到 insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide']) ? true : false);換成 insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide', 'like']) ? true : false);找到 if(in_array(cmd, ['sml', 'url', 'quote', 'code', 'free', 'hide', 'aud', 'vid', 'fls', 'attach', 'image']) || cmd == 'tbl' || in_array(cmd, ['fontname', 'fontsize', 'forecolor']) && !arg) {換成 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) {找到 case 'hide':下面加上 case 'like':找到 var lang = {'quote' : '請輸入要插入的引用', 'code' : '請輸入要插入的代碼', 'hide' : '請輸入要隱藏的信息內容', 'free' : '如果您設置了帖子售價,請輸入購買前免費可見的信息內容'};換成 var lang = {'quote' : '請輸入要插入的引用', 'code' : '請輸入要插入的代碼', 'hide' : '請輸入要隱藏的信息內容', 'like' : '請輸入要點讚才能看的內容', 'free' : '如果您設置了帖子售價,請輸入購買前免費可見的信息內容'};source/archiver/forum/viewthread.php
找到 return nl2br(preg_replace(array('/&amp;(#\d{3,5};)/', "/\(.+?)\[\/hide\]/is"),
                array('&\\1', '<b>**** Hidden Message *****</b>'),換成 return nl2br(preg_replace(array('/&amp;(#\d{3,5};)/', "/\(.+?)\[\/hide\]/is", "/\(.*?)\[\/like]/si"),
                array('&\\1', '<b>**** Hidden Message *****</b>', '<b>**** Hidden Message *****</b>'),source/function/function_delete.php
找到 DB::query("DELETE FROM ".DB::table('common_member')." WHERE uid IN ($uids)", 'UNBUFFERED');下面加上 DB::query("DELETE FROM ".DB::table('facebook_connect')." WHERE uid IN ($uids)", 'UNBUFFERED');source/function/function_discuzcode.php
找到 if($parsetype != 1 && strpos($msglower, '') !== FALSE && $pid) {
                        if(strpos($msglower, '**** Hidden Message *****') !== FALSE && $pid) {
                              if(strpos($msglower, '') !== FALSE) {
                                        if($authorreplyexist === null) {
                                                $posttable = getposttablebytid($_G['tid']);
                                                $authorreplyexist = !$_G['forum']['ismoderator'] ? DB::result_first("SELECT pid FROM ".DB::table($posttable)." WHERE tid='$_G' AND ".($_G['uid'] ? "authorid='$_G'" : "authorid=0 AND useip='$_G'")." LIMIT 1") : TRUE;
                                        }
                                        if($authorreplyexist) {
                                                $message = preg_replace("/\\s*(.+?)\s*\[\/hide\]/is", tpl_hide_reply(), $message);
                                        } else {
                                                $message = preg_replace("/\(.+?)\[\/hide\]/is", tpl_hide_reply_hidden(), $message);
                                                $message .= '<script type="text/javascript">replyreload += \',\' + '.$pid.';</script>';
                                        }
                              }
                              if(strpos($msglower, '[hide=') !== FALSE) {
                                        $message = preg_replace("/\\s*(.+?)\s*\[\/hide\]/ies", "creditshide(\\1,'\\2', $pid)", $message);
                              }
                        }
                        include('function_discuzcode_i.php');
                } source/function/function_post.php
找到 "/\(.+?)\[\/hide\]/is",下面加上 "/\(.*?)\[\/like]/si",找到 "$language",下面加上 "$language",source/function/function_space.php
找到 global $_G, $space;換成 global $_G, $space, $sfb;找到 $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>";下面加上 if($sfb) {
                                        $html .= "<li><a href=\"http://www.facebook.com/profile.php?id=$sfb\" target=\"_blank\" style=\"background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);\">".lang('space', 'facebook_profile')."</a></li>";
                                        $html .= "<li><a href=\"http://www.facebook.com/addfriend.php?id=$sfb\" target=\"_blank\" style=\"background-image:url(https://shopstrut.com/wp-content/themes/postcard/images/facebook.png);\">".lang('space', 'add_facebook_friend')."</a></li>";
                              }source/include/post/post_editpost.php
找到 $poll = $temppoll = '';下面加上 $canuselike = 1;
      $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
      if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
                if($isfirstpost) {
                        if(!in_array($_G['groupid'], $gidarr)) {
                              $canuselike = 0;
                        }
                } else {
                        if(!in_array($_G['groupid'], $gidarr) || !$_G['cache']['plugin']['facebook_ltv']['cuirp']) {
                              $canuselike = 0;
                        }
                }
      } else {
                $canuselike = 0;
      }source/include/post/post_newreply.php
找到 if(!submitcheck('replysubmit', 0, $seccodecheck, $secqaacheck)) {下面加上 $canuselike = 1;
      $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
      if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
                if(!in_array($_G['groupid'], $gidarr) || !$_G['cache']['plugin']['facebook_ltv']['cuirp']) {
                        $canuselike = 0;
                }
      } else {
                $canuselike = 0;
      }找到 $post['message'] = preg_replace("/\(.+?)\[\/hide\]/is", "$language", $post['message']);下面加上 $post['message'] = preg_replace("/\(.*?)\[\/like]/si", "$language", $post['message']);source/include/post/post_newthread.php
找到 $showthreadsorts = !empty($sortid) || $_G['forum']['threadsorts']['required'] && empty($special);下面加上 $canuselike = 1;
      $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
      if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
                if(!in_array($_G['groupid'], $gidarr)) {
                        $canuselike = 0;
                }
      } else {
                $canuselike = 0;
      }source/include/ thread/thread_printable.php
找到 $post['message'] = preg_replace("/\\s*(.+?)\s*\[\/hide\]/is", '', $post['message']);下面加上 $post['message'] = preg_replace("/\\s*(.+?)\s*\[\/like\]/is", '', $post['message']);source/language/lang_message.php
找到 'post_hide_nopermission' => '對不起,你沒有權限使用 代碼,請返回修改。',下面加上 'post_like_nopermission' => '對不起,你沒有權限使用 代碼,請返回修改。',
      'post_like_dontinreply' => '對不起,回帖不可使用 代碼,請返回修改。',source/language/lang_space.php
找到 'feed_view_only' => '只看此類動態',下面加上 'facebook_profile' => '看FB檔案',
      'add_facebook_friend' => '加FB好友',source/language/forum/lang_template.php
找到 'post_hide_reply_hidden' => ',如果你要查看本帖隱藏內容請<a href="forum.php?mod=post&action=reply&fid=$_G&tid=$_G" onclick="showWindow(\'reply\', this.href)">回復</a>',下面加上 'post_hide_reply_like_hidden' => ',如果你要查看本帖隱藏內容請 <a href="forum.php?mod=post&action=reply&fid=$_G&tid=$_G" onclick="showWindow(\'reply\', this.href)">回覆</a> 或 點讚:',
'post_hide_like_hidden' => ',如果你要查看本帖隱藏內容請點讚:',
'first_login' => '請先登入會員:',
'please_share_to_facebook' => '請點擊發佈分享到Facebook,謝謝!',
'thanks_for_fbshare' => '本帖已發佈到Facebook,感謝分享!',
'fbshare_ok' => '分享成功',
'facebook_profile' => '查看FB檔案',
'add_facebook_friend' => '加入FB好友',找到 'e_hide' => '添加隱藏內容',下面加上 'e_like' => '添加需點Facebook讚才可看的隱藏內容',source/language/home/lang_template.php
找到 'view_blog' => '查看日誌',下面加上 'facebook_profile' => '看FB檔案',
'add_facebook_friend' => '加FB好友',找到 'setting_my_new_avatar' => '設置我的新頭像',下面加上 'setting_facebook_avatar' => '自動設定成FB頭像',source/module/forum/forum_post.php
找到 if(empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\.+?\[\/hide\]/is", preg_replace("/(\(.+?)\[\/code\])/is", ' ', $message))) {
      showmessage('post_hide_nopermission');
}下面加上 if($_G['cache']['plugin']['facebook_ltv']['IDPDlike']) {
      $gidarr = explode(",", $_G['cache']['plugin']['facebook_ltv']['gidarr']);
      if(empty($bbcodeoff) && !empty($message) && preg_match("/\(.*?)\[\/like]/si", preg_replace("/(\(.+?)\[\/code\])/is", ' ', $message)) && !in_array($_G['groupid'], $gidarr)) {
                showmessage('post_like_nopermission');
      }
      if(empty($bbcodeoff) && !empty($message) && preg_match("/\(.*?)\[\/like]/si", preg_replace("/(\(.+?)\[\/code\])/is", ' ', $message)) && !$_G['cache']['plugin']['facebook_ltv']['cuirp'] && ((!$orig['first'] && $_G['gp_action'] == 'edit') || $_G['gp_action'] == 'reply')) {
                showmessage('post_like_dontinreply');
      }
} else {
      if(empty($bbcodeoff) && !empty($message) && preg_match("/\(.*?)\[\/like]/si", preg_replace("/(\(.+?)\[\/code\])/is", ' ', $message))) {
                showmessage('post_like_nopermission');
      }
}129行下加 if($_G['gp_action'] == 'edit') {
      $orig = DB::fetch_first("SELECT first FROM ".DB::table(forum_post)." WHERE pid='$pid'");      
}source/module/forum/forum_viewthread.php
找到 $query = DB::query("SELECT m.uid, m.username, m.groupid, m.adminid, m.regdate, m.credits, m.email, m.status AS memberstatus,
                        ms.lastactivity, ms.lastactivity, ms.invisible AS authorinvisible,
                        mc.*, mp.gender, mp.site, mp.icq, mp.qq, mp.yahoo, mp.msn, mp.taobao, mp.alipay,
                        mf.medals, mf.sightml AS signature, mf.customstatus $fieldsadd
                        FROM ".DB::table('common_member')." m
                        LEFT JOIN ".DB::table('common_member_field_forum')." mf USING(uid)
                        LEFT JOIN ".DB::table('common_member_status')." ms USING(uid)
                        LEFT JOIN ".DB::table('common_member_count')." mc USING(uid)
                        LEFT JOIN ".DB::table('common_member_profile')." mp USING(uid)
                        $verifyadd
                        WHERE m.uid IN (".dimplode(array_keys($postusers)).")");換成 $query = DB::query("SELECT m.uid, m.username, m.groupid, m.adminid, m.regdate, m.credits, m.email, m.status AS memberstatus,
                        ms.lastactivity, ms.lastactivity, ms.invisible AS authorinvisible,
                        mc.*, mp.gender, mp.site, mp.icq, mp.qq, mp.yahoo, mp.msn, mp.taobao, mp.alipay,
                        mf.medals, mf.sightml AS signature, mf.customstatus, fc.fbid $fieldsadd
                        FROM ".DB::table('common_member')." m
                        LEFT JOIN ".DB::table('common_member_field_forum')." mf USING(uid)
                        LEFT JOIN ".DB::table('common_member_status')." ms USING(uid)
                        LEFT JOIN ".DB::table('common_member_count')." mc USING(uid)
                        LEFT JOIN ".DB::table('common_member_profile')." mp USING(uid)
                        LEFT JOIN ".DB::table('facebook_connect')." fc USING(uid)
                        $verifyadd
                        WHERE m.uid IN (".dimplode(array_keys($postusers)).")");找到 $postlist[$pid]['message'] = preg_replace("/\\d+\[\/attach\]/i", '', $postlist[$pid]['message']);下面加上 if($postlist[$pid]['first'] == 1) {
                        $getmsgi = $postlist[$pid]['message'];
                }
      }
      preg_match_all('/<img.+file=[\'"]([^\'"]+)[\'"].*>/i', $getmsgi, $iattrsA);
      preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $getmsgi, $iattrsB);
      if($iattrsA) {
                $iattrs = $_G.$iattrsA;
      } elseif($iattrsB) {
                $iattrs = $iattrsB;
      } else {
                $iattrs = false;source/module/home/home_space.php
找到 if($uid) {下面加上 $sfb = DB::fetch_first("SELECT fbid FROM ".DB::table('facebook_connect')." WHERE uid='$uid' LIMIT 1");source/module/home/home_spacecp.php
找到 $space = getspace($_G['uid']);上面加上 $sfb = DB::fetch_first("SELECT fbid FROM ".DB::table('facebook_connect')." WHERE uid='$_G' LIMIT 1");
$sgen = DB::fetch_first("SELECT gender FROM ".DB::table('common_member_profile')." WHERE uid='$_G' LIMIT 1");
※ 本次FB官方更新(12/19),提供臨時初步手動方式修改,若有急用的朋友,可按照下方步驟修改,有時間會發佈完整更新插件。
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'});
}

siu-yee 發表於 2011-7-2 23:37:49

請問x2可以同用嗎

woff 發表於 2011-7-2 23:40:53

沒試過 不過應該差不了多少 要試試看才知道

0917344886 發表於 2012-2-10 05:50:43

謝謝!謝謝!謝謝!

HuangRu 發表於 2013-7-12 13:47:16

TEST TEST TEST TEST TEST TEST TEST
頁: [1]
查看完整版本: X1.5 FB插件 修改詳解