vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Add New Facebook "Like" button to your threads (https://vborg.vbsupport.ru/showthread.php?t=241011)

ericgtr 04-21-2010 10:00 PM

Add New Facebook "Like" button to your threads
 
1 Attachment(s)
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.

saviola8x 04-22-2010 03:17 PM

1 Attachment(s)
Fix with me ! Demo : http://s2facebook.com/forum/showthread.php?854

Open Postbit temp search
Code:

{vb:raw ad_location.thread_first_post_content}
Add below :
Code:

<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://DOMAIN.com/forum/{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 -->

Done.

pjdaley 04-22-2010 03:29 PM

I also get "error"

The page at http://mysitehere.net/showthread.php?t could not be reached.

Also it seems not to work with VBSeo

Doctor Death 04-22-2010 03:38 PM

Would be great to have a dislike button as well.

Can it also be tagged to each post in a thread or can it only deal with first post?

saviola8x 04-22-2010 03:50 PM

Quote:

Originally Posted by Doctor Death (Post 2025445)
Can it also be tagged to each post in a thread or can it only deal with first post?

Wherever you want. :up:

trackpads 04-22-2010 04:35 PM

I changed the width to =50 so that it didnt push the content around

trackpads 04-22-2010 04:35 PM

Suggestion: Can you create a hack like this so users can like members profiles?

ericgtr 04-22-2010 04:49 PM

To anyone getting a submit error, be sure your URL is correct. Also, I have not tested with vbseo and it will most likely need to be re-worked for that.

@trackpads I will look into that, I'm sure the parameters will have to be modified for that page.

PixelFx 04-22-2010 04:54 PM

looks like sweet addon thanks :D

wacnstac 04-22-2010 05:21 PM

Can this also be used with 3.8.X?


All times are GMT. The time now is 11:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03389 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete