Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Add friend button on postbit Details »»
Add friend button on postbit
Version: 1.0, by fxdigi-cash fxdigi-cash is offline
Developer Last Online: Feb 2016 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.2.1 Rating:
Released: 04-18-2014 Last Update: Never Installs: 21
Uses Plugins
 
No support by the author.

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:




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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-19-2014, 09:03 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RESERVED!!
Reply With Quote
  #3  
Old 04-19-2014, 04:00 PM
gsmlover4u's Avatar
gsmlover4u gsmlover4u is offline
 
Join Date: Jan 2007
Posts: 348
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screen short ?
Reply With Quote
  #4  
Old 04-19-2014, 04:04 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is a plugin.

https://vborg.vbsupport.ru/showthread.php?t=305246
Reply With Quote
  #5  
Old 04-20-2014, 02:20 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gsmlover4u View Post
screen short ?


here you are...

Good luck!!
Reply With Quote
Благодарность от:
gsmlover4u
  #6  
Old 04-20-2014, 02:22 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blind-eddie View Post
This mod doesn't work as I tried it on different vb4.x.x versions. This is why I posted this mod instead.

Thanks
Reply With Quote
  #7  
Old 04-20-2014, 12:30 PM
mytreehouse's Avatar
mytreehouse mytreehouse is offline
 
Join Date: Apr 2013
Location: Europe
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">
Reply With Quote
Благодарность от:
fxdigi-cash
  #8  
Old 04-20-2014, 01:02 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mytreehouse View Post
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!!

Reply With Quote
  #9  
Old 07-01-2014, 09:28 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 07-03-2014, 05:11 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!!
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 03:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04596 seconds
  • Memory Usage 2,320KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete