Back to vBulletin 4.x Template Modifications

Adding Facebook/Facebook Messenger as a Communication Option
Mod Version: 1.00, by scottkoz20

vB Version: 4.2.x Rating: (0 vote - 0 average) Installs: 3
Released: 04 Mar 2018 Last Update: Never Downloads: 0
Not Supported Uses Plugins Template Edits Additional Files Re-usable Code Translations Is in Beta Stage  

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

Download

No files for download.

Supporters / CoAuthors

  • MarkFL

Screenshots

Click image for larger version
Name:	memberaction_dropdown.PNG
Views:	71
Size:	8.1 KB
ID:	156967  

Similar Mods

Lilis Pizza Pizza Messenger (PopUp Messenger) vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024