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

Reply
 
Thread Tools
Add "LIKE" button and other Facebook plugins to threads. Details »»
Add "LIKE" button and other Facebook plugins to threads.
Version: 1.4, by Xtrigit Xtrigit is offline
Developer Last Online: Apr 2011 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.x Rating:
Released: 05-25-2010 Last Update: 07-04-2010 Installs: 55
Template Edits
 
No support by the author.

UPDATED: 7/4/10

What's new?
Facebook Comment Box


I recently added the new facebook "Like" button to my forum and I want to share with everyone!

Yes, this is IE,Firefox, Opera, Safari compatible.
Yes, this will also show a "comment" box when hover over.

First thing's first:

1. Go to http://www.facebook.com/developers/createapp.php (Facebook account required)

2. Enter your site name in the "Application Name" field... "agree" - "Create new app"

3. Click the Website tab

4: Enter your site URL in the "Connect URL" field.

i.e. http://www.DOMAIN.com/ (Don't forget the SLASH).

5. Enter DOMAIN.com in the "Base Domain" field and save.

6. In the next page you will see an "Application ID" number. (you'll need it later... keep the window open for now)

Template Edits:

headinclude:
Under:
PHP Code:
<meta name="generator" content="vBulletin $vboptions[templateversion]/> 
Paste:
PHP Code:
<meta property="og:title" content="$threadinfo[title]"/>
<
meta property="og:site_name" content="$vboptions[bbtitle]"/>
<
meta property="og:type" content="website" />
<
meta property="og:image" content="IMAGEPATH"/>
<
meta property="fb:admins" content="YOUR PROFILE ID"/> 

* Replace IMAGEPATH with the actual path to the image you want to be displayed on people's facebook wall. (You can use your site logo)
*YOUR PROFILE ID = http://www.facebook.com/profile.php?id=randomnumbers

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

SHOWTHREAD
Find:
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]lang="$stylevar[languagecode]"
Replace with:
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]xmlns:fb="http://www.facebook.com/2008/fbml" lang="$stylevar[languagecode]"
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

under:
PHP Code:
<body onload="$onload"
Paste:
PHP Code:
<div id="fb-root"></div>
<
script src="/images/fb.js" type="text/javascript"></script
*Download and open the attached .js file, Replace "APP ID" with your actual app ID. (not to be confused with profile ID)
*Save and upload fb.js to root/images
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++

Find:
PHP Code:
<!-- / multiquote scripts -->
</if> 
Add below:
PHP Code:
<!-- Facebook Comment --> 
<
br /> 
<if 
condition="in_array($bbuserinfo[usergroupid],array(1))"><div align="center">
<
fb:comments numposts="3" width="800"></fb:comments>
</
div></if>
<!-- / 
Facebook Comment --> 
*This will place the Facebook Comment box below the last post, you may change the width to your liking.
*The comment box will only be shown to guests.
++++++++++++++++++++++++++++++++++++++

Now we need to place the "LIKE" button somewhere visible.

I use postbit_legacy so, this is what I did:
Find:
PHP Code:
<if condition="$post['title']"><strong>$post[title]</strong></if>
            </
div
Add below:
PHP Code:
<if condition="$post[postcount] == 1"><table style="background-color: #ff0000;">
<
tr style="background-color: yellow;">
<
td style="background-color: #fff;" align="right"><fb:like href="$vboptions[bburl]/showthread.php$session[sessionurl]?p=$post[postid]width="260"></fb:like></td>
</
tr>
</
table></if> 
* This will place the like button below the first post of every thread.
* you may change the table color to suit your needs.
---------------------------------------------------------------------------
Thanks to BirdOPrey5 for pointing out some mistakes.

Mark as Installed if you use this modification.


DONE! =]

Download Now

File Type: zip Facebook Files.zip (680 Bytes, 381 views)

Screenshots

File Type: png 1.png (4.7 KB, 0 views)
File Type: png 2.png (7.0 KB, 0 views)
File Type: png 3.png (11.1 KB, 0 views)
File Type: png 4.png (15.6 KB, 0 views)
File Type: png 5.png (16.6 KB, 0 views)

Show Your Support

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

Comments
  #42  
Old 07-03-2010, 05:09 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For what it's worth, I've been having problems installing the Like button even before I found this mod. I pretty much did everything they instructed at Facebook before I read the install instructions here, and it appears to be the same problem. "Like" does not like vBulletin threads. At least not vB3 threads.
Reply With Quote
  #43  
Old 07-03-2010, 03:37 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
For what it's worth, I've been having problems installing the Like button even before I found this mod. I pretty much did everything they instructed at Facebook before I read the install instructions here, and it appears to be the same problem. "Like" does not like vBulletin threads. At least not vB3 threads.
I agree this is much more difficult then it should be- something isn't playing nicely in vB... but I did end up getting this to work using all the instructions in this mod but instead if pasting the last step here into the template I used the IFRAME code provided by facebook...

Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURDOMAIN/forums/showthread.php$session[sessionurl]?t=$threadid" &amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe>
edit YOURDOMAIN to be your web domain...

