The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Add Facebook "Like" button to your threads [vB 3.8.x] Details »» | |||||||||||||||||||||||||||||||||||||||
Add Facebook "Like" button to your threads [vB 3.8.x]
Developer Last Online: Jun 2013
This mod is based on this, but working on vB 3.8.x.
As was said there: Facebook has just launched their latest "Like" button to developers to use on any site. What this does is utilizes the Advertising module to add the "Like" button to the first post of each thread. Please see screenshots to get an idea. DEMO IFrame Method There is two kind of "Like" button (IFrame Method): - With a smallest counter at his side * Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&layout=button_count&show_faces=true&width=&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe> - With a largest counter (and names of people who have clicked) * Code:
<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&show_faces=false& scrolling="no" frameborder="0" style="border:none; width:450px; height:25px"></iframe> Installation: Go to your Postbit/Postbit Legacy template and search for: Code:
<!-- controls --> If you want that the button only appears in first post of a thread, add this variables at the beginning and end of the code that you previously selected: Code:
<if condition="$post[postcount] == 1">YOUR CODE</if> XFBML Method (recommended) This is a richer way to send the contents of your board to Facebook, because it gives to users the possibility to add more information and also an image of your site is displayed on their FB wall (see the screenshots below). Installation: (provided by cdoyle, thanks mate :up You'll need to register your app here: http://developers.facebook.com/setup/, and get an ID to place into the code below. Code:
<if condition="$post[postcount] == 1 AND !in_array($GLOBALS[forumid], array(40, 39))"> <p><fb:like></fb:like></p> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: 'yourappID', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script> </if> Internet Explorer browser fix: https://vborg.vbsupport.ru/showpost....5&postcount=70 ----------------------------------------------------------------------------------------------------- For additional information on this button and different parameters please visit http://developers.facebook.com/docs/...e/plugins/like Remember to click Mark as Installed if you use this modification :up: Download Now
Screenshots
Show Your Support
|
3 благодарности(ей) от: | ||
Drhago, TheLegendB, yasser4101 |
Comments |
#132
|
|||
|
|||
Quote:
|
#133
|
|||
|
|||
IF you use the FB Like button in your forums you should read this:
http://www.searchmarketingman.com/20...utton-bug.html The Like button messes up the URLs and indexed pages in SE's and makes many pages in your forum blank for IE users, so I've removed it for now until Facebook applies a fix to this. http://bugs.developers.facebook.net/...ug.cgi?id=9777 It's listed as a priority 5 bug by Facebook now, and that's the lowest priority so it may take a while until it's getting fixed, so the Like button may really mess up your forums now! |
#134
|
||||
|
||||
I don't know if this XFBML code is affected by this bug, this code is relatively old and been out for a while... The code they are talking about is when linked directly to facebook's servers to download the latest javascript code...
As a test I put this into google: inurl:fb_xd_fragment site:mydomain.com And it didn't return any URL's so so far my site has been unaffected. However if you use a site name that has been affected hundreds of blank pages come up, such as: inurl:fb_xd_fragment site:thefootballnetwork.net |
#135
|
|||
|
|||
Quote:
The best way to see this, and the way I found out the bug on my site (I didn't have any indexed pages with fb_xd_fragment either) ,was through Google Analytics. I started to notice several links ending in fb_xd_fragment that visitors where only on for a few secs. When I removed the FB Like button it was ok again, so the bug is still there. |
#136
|
||||
|
||||
Thanks... sure enough they were there in the Analytics... switched back to the iframe for now.
|
#137
|
|||
|
|||
Quote:
I have removed the "Like" button and wont add it until FB confirms that the bug has been fixed. Had hundreds of pages pr. day that where affected by this according to Google Analytics, and when I removed the button none of the fb_xd_fragment links shows up in the logs there anymore. It's really bad that FB have put a priority 5 on this, since it's a pretty serious bug. |
#138
|
||||
|
||||
damn... thanks.
|
#139
|
||||
|
||||
Nice! I'm using it and it works A1 with the IFrame.
Tho, i didn't put it under the control as it's to low, i switch it in my posbit-legacy under Icons&title Code:
<!-- icon and title --> <h3 class="threadtitle"> <!---facebook-button---> <if condition="$post[postcount] == 1"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yoursite.com/showthread.php$session[sessionurl]?p=$post[postid]&layout=button_count&show_faces=true&width=&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe></if> <!---/facebook-button---> <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if> |
#140
|
|||
|
|||
I don't get it.
I'm using this code. It posts to my fb page. but no topic link. Just a link to my domain name. That's it. Code:
<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.mysite.com/forums/showthread.php$session[sessionurl]?p=$post[postid]&show_faces=false& scrolling="no" frameborder="0" style="border:none; width:450px; height:55px"></iframe> <hr size="1" style="color:$stylevar[tborder_bgcolor]; fb:admins background-color:$stylevar[tborder_bgcolor]" /> |
#141
|
|||
|
|||
I'm using the Iframe code with my site correctly inputted and nothign happens. Nothing is showing up in my posts in IE or FF. I saw a few other people with the same prob but nobody answered. I'm using the correct postbit template.
Why is nothing showing up??? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|