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 |
#52
|
|||
|
|||
i installed the XFBML Method and i see the button in firefox but not in explorer, could you check that to fix it?
besides how can i make it be in the very same line than the rest of the buttons (edit, quote, etc) because there is a jump there (looks like 2 lines and it's not even aligned to the right). Thanks |
#53
|
|||
|
|||
Quote:
I'll try and take a look at it tonight, and see if I can get it working again in IE. |
#54
|
|||
|
|||
i'd appreciate it, thanks
|
#55
|
|||
|
|||
I got home late so couldn't mess with it much, but what I tried didn't work.
I don't get why it's not working I've tried to register on the facebook forums, but it errors any time I try. Does anyone else already have an account there? If you do, post the code we are using and ask why it doesn't work in IE. There has to be a reason, that we are just not seeing. |
#56
|
|||
|
|||
It is not working in IE due to the IF condition. Try removing the IF condition and you'll notice it works fine.
Does anyone have an IF condition for post number that works in IE? |
#57
|
|||
|
|||
darn, if that's the case then I don't know the solution.
Anyone know why the IF doesn't work in IE? |
#58
|
||||
|
||||
Quote:
Some users have a link back to that thread, some don't I've also noticed that on other threads it's about 50/50 if it links to that thread, or the forumhome. |
#59
|
|||
|
|||
Hmm... and there is no if condition to make this not show in personal messages yet? Noone fixed that? The button should not display in private messages at all.
|
#60
|
||||
|
||||
Quote:
Try: http://www.nzboards.com/new-zealand-...t-3-5-a-90512/ (it's under the Reply to Thread/Thread Title), then check my FB profile. Quote:
|
#61
|
|||
|
|||
That is already fixed, you must add the cond if like as shown in 1rst post.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|