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 |
#152
|
|||
|
|||
Quote:
Should I add them? If so where? |
#153
|
||||
|
||||
Definitely everyone who uses the Like button should have these headers... Put them anywhere in your headinclude template.
Code:
<meta property="og:title" content="$threadinfo[title]"/> <meta property="og:site_name" content="$vboptions[bbtitle]"/> <meta property="og:image" content="http://www... path to image/logo.jpg"> <meta property="og:type" content="article" /> |
#154
|
|||
|
|||
Quote:
This is the code I am using Code:
<meta property="og:image" content="http://www.silverfishlongboarding.com/images/logo.jpg"> If I have to choose one or the other I would rather be able to choose but just thought I should ask. Thanks for all the help, yer great. |
#155
|
||||
|
||||
I don't think there's a way to choose, if so I haven't found it. You can remove the whole line to go back to how it was.
If you're using the iframe method the image won't ever show unfortunately. |
#156
|
|||
|
|||
Quote:
good to know, thanks. |
#157
|
|||
|
|||
Quote:
Thanks again. |
#158
|
||||
|
||||
I believe the fan page is totally independent. I don't know of any way to "link" them. There is one additional "og" tag where you can add your facebook id to be the admin of the like button but I don't believe it really does anything for the like button as implemented in this mod.
Code:
<meta property="fb:admins" content="9999999999"/> How to find your facebook ID |
#159
|
|||
|
|||
Quote:
|
#160
|
|||
|
|||
edit:
Anyone knows how we can get the Language changed in the IFrame Version? Kind Regards |
#161
|
||||
|
||||
I got sort of a request if anyone is willing to try, instead of having the like button inside the postbit, is it possible to have it in it's own box below the first post? I cannot get it situated right without it screwing up the postbit.
Also for the meta stuff, it doesn't seem to work for me. I put the stuff in the headinclude template with correct info, but when it gets to facebook it is as it was before. Maybe i am missing something though, i don't even know what it means by og or how the code would know that that meta is for facebook and not the site itself. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|