2012-09-19 20 views
0

我在使用Facebook的Like按鈕在我的vBulletin板上有一個真的,真的很奇怪的問題。在我的線程模板我使用下面的代碼,它位於機身標籤中:像按鈕,vBulletin和國防部重寫

<td class="vbs_forumdata alt1"> 
    <div id="fb-root"></div> 
     <script type="text/javascript">(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs)})(document,"script","facebook-jssdk");</script> 
     <div id="thread_sharing_content_facebook"> 
      <div class="fb-like" data-href="{vb:raw sharingurl}" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90"></div> 
     </div> 
    </div> 
</td> 

只要模板由vBulletin引擎,可變{動:原料sharingurl}處理中被替換線程的規範網址看起來像這樣:

http://MYDOMAIN/threads/THREADID-THREADTITLE 

例如:

http://www.mydomain.com/threads/1-Hello-Community 

望着主題頁面的HTML源代碼,一切似乎都按預期工作:

<td class="vbs_forumdata alt1"> 
    <div id="fb-root"></div> 
     <script type="text/javascript">(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs)})(document,"script","facebook-jssdk");</script> 
     <div id="thread_sharing_content_facebook"> 
      <div class="fb-like" data-href="http://www.mydomain.com/threads/1-Hello-Community" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90"></div> 
     </div> 
    </div> 
</td> 

不過呢,如果我的Like按鈕點擊共享線程頁......來這裏的戲劇:

Drama

線程頁的原始URL是搞砸轉化成類似的東西:

http://MYDOMAIN/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/THREADID-THREADTITLE 

任何人都知道爲什麼我得到這個奇怪的問題?我唯一想要自己弄清楚的就是我的htaccess文件,它包含一些重寫規則。這幾乎是vBulletin默認的......但是,無論如何,在這裏,他們是:

RewriteEngine On 
RewriteBase/

// Block Bad Bots 
RewriteCond %{HTTP_USER_AGENT} [...] 
RewriteRule ^.*$ - [F,L] 

RewriteCond %{HTTPS} !=on 
RewriteCond %{HTTP_HOST} !^www\..+$ [NC] 
RewriteRule^http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 

RewriteRule ^forums/.* forumdisplay.php [QSA] 
RewriteRule ^members/.* member.php [QSA] 
RewriteRule ^threads/.* showthread.php [QSA] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 

RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA] 

RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^(.*)$ - [NC,L] 

RewriteRule ^(.*)$ - [R=404,L] 

編輯:我嘗試使用Facebook的網址調試器和...

刮信息

Response Code: 200 
Fetched URL: http://www.mydomain.com/threads/1-Hello-Community 
Canonical URL: http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 

嚴重的錯誤必須修復

Could Not Follow Redirect Path: Using data from http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community because there was an error following the redirect path. 

的錯誤,必須固定

Too Many Redirects: URL redirected too many times. Please reduce the number of redirects. 

像這應該是固定的應該是固定的

Admins And App ID Missing: fb:admins and fb:app_id tags are missing. These tags are necessary for Facebook to render a News Feed story that generates a high click-through rate. 
Like Button Tag Missing: og:title is missing. The og:title meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 
Like Button Tag Missing: og:type is missing. The og:type meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 
Like Button Tag Missing: og:image is missing. The og:image meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 

的Open Graph警告按鈕警告

Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. 
Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. 
Inferred Property: The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags. 
Inferred Property: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. 

對象屬性

og:url: http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 
og:type: website 
og:title: #Page Title# 
og:image: 
og:description: #Meta Description# 
og:updated_time: 1348134967 

重定向路徑

originale: http://www.mydomain.com/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 
rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community 

最終網址爲粗體(這是我們試圖從提取元數據的URL)。

請,請...請幫助我!

+0

把你的網址通過調試工具首先,看看它的說法。 https://developers.facebook.com/tools/debug – CBroe

+0

完成!我更新了我的線程! –

回答

1

您可能需要添加元OG標籤

<meta type="og:url" content="<?php get_current_url(); ?>" > 

嘗試