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> "; } } $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?
|