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
Facebook Comments Box to Threads for VB3 Details »»
Facebook Comments Box to Threads for VB3
Version: 1.00, by ShawneyJ ShawneyJ is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.x Rating:
Released: 10-21-2014 Last Update: Never Installs: 6
Template Edits
 
No support by the author.

I didn't see a facebook comments in threads mod for vb3.8.x. Or maybe im just going blind! A client wanted this added under her first post. And yes, works a treat for FF, IE, Chrome, Mobile.

I wasn't a huge fan of fb comments under first post. So i will just add here how i added fb comments like my test chat forum, which is placed nicely under Quick Reply.

How to add the facebook comments box to your thread vb3 only.
First, create a Facebook App.

Visit http://developers.facebook.com
Login with your Facebook account.
Select Apps from the navigation menu and choose Create a New App.
Fill in the Display Name and select a category that matches your app.
Click Create App - You?ll now be taken to your App?s Dashboard page.

Click the Settings link and add a Contact Email address and App Domain (your site URL) and Save your changes.

Next, click the Status & Review link, and toggle the switch to make the app public.

Note: maybe a tiny bit different than when i last added Apps.

Ok, so you have your App ID ready to do these template edits to your vbulletin.

This code is slightly modified to pass validator.w3.

In SHOWTHREAD Template find:
Code:
<body onload="$onload">


And add this Below:
Code:
<div id="fb-root"></div>
<script type="text/javascript">
//<![CDATA[
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=YOUR-APP-ID&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
//]]>
</script>


Change in red "YOUR-APP-ID" with your FB App ID.

Still in SHOWTHREAD Template, add your FB Comments under quick reply.

Search for:
Code:
<!-- / quick reply -->
</if>


Add below:
Code:
<!-- facebook comments begin -->
<if condition="!in_array($GLOBALS[forumid], array(x,x,x))"><br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="thead">Facebook Comments</td>
</tr>
<tr>
	<td class="alt1">
<div class="fb-comments" data-href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" data-order-by="time" data-numposts="5" data-width="" data-colorscheme="light"></div>
	</td>
</tr>
</table>
</if>
<!-- facebook comments end -->

And Save.

Dont for get to change the x,x,x highlighted in red.
For Example, if i wanted to hide the Facebook Comments in certain Forums, i would place in the Forums ID 40 and 16. My code would look like this:
Code:
<if condition="!in_array($GLOBALS[forumid], array(40,16))">


Tips,
All this can be edited in the Code:
data-colorscheme = "light" or "dark" theme.
data-numposts = the number of comments to show by default, which is set at 5.
data-order-by = "social", "reverse_time", or "time".
data-width = the width of the FB Box in pixels. For a fluid width, use 100%.
Note: IE dont like fluid width at 100%, it chucks a hissy fit.

You would be better to leave width at nothing.

Moderation.
If you want moderators for your Comment box, visit your App?s Role page and add their Facebook ID as an Administrator.

Lastly, if you want comments box under first post which is added in Postbit Template, and, or anywhere else in your thread, i can add the How-To here.

Screenshots added and Demo at me test chat forums.
Cheers.

Screenshots

File Type: jpg facebook-view.jpg (77.9 KB, 0 views)
File Type: jpg Thread-view.jpg (54.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
tbworld

Comments
  #2  
Old 10-22-2014, 06:08 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work @Shawneyj, Thanks for sharing.
Reply With Quote
  #3  
Old 10-29-2014, 12:11 PM
RELAX13 RELAX13 is offline
 
Join Date: Nov 2013
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good Id
Reply With Quote
  #4  
Old 10-31-2014, 01:42 AM
abdobasha2004's Avatar
abdobasha2004 abdobasha2004 is offline
 
Join Date: Aug 2008
Posts: 541
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice addition... Simple!
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:52 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.03894 seconds
  • Memory Usage 2,257KB
  • Queries Executed 18 (?)
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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (1)post_thanks_box_bit
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (2)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete