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 Details »» | |||||||||||||||||||||||||||||||||||
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 |
#72
|
||||
|
||||
Quote:
|
#73
|
||||
|
||||
That will do it, remember that FB has to be able to read the thread as a guest in order to display its title.
|
#74
|
|||
|
|||
damn. no work around huh?
|
#75
|
|||
|
|||
I inserted the code so that the FB Like will only show in certain forums, but it continues to show in all forums. I have seen this code in two different ways in this thread. Is either one correct.
<vb:if condition="in_array($forum['forumid'], array(2,14))">Show this to forum 2 and 14</vb:if> <vb:if condition="in_array($forum['forumid'],array(2,14))"> This is what I have and it doesn't just show these two forums: PHP Code:
|
#76
|
||||
|
||||
Quote:
change Code:
show_faces=true Code:
show_faces=false |
#77
|
||||
|
||||
Quote:
And when you are logged into facebook, you'll see this: Obviously, the above examples are using Option 2. Option 1 would look like this, and I didn't like the way it was wrapping the text. And here's option 2 on the same thread: |
#78
|
|||
|
|||
Marked as unistalled. Although there seems to be no danger, it serves no purpose in a inaccessible forum.
EDIT: Installed. Having the code to specify forums changed my mind |
#79
|
|||
|
|||
why doesn't it pull from the URL in private forums? the url's are supposed to be SEO friendly after all.
|
#80
|
||||
|
||||
Because FB cannot access the URL as a guest. Try to think of FB as a guest on your site, if a guest cannot access a forum it cannot see the title.
|
#81
|
|||
|
|||
ONLY DISPLAY IN CERTAIN FORUMS
29 and 133 being the forum ids you want this to show in.. more forums would be 29,44,123,49 etc its not $forum[forumid] its $thread[forumid] Code:
<vb:if condition="in_array($thread['forumid'],array(29,133))"> <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=false&width=450&action=like&font=tahoma&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px"></iframe> <!-- / Facebook Like --> </vb:if> </vb:if> |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|