Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
Adding Facebook/Facebook Messenger as a Communication Option Details »»
Adding Facebook/Facebook Messenger as a Communication Option
Version: 1.00, by scottkoz20 scottkoz20 is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.2.x Rating:
Released: 03-02-2018 Last Update: Never Installs: 3
Uses Plugins Template Edits
Re-useable Code Additional Files Translations Is in Beta Stage  
No support by the author.

With my forum being a Trading and Buy/Sell Forum, communication is a key and vital for members making deals. This hack is really opening up another mode of communication to allowing my members to communicate.

The hack is adding Facebook Messenger as a communication option to your forum.

NOTE: This does require your members to have a Facebook Account and is using Messenger.

The steps are fairly straight forward, but does require some template and profile hacks as well as image uploads.

1) Download the images and upload them to your forums images/misc directory

1 - Messenger Icon -


2) Need to add a Profile Fields (Admincp->User Profile Fields->Add New User Profile Field)
Note - I added a Profile Group Called PayPal

Field 1 - Facebook/Messager
Name - Facebook/Facebook Messenger
Description - Add your Facebook (Messenger) username to add on your profile
Field Required - No
Editable - Yes
Private, Searchable, Show on Memberlist - No
Rest leave as default (unless you wish to set this)

Make sure that you jot down the field ID numbers!


There are 2 options that you can use to enable this hack.

Option 1 - User Postbit
Go to Styles & templates->Style Manager->Edit Template of the Style you wish to change

Find the postbit or postbit_legacy template (depends which one you are using for your forum) - Doubleclick to Edit
Note - I used postbit_legacy but this should be the same for postbit

Find the following

Code:
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
and below, add the following

Code:
<!-- Facebook/Messenger-->
<br />
<div align="Left">
<vb:if condition="$post['fieldXX']"><a href="https://m.me/{vb:raw post.fieldXX}" target="_blank"><img src="IMAGE FOLDER/messenger.png" alt="Contact {vb:raw post.fieldXX} on Messenger" border="" /></a></vb:if>
</div>
<br />
<!--Facebook/Messenger-->
Note - Make sure you replace the XX's in the fieldXX with your fieldid from the Profile Field setup

Could look as such this when applied



FYI - You can use the same type of structure to add other items like Twitter, Facebook, etc...


Test!


Option 2 - Member Action Dropdown

For this option there are 2 ways you can do this

1) Template Hack
2) Plug-in

You don't need both - either one should work

Template Hack

Go to Styles & templates->Style Manager->Edit Template of the Style you wish to change

Find the memberaction_dropdown - Doubleclick to Edit

Find the following

Code:
				
{vb:rawphrase send_email}
			</a>
		</li>
		</vb:if>
and below the Ending IF, add the following

Code:
<vb:if condition="$memberinfo['fieldXX']">
		<li class="left">
			<a href="https://m.me/{vb:raw memberinfo.fieldXX}" target="_blank" class="siteicon_profile">
				Contact me on FB<BR>Messenger
			</a>
		</li>
</vb:if>
When applied, your members will see the following




Plug-in
Thanks to MarkFL for this. If you choose to you a plug-in, this is the code that would need to be added.

Create a plugin hooked at "memberaction_dropdown" with the PHP code:

Code:
if ($memberinfo['fieldxx'])
{
    $template_hook['memberaction_dropdown_items'] .= '<li class="left">
            <a href="https://m.me/' . $memberinfo['fieldxx'] . '" target="_blank" class="siteicon_profile">
                Contact me on FB <BR> Messenger
            </a>
        </li>';
}
Again, you only need to use 1 of the 2 methods to tie this into the Memberaction_dropdown.


Again, Test


Lastly, alert your members to the change and bask in the praise of your genius (in your members eyes )


Notes -
1st release on 3 March 2018

Screenshots

File Type: png memberaction_dropdown.PNG (8.1 KB, 0 views)

Supporters / CoAuthors

Show Your Support

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

Comments
  #2  
Old 03-03-2018, 09:51 PM
scottkoz20 scottkoz20 is offline
 
Join Date: Dec 2015
Location: Lewiston, NY
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved

AS a point of note - on the Profile fields, you COULD separate Facebook from Facebook Messenger if you decide this is the best route for your site, you would need to get a Facebook Icon and upload it to your Image folder of your choice.
Reply With Quote
  #3  
Old 07-05-2022, 07:05 PM
MentorBR MentorBR is offline
 
Join Date: Jul 2019
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to do it through whatsapp instead of Facebook Messenger?
Reply With Quote
Reply

Thread Tools

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 11:55 AM.


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.03685 seconds
  • Memory Usage 2,236KB
  • 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
  • (3)post_thanks_box
  • (2)post_thanks_box_bit
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (1)postbit_attachment
  • (3)postbit_onlinestatus
  • (3)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