Additionally I put it in an if tag:
Code:
<if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 24, 45))">
 -iframe code- 
</if>
Where the numbers are the forum id's of private forums that aren't viewable by guests and therefore useless to add a 'like' button too.

Finally I moved this to under where the page navigation menu would show if it was a multiple page thread on the showthread template... I moved the <td></td> tags out of the built in <if> statement so the table will be there regardless of whether the page nav menu is displayed... the code for everything now looks like:

Code:
	<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if>
<if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 24, 45))">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURDOMAIN/forums/showthread.php$session[sessionurl]?t=$threadid" &amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe>
</if>
</td>
Anyway this all works fine (for me), you can see a demo at:
http://www.juot.net/forums/showthread.php?t=41185
No login required.
Reply With Quote
  #44  
Old 07-04-2010, 10:03 PM
Xtrigit's Avatar
Xtrigit Xtrigit is offline
 
Join Date: Jan 2010
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MOD has been updated, enjoy!
Reply With Quote
  #45  
Old 07-07-2010, 06:46 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xtrigit View Post
MOD has been updated, enjoy!
Okay, made the updated changes. Still giving me the iframe error, even though I'm not using an iframe. Really, I don't see any reason why this shouldn't be working. Everything is as Facebook says it should be done.
Reply With Quote
  #46  
Old 07-07-2010, 06:50 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Okay, made the updated changes. Still giving me the iframe error, even though I'm not using an iframe. Really, I don't see any reason why this shouldn't be working. Everything is as Facebook says it should be done.
Looks like we're not the only one's having this problem: http://thecandycrew.webs.com/ http://forum.developers.facebook.com...php?pid=242948
Reply With Quote
  #47  
Old 07-07-2010, 08:57 PM
Xtrigit's Avatar
Xtrigit Xtrigit is offline
 
Join Date: Jan 2010
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Looks like we're not the only one's having this problem: http://thecandycrew.webs.com/ http://forum.developers.facebook.com...php?pid=242948
What is your site URL?

I've implemented facebook plugins in dozens of sites and they all seem to be working great.

I believe some javascript on your site is interfering with facebook plugins.
Reply With Quote
  #48  
Old 07-08-2010, 11:55 AM
sundarmobiles sundarmobiles is offline
 
Join Date: Oct 2007
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can u give the procedure to use navbit area like in this screen shot and also can i use this one for this version 3.7.3?
Attached Images
File Type: jpg 7-8-2010 6-24-12 PM.jpg (125.6 KB, 0 views)
Reply With Quote
  #49  
Old 07-08-2010, 03:20 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
*YOUR PROFILE ID = http://www.facebook.com/profile.php?id=randomnumbers
Are these random numbers made up by us or are they generated somewhere? How many digits- does it matter?
Reply With Quote
  #50  
Old 07-08-2010, 10:24 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
*This will place the Facebook Comment box below the last post, you may change the width to your liking.
*The comment box will only be shown to guests.
Also- why would I only want to show the comment box to guests? Wouldn't I want anyone to be able to make a comment when they Like something?
Reply With Quote
  #51  
Old 07-10-2010, 01:58 AM
Xtrigit's Avatar
Xtrigit Xtrigit is offline
 
Join Date: Jan 2010
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
Are these random numbers made up by us or are they generated somewhere? How many digits- does it matter?
Those numbers are your facebook profile ID, you'll find this in the address bar when you sign in to facebook.

If you have assigned your profile a custom "name", please read this:
http://www.ehow.com/how_5753004_facebook-id.html

Quote:
Originally Posted by BirdOPrey5 View Post
Also- why would I only want to show the comment box to guests? Wouldn't I want anyone to be able to make a comment when they Like something?
Replace:
PHP Code:
<br /> 
<!-- 
Facebook Comment --> 
<if 
condition="in_array($bbuserinfo[usergroupid],array(2,6,7,5))"><else /><div align="center"
<
fb:comments numposts="3" width="800"></fb:comments></if></div
<!-- / 
Facebook Comment --> 
With:
PHP Code:
<br /> 
<!-- 
Facebook Comment --> 
<
div align="center"
<
fb:comments numposts="3" width="800"></fb:comments></if></div
<!-- / 
Facebook Comment --> 
Now all members and guests can see and write in the comment box.
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 08:40 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.05836 seconds
  • Memory Usage 2,405KB
  • 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
  • (3)bbcode_code
  • (12)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
  • (11)post_thanks_box
  • (2)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
  • (7)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