PDA

View Full Version : Mini Mods - Add friend button on postbit


fxdigi-cash
04-18-2014, 10:00 PM
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 : https://vborg.vbsupport.ru/showpost.php?p=2328242&postcount=15

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 (https://vborg.vbsupport.ru/member.php?u=157129) :up:

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:


$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:


.addimg{margin:-2px;}
.addfriend{position: absolute;right: 378px;}


save your template and check it out!!

ScreenShot:

https://vborg.vbsupport.ru/external/2014/04/25.jpg


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! :D

Good luck for all!!

fxdigi-cash
04-19-2014, 09:03 AM
RESERVED!!

gsmlover4u
04-19-2014, 04:00 PM
screen short ?

blind-eddie
04-19-2014, 04:04 PM
Here is a plugin.

https://vborg.vbsupport.ru/showthread.php?t=305246

fxdigi-cash
04-20-2014, 02:20 AM
screen short ?

https://vborg.vbsupport.ru/external/2014/04/25.jpg

here you are...

Good luck!! :)

fxdigi-cash
04-20-2014, 02:22 AM
Here is a plugin.

https://vborg.vbsupport.ru/showthread.php?t=305246

This mod doesn't work as I tried it on different vb4.x.x versions. This is why I posted this mod instead.

Thanks

mytreehouse
04-20-2014, 12:30 PM
Works great on 4.2.x. Although I removed the first slash in this line to show the actual image.

src="/images/site_icons/add.png">

fxdigi-cash
04-20-2014, 01:02 PM
Works great on 4.2.x. Although I removed the first slash in this line to show the actual image.

src="/images/site_icons/add.png">

Thanks for the correction @ mytreehouse

Great catch!!

:)

BirdOPrey5
07-01-2014, 09:28 AM
Note- at KH99's request I have moved a number of off-topic posts to this thread: https://vborg.vbsupport.ru/showthread.php?t=312598

Please consider starting separate threads if the issue is not immediately related to the mod in question.

fxdigi-cash
07-03-2014, 05:11 PM
sorry everyone, I was out for a while... got sick!!! :(

if anyone has an issue with this code, please don't hesitate to ask...

I see some issue was moved somewhere else :)

I'll check it right away!!

tbworld
07-03-2014, 07:07 PM
See your not suppose to get sick. :) Glad your better. :)

fxdigi-cash
07-04-2014, 09:33 AM
Thanks tbworld (https://vborg.vbsupport.ru/member.php?u=280492),

I was working for more than 27 hours without stop... only drinking coffee, and then went to bed and when woke up I got fever... :o

The doctor told me off not to do that again...!! so now only 10 hours a day.

wish you and all others great health :)

men2dope
07-05-2014, 01:04 AM
never-mind, problem solved.