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 |
#72
|
|||
|
|||
I thought the problem with the IE code was the if statement for displaying only on the first thread? At least I thought that's what someone said earlier. Does the code above solve that too?
|
#73
|
|||
|
|||
I don't think the problem was the variable "if", since I'm currently using it with IE and the problem is solved by changing the code such as above.
|
#74
|
||||
|
||||
It seems I have same problem of not showing the button. Is probably a conflict with other mods installed. I put it on a forum without Chief First post mod and still not working.
I am thinking of Topic of the month, or quote post on PM mods but is just a guess. I am looking for having this mod on my forums... Nice mod. @ Hubie - Your modification does not work in FF but work in IE. It mislead me the mod is not working. I am using last version of FF and forum is 3.8.4 with lots of mods. edit: Am I dumm or what: Remember to tell No script in Firefox to let facebook.net or you won't see the button. @ Hubie - Your modification works both in IE and FF! Great, thanks. |
#75
|
|||
|
|||
Quote:
I'm using the second bit of code from the original post, which works AOK in firefox, where do I go about putting the IE code pasted above? Also, I notice some threads properly relay their title to Facebook, but some do not I'm using VBSeo, so thought it might be that, but it seems odd that two threads in the same forum, have different results. |
#76
|
|||
|
|||
Quote:
It show awesome on my facebook page after i click "like" Thanks |
#77
|
|||
|
|||
hmm, I still can't get this to work in IE.
I am now using this Code:
<if condition="$post[postcount] == 1 AND !in_array($GLOBALS[forumid], array(40, 39))"> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxxxxx', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script> <fb:like layout="standard" show_faces="true" width="300" action="like" colorscheme="light" /> </if> |
#78
|
|||
|
|||
Quote:
|
#79
|
|||
|
|||
I tried the demo out again, and it's not showing in IE either.
|
#80
|
|||
|
|||
IE fix seems to be working fine for me, although the "Like" button seems to be showing up twice when I checked in Chrome. Not tried any other browsers yet though.
|
#81
|
|||
|
|||
Spoke to soon, seems the IE fix isn't working properly for me. Everything comes up fine, but between navigating away from the page and returning the FB button seems to have forgotten that I "Like" the thread, and goes back to asking me to be the first of my friends to like it again.
Frustrating! Also, when it posts a comment to my wall it grabs the first image it can find on the page... which is always a box-corner! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|