Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Friends and/or Buddies on Profile Details »»
Friends and/or Buddies on Profile
Version: 1.0.5, by jj jj is offline
Developer Last Online: Mar 2022 Show Printable Version Email this Page

Version: 3.5.5 Rating:
Released: 01-13-2006 Last Update: 03-12-2006 Installs: 270
Uses Plugins Template Edits
 
No support by the author.

WHAT's THIS
  • This product adds a public friends and/or buddy list in the profile.
  • What are friends? Friends means you are on each others buddylists. It is no seperate addition/addon. It's all based on vb's buddy system.
  • Need more info? Look at the attached screenshots, or the live demo(s).
  • Avatars/profilepics will not show up, if stored in filesystem!
  • Need some kind of informing the users, which have been added to a buddy list? Look at the AutoPM after addBuddy Plugin by Antivirus
  • The product adds 2 queries to the profile page


INSTALLATION


Install with product manager.


Set your preferences in the acp (vBulletin options)


Add
PHP Code:
$FNB_HTML 
somewhere in your MEMBERINFO template. Whereever you'd like to show up the friends or buddies. If you're not sure what to do, search for
Code:
<if condition="$show['signature']">
in your MEMBERINFO template and add it before that line.


OPTIONAL (User selectable)


If you want to have this user-selectable you need to add a custom profile field. Create the new field as a radiobutton, give it a name and description of your choice, the options yes and no and use the following code instead of only $FNB_HTML:

HTML Code:
<if condition="$userinfo[fieldXX] == yes">$FNB_HTML</if>
(if user wishes to show up)
or

HTML Code:
<if condition="$userinfo[fieldXX] != no">$FNB_HTML</if>
(show by default, user can deactivate it)

Remember to replace XX with the number of the new profilefield!


PLANNED FEATURES

  • Using Templates


LIVE DEMO(S)



CREDITS


Thx to Cloud-Warrior for inspiration and idea. If you want a seperate friends page, too, get the vBFriends extension by Cloud-Warrior.

vwturbo (for the idea of gettin profilepics instead of avatars),
gamebgs (limitting shown friends/buddies to a max number),
D|ver (hiding the information who you got in your buddy list and whohas added you to his buddy list),
yayvb (show a "no avatar" picture if no avatar is available),
ThorstenA (see changelog version 1.0.2)

Show Your Support

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

Comments
  #132  
Old 04-16-2006, 01:25 AM
jarcher's Avatar
jarcher jarcher is offline
 
Join Date: Mar 2005
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok. . .I am not getting any avatars in the profiles
I looked into the storage of them and I got:

Quote:
Images are currently being served from the database
looked for it in the manual. .
what am I looking for exactly

stumped, thats what I am. .
Reply With Quote
  #133  
Old 04-17-2006, 04:59 PM
Ragnarok's Avatar
Ragnarok Ragnarok is offline
 
Join Date: Dec 2005
Location: Canada
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've got an old, old version of the plugin, most likely the first release.

Anyway, I've done some heavy modifications to the plugin, and I've hit a wall. Not knowing a thing about the code I'm trying to edit, I basically snipped code until things broke, and then reverted. :P

I've got this:

PHP Code:
// Setup

$FFsetup = Array(

// these are the texts which are displayed

'friends' => $userinfo['username']."'s Friends",

// set these to TRUE or FALSE
// if you set fetch_avatar true you will get avatar picture, else you get profile picture if present

'show_counts' => false,
'fetch_avatar' => true

);

// End of setup

global $vbulletin;

$whichlist "buddylist";
$whichlistshort ereg_replace("list"""$whichlist);

// (Dis)Likes

$outcounter 0;
$outuserids = array();
$outuserids explode(' 'trim($userinfo[$whichlist]));
if (
trim($userinfo[$whichlist]) != "")


// (Dis)Liked By

$inoutcounter 0;
$incounter 0;
$inusersquery 
    
"SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
    "
.TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
    "
.TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
    FIND_IN_SET('"
.$userinfo[userid]."', REPLACE(".TABLE_PREFIX."usertextfield.".$whichlist.", ' ', ',')) > 0
    ORDER BY "
.TABLE_PREFIX."user.username";

$inusers mysql_query($inusersquery);
while (
$inuser mysql_fetch_array($inusers))
{
    
$incounter++;
    
// Bi-Directional (Dis)Like
    
if (in_array($inuser['userid'], $outuserids)) {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid'])

        
$outuserids2 explode(' 'trim($inuser[$whichlist]));
        
$inuserids2 = array();
        
$inuserids1 mysql_query("SELECT userid FROM ".TABLE_PREFIX."usertextfield WHERE
        FIND_IN_SET('"
.$inuser['userid']."', REPLACE(".$whichlist.", ' ', ',')) > 0");
        while (
$inuserid1 mysql_fetch_array($inuserids1))
        {
            
$inuserids2[] = $inuserid1[userid];
        }
        
$inoutuserids2 array_intersect($outuserids2$inuserids2);
        
$inoutcounter2 count($inoutuserids2);
        

            
$avatar_url fetch_avatar_url($inuser['userid']);
            
$FFpicture $avatar_url[0];
        
        if (
$FFpicture == ""$FFpicture "clear.gif";
        
    
    
$inoutuserlist .= "<td class=\"smallfont\" align=\"center\" width=\"100\">";
    
$inoutuserlist .= "<a style=\"text-decoration: none;\" href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "<img width=\"56px\" height=\"56px\" border=\"0px\" src=\"".$FFpicture."\"></a><br />";
    
$inoutuserlist .= "$inuser[username]'s...<br />";
    
$inoutuserlist .= "<a href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "Profile</a>|";
    
$inoutuserlist .= "<a href=\"".$vbulletin->options['bburl']."/friends.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "Friends</a>($inoutcounter2)";
    
$inoutuserlist .= "</td>";
    
$inoutcounter++;


    }
    else
    {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid'])
        {
            
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/profile.php?do=addlist&userlist=$whichlistshort&u=$inuser[userid]\">[+]</a>&nbsp;&nbsp;";
        }
    }
    
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>$inuser[username]</a>";
    
$inuserlist .= "<br>";
}

$FRIENDSFOES .= "<table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"$stylevar[cellspacing]\" border=\"0\" width=\"100%\" align=\"center\">";
$FRIENDSFOES .= "<tr>";
$FRIENDSFOES .= "<td class=\"tcat\" colspan=\"2\">".$FFsetup['friends'].( ($FFsetup['show_counts']) ? " (".$inoutcounter.")" "" )." </td>";
$FRIENDSFOES .= "</tr><tr>";
$FRIENDSFOES .= "<td class=\"alt1\" colspan=\"2\">";
$FRIENDSFOES .= "  <table>";
$FRIENDSFOES .= "  <tr>";
$FRIENDSFOES .= $inoutuserlist;
$FRIENDSFOES .= "  </tr>";
$FRIENDSFOES .= "  </table>";
$FRIENDSFOES .= "</tr></table>"
Now, when I view a member's profile, I get the following error:

Code:
Warning: array_intersect(): Argument #1 is not an array in /member.php(651) : eval()'d code on line 59
Oddly it works without problem when I view my own profile, but if I view any other member's, it breaks.

Also, I feel stupid asking this, but I don't know how to make a line break for it, so it breaks tables on smaller resolutions with larger numbers of friends. Would I be able to make it automatically break to the next line after it fills the first, rather than continuing on in the same line, breaking the tables?
Reply With Quote
  #134  
Old 04-18-2006, 02:39 PM
MorrisMcD's Avatar
MorrisMcD MorrisMcD is offline
 
Join Date: Nov 2003
Location: Cincinnati, Ohio
Posts: 415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get this when adding a user..

Quote:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in \profile.php(727) : eval()'d code on line 35
It works though other than having that error
Reply With Quote
  #135  
Old 04-18-2006, 02:43 PM
MorrisMcD's Avatar
MorrisMcD MorrisMcD is offline
 
Join Date: Nov 2003
Location: Cincinnati, Ohio
Posts: 415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MorrisMcD
I get this when adding a user..



It works though other than having that error
Actually Sorry.. Its because of this hack that its happening..

https://vborg.vbsupport.ru/showthrea...=104872&page=6
Reply With Quote
  #136  
Old 04-18-2006, 03:44 PM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

People like being part of a community or group and thats what forum sites are all about... and forum owners want to see the number of registered users grow on their sites.

Suggestion: At the bottom of the block that shows freinds avatars have a 'call to action' link that encourages and enables people to send an invite to friends to become a part of the community. When those people join they automatically get add to that persons friends list.
Reply With Quote
  #137  
Old 04-18-2006, 09:36 PM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another suggestion: Include a 'supporters mod' ie: allow people to support other's by writing a comment about them and give them a rating. Then underneath the freinds block list the last five comments that people have left (along with their avatar and rating) and below that do a 'this user supports' section showing the last 5 comments. At the end of the list include a link to show all of the comments.

I've seen this implimented really well on another site - I'll add a screenshot to this posting tomorrow.
Reply With Quote
  #138  
Old 04-19-2006, 10:28 AM
jj's Avatar
jj jj is offline
 
Join Date: Sep 2005
Location: Viernheim, Germany
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MorrisMcD
I get this when adding a user..

Quote:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in \profile.php(727) : eval()'d code on line 35
It works though other than having that error
I don't use the function array-merge() in my code, so it can't be my code

@criscokid: some nice suggestions, I'll write em down and wait for your screenshot
Reply With Quote
  #139  
Old 04-19-2006, 10:35 AM
jj's Avatar
jj jj is offline
 
Join Date: Sep 2005
Location: Viernheim, Germany
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ragnarok
I've got an old, old version of the plugin, most likely the first release.

Anyway, I've done some heavy modifications to the plugin, and I've hit a wall. Not knowing a thing about the code I'm trying to edit, I basically snipped code until things broke, and then reverted. :P

I've got this:

PHP Code:
// Setup

$FFsetup = Array(

// these are the texts which are displayed

'friends' => $userinfo['username']."'s Friends",

// set these to TRUE or FALSE
// if you set fetch_avatar true you will get avatar picture, else you get profile picture if present

'show_counts' => false,
'fetch_avatar' => true

);

// End of setup

global $vbulletin;

$whichlist "buddylist";
$whichlistshort ereg_replace("list"""$whichlist);

// (Dis)Likes

$outcounter 0;
$outuserids = array();
$outuserids explode(' 'trim($userinfo[$whichlist]));
if (
trim($userinfo[$whichlist]) != "")


// (Dis)Liked By

$inoutcounter 0;
$incounter 0;
$inusersquery 
    
"SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
    "
.TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
    "
.TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
    FIND_IN_SET('"
.$userinfo[userid]."', REPLACE(".TABLE_PREFIX."usertextfield.".$whichlist.", ' ', ',')) > 0
    ORDER BY "
.TABLE_PREFIX."user.username";

$inusers mysql_query($inusersquery);
while (
$inuser mysql_fetch_array($inusers))
{
    
$incounter++;
    
// Bi-Directional (Dis)Like
    
if (in_array($inuser['userid'], $outuserids)) {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid'])

        
$outuserids2 explode(' 'trim($inuser[$whichlist]));
        
$inuserids2 = array();
        
$inuserids1 mysql_query("SELECT userid FROM ".TABLE_PREFIX."usertextfield WHERE
        FIND_IN_SET('"
.$inuser['userid']."', REPLACE(".$whichlist.", ' ', ',')) > 0");
        while (
$inuserid1 mysql_fetch_array($inuserids1))
        {
            
$inuserids2[] = $inuserid1[userid];
        }
        
$inoutuserids2 array_intersect($outuserids2$inuserids2);
        
$inoutcounter2 count($inoutuserids2);
        

            
$avatar_url fetch_avatar_url($inuser['userid']);
            
$FFpicture $avatar_url[0];
        
        if (
$FFpicture == ""$FFpicture "clear.gif";
        
    
    
$inoutuserlist .= "<td class=\"smallfont\" align=\"center\" width=\"100\">";
    
$inoutuserlist .= "<a style=\"text-decoration: none;\" href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "<img width=\"56px\" height=\"56px\" border=\"0px\" src=\"".$FFpicture."\"></a><br />";
    
$inoutuserlist .= "$inuser[username]'s...<br />";
    
$inoutuserlist .= "<a href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "Profile</a>|";
    
$inoutuserlist .= "<a href=\"".$vbulletin->options['bburl']."/friends.php?u=$inuser[userid]\"/>";
    
$inoutuserlist .= "Friends</a>($inoutcounter2)";
    
$inoutuserlist .= "</td>";
    
$inoutcounter++;


    }
    else
    {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid'])
        {
            
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/profile.php?do=addlist&userlist=$whichlistshort&u=$inuser[userid]\">[+]</a>&nbsp;&nbsp;";
        }
    }
    
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>$inuser[username]</a>";
    
$inuserlist .= "<br>";
}

$FRIENDSFOES .= "<table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"$stylevar[cellspacing]\" border=\"0\" width=\"100%\" align=\"center\">";
$FRIENDSFOES .= "<tr>";
$FRIENDSFOES .= "<td class=\"tcat\" colspan=\"2\">".$FFsetup['friends'].( ($FFsetup['show_counts']) ? " (".$inoutcounter.")" "" )." </td>";
$FRIENDSFOES .= "</tr><tr>";
$FRIENDSFOES .= "<td class=\"alt1\" colspan=\"2\">";
$FRIENDSFOES .= "  <table>";
$FRIENDSFOES .= "  <tr>";
$FRIENDSFOES .= $inoutuserlist;
$FRIENDSFOES .= "  </tr>";
$FRIENDSFOES .= "  </table>";
$FRIENDSFOES .= "</tr></table>"
Now, when I view a member's profile, I get the following error:

Code:
Warning: array_intersect(): Argument #1 is not an array in /member.php(651) : eval()'d code on line 59
Oddly it works without problem when I view my own profile, but if I view any other member's, it breaks.

Also, I feel stupid asking this, but I don't know how to make a line break for it, so it breaks tables on smaller resolutions with larger numbers of friends. Would I be able to make it automatically break to the next line after it fills the first, rather than continuing on in the same line, breaking the tables?

You're using a very old version of the plugin, seems to be the first one I ever did. You should switch do the actual product/plugin which will give you some setup options in your acp. I really don't see your "heavy modification" there. Should be no problem for you to edit the current plugin to your needs.

You can't set the number of friends per row by resolutions. There's a setting in the acp options to limit the number, which is being used for any resolution.
Reply With Quote
  #140  
Old 04-19-2006, 10:37 AM
jj's Avatar
jj jj is offline
 
Join Date: Sep 2005
Location: Viernheim, Germany
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jarcher
ok. . .I am not getting any avatars in the profiles
I looked into the storage of them and I got:



looked for it in the manual. .
what am I looking for exactly

stumped, thats what I am. .
Hm? I'm working with database storage, too. And my avatars show up pretty nice. Maybe you've got some errors in your board setup?
Reply With Quote
  #141  
Old 04-19-2006, 11:37 AM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jj
@criscokid: some nice suggestions, I'll write em down and wait for your screenshot
Here's a thumbnail as promised.

Another suggestion: When you click on a person's profile link from the 'friends block', make the profile you want to view open in a new window.
Reply With Quote
Reply


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 09:17 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.08811 seconds
  • Memory Usage 2,422KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (2)bbcode_html
  • (3)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete