vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Add friend button on postbit (https://vborg.vbsupport.ru/showthread.php?t=310611)

fxdigi-cash 04-18-2014 10:00 PM

Add friend button on postbit
 
1 Attachment(s)
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....2&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 :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:

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:

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

Quote:

Originally Posted by gsmlover4u (Post 2493837)
screen short ?

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

here you are...

Good luck!! :)

fxdigi-cash 04-20-2014 02:22 AM

Quote:

Originally Posted by blind-eddie (Post 2493840)

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.

Code:

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

fxdigi-cash 04-20-2014 01:02 PM

Quote:

Originally Posted by mytreehouse (Post 2493933)
Works great on 4.2.x. Although I removed the first slash in this line to show the actual image.

Code:

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


All times are GMT. The time now is 02:41 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.03804 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete