Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add Facebook "Like" button to your threads [vB 3.8.x] Details »»
Add Facebook "Like" button to your threads [vB 3.8.x]
Version: 1.00, by hubie hubie is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.x Rating:
Released: 04-22-2010 Last Update: Never Installs: 225
Template Edits
 
No support by the author.

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]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;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]&amp;show_faces=false&amp
        scrolling="no" frameborder="0" 
        style="border:none; width:450px; height:25px"></iframe>
*Change show_faces=false for true if you want to see faces

Installation:

Go to your Postbit/Postbit Legacy template and search for:
Code:
<!-- controls -->
And add below the code that you previously selected according your favorite button style.

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>
*You should add these variables, otherwise the button will be displayed in every post, which makes no sense.



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

File Type: txt Facebook Like Button.txt (1.3 KB, 1380 views)

Screenshots

File Type: jpg faceb1.jpg (41.1 KB, 0 views)
File Type: jpg faceb2.jpg (6.9 KB, 0 views)
File Type: jpg faceb3.jpg (32.8 KB, 0 views)
File Type: jpg fbk1.jpg (17.4 KB, 0 views)
File Type: jpg fbk2.jpg (28.4 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
Drhago, TheLegendB, yasser4101

Comments
  #32  
Old 04-24-2010, 02:22 AM
wacnstac wacnstac is offline
 
Join Date: Nov 2001
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Also how does it work..!?
Any way that i can "like" things from my FB group or company page, instead of my personal profile.?
That would be very cool, but I don't think it's possible right now.
Reply With Quote
  #33  
Old 04-24-2010, 04:27 AM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool mod, thanks so much
it works exactly how it should
I'm going to play with the placement a little, but here is a "Like" demo if you want to check it out.
Reply With Quote
  #34  
Old 04-24-2010, 05:58 PM
Geek Specialtie's Avatar
Geek Specialtie Geek Specialtie is offline
 
Join Date: Jul 2009
Location: Bloomington, Minnesota
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like a missing closing quote for src tag.

original
Code:
<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp 
        scrolling="no" frameborder="0" 
        style="border:none; width:450px; height:25px"></iframe>

closing quote added
Code:
<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp" 
        scrolling="no" frameborder="0" 
        style="border:none; width:450px; height:25px"></iframe>
I haven't tried this yet but seems some browsers may have an issue with this.
Reply With Quote
  #35  
Old 04-24-2010, 06:20 PM
Uberguilds Uberguilds is offline
 
Join Date: Jun 2006
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The button on every single post lags out my website in certain browsers/platforms. Had to take it down =/
Reply With Quote
  #36  
Old 04-24-2010, 06:44 PM
hubie hubie is offline
 
Join Date: Jul 2009
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gamelobby View Post
This is very cool, but it doesn't seem to work with "Chief 1st post"..?
Any ideas.?

You have to add the code manually in Chief 1st post templates to get it work.

Also how does it work..!?
Any way that i can "like" things from my FB group or company page, instead of my personal profile.?
I would like to know the same.
Quote:
Originally Posted by Loco.M View Post
Very cool mod, thanks so much
it works exactly how it should
I'm going to play with the placement a little, but here is a "Like" demo if you want to check it out.
Great! but testing whit your demo i've noted that when i like the post and then go to my fb page the wall title shows the root of your forums and no the single post in particular. Maybe a miss of code there.

Quote:
Originally Posted by Geek Specialtie View Post
Looks like a missing closing quote for src tag.
Thanks, i'll check and fix.

Quote:
Originally Posted by Uberguilds View Post
The button on every single post lags out my website in certain browsers/platforms. Had to take it down =/
You must add the conditional "<if...>" (at first post of this thread) if don't want the button on every single post.
Reply With Quote
  #37  
Old 04-24-2010, 11:52 PM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to add this to my site, just had a question on the demo.
I'm looking at it right now, and it only says 1 for the count (was 0 before I clicked it), is that right?

After so many from here trying it out, I would think it would be higher than that
Reply With Quote
  #38  
Old 04-25-2010, 01:36 AM
hubie hubie is offline
 
Join Date: Jul 2009
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cdoyle View Post
I'm going to add this to my site, just had a question on the demo.
I'm looking at it right now, and it only says 1 for the count (was 0 before I clicked it), is that right?

After so many from here trying it out, I would think it would be higher than that
Yes you're right. i've replaced the button and the count is still at 0. Not sure if the problem is related with facebook, please give me feedback about it.
Reply With Quote
  #39  
Old 04-25-2010, 01:46 AM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hubie View Post
Put this code:
Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">Your Code</if>
Where in X,Y,Z you have to put the forum IDs you want the button appear, and in the forum ID not especified the button won?t appear.
Just wanted to add, that I modified this IF a little, to make it so you only need to enter the forums you want to exclude
PHP Code:
<if condition="$post[postcount] == 1 AND !in_array($GLOBALS[forumid], array(c, j))"
Just enter the forums you want excluded, and these forums won't show the button and the rest will.
Reply With Quote
  #40  
Old 04-25-2010, 12:23 PM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hubie View Post
Yes you're right. i've replaced the button and the count is still at 0. Not sure if the problem is related with facebook, please give me feedback about it.
I just took another look at the demo, and right now it's only showing that I clicked the button.
I'm assuming that you clicked it too right?

I think I'm seeing the same thing on my forum, but I'm waiting for members to reply back if they clicked it in the test post.

I think it's a problem on Facebooks side, I've tried adding the like button to my RPG game. So far I only have 1 click there too, even though some have said they clicked it.

It also doesn't help that the facebook developer forums have been down all weekend too.
Reply With Quote
  #41  
Old 04-27-2010, 02:18 AM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone else had any luck with the like button?
It seems for me, at least when I look at it. It only shows when I click on it, and doesn't give a total count of how many have clicked it.

Just like the demo, it only shows that I clicked on it and nobody else.

That can't be right can it?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05864 seconds
  • Memory Usage 2,367KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (3)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete