The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||||||||||
Add New Facebook "Like" button to your threads
![]() Developer Last Online: Feb 2022 ![]() ![]()
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}&layout=button_count&show_faces=true&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe> <!-- / Facebook Like --> 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} 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}}&layout=standard&show_faces=true&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe> <!-- / Facebook Like --> </vb:if> ================================================= 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} Code:
{vb:raw picturecomment_commentarea} Download Now
Screenshots
Show Your Support
|
Comments |
#52
|
|||
|
|||
![]()
Thank you TimberFloorAu and Uberguilds for posting your code. Unfortunately, I couldn't get either to work. I can get the mod to work by itself except everytime I try to exclude forums it doesn't work. I've tried all different ways:
Code:
<!-- Facebook Like --> <vb:if condition="(THIS_SCRIPT == showthread) && ($post[postcount] == '1') && (in_array($forum[forumid],array(2,3,8,9,13)))"> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.com/{vb:link thread, {vb:raw thread}}&layout=standard&show_faces=true&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe> </vb:if> <!-- / Facebook Like --> Code:
<!-- Facebook Like --> <vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> <vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.com/{vb:link thread, {vb:raw thread}}&layout=standard&show_faces=true&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe> </vb:if> </vb:if> <!-- / Facebook Like --> |
#53
|
||||
|
||||
![]() Quote:
|
#54
|
||||
|
||||
![]() Quote:
|
#55
|
|||
|
|||
![]()
Ah now I see it, give me a slap, I'll keep my mouth shut next time lol.
Thanks TimberFloorAu and everybody who has tweaked this, not forgetting EricGTR, I really like this mod and think overall, it's far better than Facebook Connect, I just hope Facebook don't decide to discontinue this like they the did with Facebook Connect. |
#56
|
|||
|
|||
![]()
There is supposed to be a bug in 4.0.0 - 4.0.2 in which ads won't diplay at all if you set them for certain forums: http://www.vbulletin.com/forum/proje...d=34416&page=2
It's supposed to be fixed in 4.0.3 which I'm using yet I can't get it to work. |
#57
|
|||
|
|||
![]() |
#58
|
||||
|
||||
![]()
I just changed to option 2. Much better. Option 1 was wrapping my text strange, leaving big gaps.
|
#59
|
|||
|
|||
![]()
How is the code for the CMS?
|
#60
|
||||
|
||||
![]()
Option 2 to hide specific forums.
Code:
<!-- Facebook Like --> <vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> <vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.com/{vb:link thread, {vb:raw thread}}&layout=standard&show_faces=true&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe> </vb:if> </vb:if> <!-- / Facebook Like --> Code:
<!-- Facebook Like --> <vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> <vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.com/forum/{vb:link thread, {vb:raw thread}}&layout=standard&show_faces=true&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe> </vb:if> </vb:if> <!-- / Facebook Like --> Code:
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> The code Code:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"> To show in only ONE forum: Replace Code:
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> Code:
<vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if> |
#61
|
|||
|
|||
![]() Quote:
confusing..the display and hide are both the same? how do you combine these conditions? show in forum Code:
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))"> Code:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"> thx |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|