Back to vBulletin 4.x Add-ons

Add friend button on postbit
Mod Version: 1.0, by fxdigi-cash

vB Version: 4.2.1 Rating: (4 votes - 5.00 average) Installs: 21
Released: 19 Apr 2014 Last Update: Never Downloads: 1
Not Supported Uses Plugins  

Intro:
just to give a quick summery about this mod. This is a plugin that can show add friend button in the post where users can take advantage of requesting friendships with other users without going to their profile pages.

I found most of the code in here :

Spoiler (click to open)


Quote by Yellow Slider
Create a new plugin using the hook location postbit_display_complete.

PHP Code:
$postuserinfo fetch_userinfo($post['userid'], 128);
$isfriend $postuserinfo['isfriend'];
if (!
$isfriend)
{
    
$template_hook['postbit_userinfo_right'] .= '<a href="profile.php? ' $vbulletin->session->vars['sessionurl'] . 'do=addlist&amp;userlist=friend&amp;u=' $post['userid'] . '">' construct_phrase($vbphrase['befriend_x'], $post['username']) . '</a>';

$postuserinfo = fetch_userinfo($post['userid'], 128); 128 what is?

Close


so it is not actually mine, but was trying around how to make a use of it. The main Thanks goes to the coder: Yellow Slider

installation:

1- create a new plugin in your Adin cp by going to Plugins & Products --> add new plugin

2- use the following settings:

Product ---> vbulletin
Hook Location --> postbit_displate_complete
Title ---> "write your own words or whatsoever you like"
Execution Order --> 5
Plugin PHP Code --> insert the following code there:

PHP Code:
$postuserinfo fetch_userinfo($post['userid'], 128);
$isfriend $postuserinfo['isfriend'];
if (!
$isfriend)
{
    
$template_hook['postbit_controls'] .= '<span class="addfriend"><a href="profile.php? ' $vbulletin->session->vars['sessionurl'] . 'do=addlist&amp;userlist=friend&amp;u=' $post['userid'] . '">' construct_phrase($vbphrase['add_as_friend'], $post['username']) . '<img class="addimg" alt="Add as Friend" src="images/site_icons/add.png"></a></span>';

save the work and you will see that add friend text has shown up in your postbit...

now you just need to add css to your additional.css:

PHP Code:
.addimg{margin:-2px;}
.
addfriend{positionabsolute;right378px;} 
save your template and check it out!!

ScreenShot:



Known Bugs:

The only issue with this plugin is that the button shows up to the logged in user as well in his own post which shouldn't. Instead, it is supposed to be hidden. if a fix is found, I will post it here.

Please mark this mod as installed if you used it

Nominate MOTM if you LOVE it!

Good luck for all!!

Download

No files for download.

Similar Mods

Show Thread Enhancements Email to Friend, Print Version, Subscribe Thread in Postbit/Postbit Legacy vBulletin 3.8 Template Modifications

vblts.ru supports vBulletin®, 2022-2024