Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add New Facebook "Like" button to your threads Details »»
Add New Facebook "Like" button to your threads
Version: 1.2, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.0.2 Rating:
Released: 04-21-2010 Last Update: 04-21-2010 Installs: 326
Re-useable Code  
No support by the author.

Please remember to click Mark as Installed if you use this modification.

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.

In your Admin CP go to Advertising > New Ad > Choose "Thread" from the dropdown and then select the first thread box. Give it a title (I called mine FB Like) leave "First Post Content" at default and paste in this code:
HTML Code:
<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}#post{vb:raw post.postid}&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>
<!-- / Facebook Like -->
Be sure to change YOURSITE.com to your URL including your forum.

The VBSEO team has instructions on how to make this work for their product here http://www.vbseo.com/f2/facebook-lik...95/#post265997

===========================================
Option 2 (different from above, do not use together) will show at top, see screenshot #3

In Postbit (or legacy) find:
Code:
{vb:raw ad_location.thread_first_post_content}
Add this after:
Code:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"
<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe>
<!-- / Facebook Like -->
</vb:if>
For additional information on this button and different parameters please visit http://developers.facebook.com/docs/...e/plugins/like

=================================================

For those who have asked, here is the modification adds both the "Like" button and comments to a users profile https://vborg.vbsupport.ru/showthread.php?t=239424

=================================================
Additional locations to place this code:

For CMS, in vbcms_content_article_page add the code below this:
Code:
{vb:raw comment_block}
For pictures, in template album_pictureview add the code below this:
Code:
{vb:raw picturecomment_commentarea}
For Blog, in template blog_show_entry add at the very top.

Download Now

File Type: txt fb_like.txt (946 Bytes, 1066 views)

Screenshots

File Type: jpg fb_like.JPG (89.7 KB, 0 views)
File Type: jpg fb_like2.JPG (11.7 KB, 0 views)
File Type: jpg fb_like3.JPG (41.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 04-25-2010, 10:30 PM
MedellinStyle MedellinStyle is offline
 
Join Date: Oct 2007
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I want to ask, the script works fine, it displays fine on peoples wall on facebook, but in VBULLETIN, different to how many people clicks on LIKE, it still displays , LIKE 1.

Only 1 not acumulate, any help would be appreciated , thanks!
Reply With Quote
  #93  
Old 04-25-2010, 11:18 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MedellinStyle View Post
Hi

I want to ask, the script works fine, it displays fine on peoples wall on facebook, but in VBULLETIN, different to how many people clicks on LIKE, it still displays , LIKE 1.

Only 1 not acumulate, any help would be appreciated , thanks!
It only shows how many of your friends clicked on it.

Please click install.
Reply With Quote
  #94  
Old 04-26-2010, 01:03 PM
YankForum's Avatar
YankForum YankForum is offline
 
Join Date: Mar 2010
Location: MY
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tnx installed
Reply With Quote
  #95  
Old 04-26-2010, 02:06 PM
AndrewSpearin AndrewSpearin is offline
 
Join Date: Dec 2009
Location: Toronto
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this installed and working fine for forum posts, but how do I go about adding it for CMS articles, blog posts, and albums/pictures?
Reply With Quote
  #96  
Old 04-26-2010, 02:24 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AndrewSpearin View Post
I have this installed and working fine for forum posts, but how do I go about adding it for CMS articles, blog posts, and albums/pictures?
Here's some suggestions.

For CMS, in vbcms_content_article_page add the code below this:
Code:
{vb:raw comment_block}
For pictures, in template album_pictureview add the code below this:
Code:
{vb:raw picturecomment_commentarea}
This gives you the idea, I haven't added it to the blog yet but it's just a matter of locating the right template.
Reply With Quote
  #97  
Old 04-26-2010, 03:58 PM
AndrewSpearin AndrewSpearin is offline
 
Join Date: Dec 2009
Location: Toronto
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I added this code:

<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.npac.ca/2010/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}&amp;layout=button_count&amp;show_f aces=false&amp;width=450&amp;action=like&amp;color scheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px"></iframe>
<!-- / Facebook Like -->

in: vbcms_content_article_page

after: <vb:if condition="$comment_block"> ... </vb:if>

Example: http://npac.ca/2010/content.php/121-QA-with-Rod-MacIvor

I click like, it shows up with the proper article title on my Facebook profile, however it links to the corresponding forum post for the article: http://www.npac.ca/2010/showthread.p...th-Rod-MacIvor

The 'like' does appear in both the forum post and article though.

How can I make it link straight back to the article? I'm not familiar with the {vb:link} stuff, so I don't really know what else to try instead.

Thanks again for your help!
Reply With Quote
  #98  
Old 04-26-2010, 04:25 PM
movslow movslow is offline
 
Join Date: Aug 2008
Posts: 297
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FYI, I had the error, and realized you need the trailing / on the end of the url.

Added that, worked liked a charm, this was in Postibit Legacy.
Reply With Quote
  #99  
Old 04-27-2010, 02:49 AM
fluidswork's Avatar
fluidswork fluidswork is offline
 
Join Date: Apr 2010
Location: India
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome mod i will try it ..............
Reply With Quote
  #100  
Old 04-27-2010, 06:40 AM
junaid junaid is offline
 
Join Date: Oct 2005
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is possible to add like thanks button or same locations?
Reply With Quote
  #101  
Old 04-27-2010, 07:06 AM
junaid junaid is offline
 
Join Date: Oct 2005
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want code for button count 16x16
could you provide me code
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 12:37 AM.


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.05404 seconds
  • Memory Usage 2,347KB
  • 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
  • (6)bbcode_code
  • (1)bbcode_html
  • (2)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
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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