vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Add Friend Button (https://vborg.vbsupport.ru/showthread.php?t=257470)

Yellow Slider 01-26-2011 07:44 PM

Quote:

Originally Posted by wh1t3dr3am (Post 2154900)
Not Success :)
Edit :
1.Why if i has been add people still show image for add friend ?

2.why Image add friend show to post you create ?

sry,if i can't speak english very well :)
Thx :D

Because you are not considered a friend of a user until he officially accepts your friendship request.
This is the fix the first issue:
PHP Code:

if ($post['userid'] != $vbulletin->userinfo['userid'])
{
    
$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'] . '"><img src="YOUR IMAGE" alt="" border="0" /></a>';
    }



MichelangeloITA 01-26-2011 09:51 PM

Thank's man, you rock :D

wh1t3dr3am 01-28-2011 05:05 PM

Good Job,Success :D Thx for your advice :)
Awesome....

ja.halliburton 03-09-2012 02:09 AM

I put in ur code but all Im getting is a torn box without an image , do you know what else I must do?

Easy5s.net 05-11-2012 12:33 AM

Quote:

Originally Posted by Yellow Slider (Post 2153885)
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?

Lynne 05-11-2012 01:06 AM

See the API for the function here - http://members.vbulletin.com/api/

Quote:

Values for Option parameter:

.....

128 - Is the logged in User a friend of this person?


All times are GMT. The time now is 03:41 PM.

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.01080 seconds
  • Memory Usage 1,736KB
  • 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_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
  • (6)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