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 |
#192
|
||||
|
||||
Quote:
http://developers.facebook.com/docs/.../plugins/like/ VB4 has a Facebook Like button built in, it just needs to be enabled. |
#193
|
||||
|
||||
Quote:
BirdOPrey5: I made a new "like" on the web you publish, but publish the new code I have another problem. If I click "like" on a thread, then it appears in all forums as if it had been here The same thing happens with the first 2 codes are posted here. regards |
#194
|
||||
|
||||
In the code they give you, you need to change the URL... Replace the hard coded URL with this code:
Code:
$vboptions[bburl]/showthread.php?t=$thread[threadid] |
#195
|
||||
|
||||
Quote:
I'm more confused than before! LOL This is the code that developers give me in "LIKE". http://developers.facebook.com/docs/.../plugins/like/ Where would include the code you give me? IFRAME Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmotofanaticos.com%2Fupload&send=false&layout=standard&width=338&show_faces=true&action=like&colorscheme=light&font&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:338px; height:80px;" allowTransparency="true"></iframe> XFBML Code:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/al...cript><fb:like href="http://motofanaticos.com/upload" send="false" width="338" show_faces="true" font=""></fb:like> |
#196
|
||||
|
||||
You should use the XFBML code like this:
Code:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" send="false" width="338" show_faces="true" font=""></fb:like> |
#197
|
||||
|
||||
Thank you very much BirdOPrey5,
The code works fine. I tried it on INTERNET EXPLORER, FIREFOX & GOOGLE CHROME and works perfect on all three browsers, also published the titles in the wall?s facebook as published in the threads. My code Code:
<if condition="THIS_SCRIPT =='showthread'"> <div id="fb-root"></div><script src="http://connect.facebook.net/es_LA/all.js#xfbml=1"></script><fb:like href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" send="false" width="338" show_faces="true" font=""></fb:like> </if> I changed en_US by es_LA for Spanish and additions to the first <if condition="THIS_SCRIPT =='showthread'"> and then at the end </if> to publish "LIKE" in all threads but not in private messages. regards |
#198
|
|||
|
|||
I'm finding that the 'like' appears briefly and then disappears. Can anyone help?
Ian |
#199
|
|||
|
|||
use mikelangelo2005 code, I had same problem and it worked for me
|
#200
|
|||
|
|||
I've even got it to work on vb4.0, added the code in the SHOWTHREAD template though so it appears once on every thread rather than on every post
Thanks for the code |
#201
|
|||
|
|||
How can i put the button in the same line, but in the left it will be better, because here it's behind the quote, thank's button.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|