vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Friends and/or Buddies on Profile (https://vborg.vbsupport.ru/showthread.php?t=105302)

jarcher 04-16-2006 01:25 AM

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

Ragnarok 04-17-2006 04:59 PM

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?

MorrisMcD 04-18-2006 02:39 PM

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

MorrisMcD 04-18-2006 02:43 PM

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

criscokid 04-18-2006 03:44 PM

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.

criscokid 04-18-2006 09:36 PM

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.

jj 04-19-2006 10:28 AM

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

jj 04-19-2006 10:35 AM

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.

jj 04-19-2006 10:37 AM

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?

criscokid 04-19-2006 11:37 AM

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.


All times are GMT. The time now is 05:30 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.01508 seconds
  • Memory Usage 1,876KB
  • 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
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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