This topic was marked solved by its starter, on June 28th, 2013, 09:07 PM

Nao

  • Dadman with a boy
  • Posts: 16,082
Strange buddy list error...
« on June 3rd, 2013, 09:17 AM »
Subs-Members.php, member removal code:

Code: [Select]
while ($row = wesql::fetch_assoc($request))
wesql::query('
UPDATE {db_prefix}members
SET
pm_ignore_list = {string:pm_ignore_list},
buddy_list = {string:buddy_list}
WHERE id_member = {int:id_member}',
array(
'id_member' => $row['id_member'],
'pm_ignore_list' => implode(',', array_diff(explode(',', $row['pm_ignore_list']), $users)),
'buddy_list' => implode(',', array_diff(explode(',', $row['buddy_list']), $users)),
)
);
wesql::free_result($request);

Profile-Modify.php, buddy removal code:

Code: [Select]
foreach ($buddiesArray as $key => $buddy)
if ($buddy == (int) $_GET['remove'])
unset($buddiesArray[$key]);

// Make the changes.
$user_profile[$memID]['buddy_list'] = implode(',', $buddiesArray);
updateMemberData($memID, array('buddy_list' => $user_profile[$memID]['buddy_list']));

Btoh seem alright to me... And I can't think of another place, that could remove buddies.
Problem is, live627 has this string in the member table for buddy list: ',xxx' (where x is the only buddy he has. Don't remember the number, don't wanna know..!!)

Where does the extra comma come from..?
John, do you remember removing a buddy from your list? Or adding someone to the list that's not in your current list..?
This causes any visit to your PM area, to trigger an error in the log, which is really odd. (Well, it's due to getContactList, but you know what I mean.)

I could do a 'quick fix' by forcing an array_filter() on $users at loadMemberData time, but to me it's a cop-out, and I'd instead like to ensure this doesn't happen any longer, eh...

PS: this won't last, anyway... Once I'm done with contact lists, all buddy code will be removed, so... It's just for my peace of mind, I guess..!!!

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Strange buddy list error...
« Reply #1, on June 4th, 2013, 07:55 AM »
No tag? Booo...
Quote
Where does the extra comma come from..?
Buggy code that's not in Wedge.
Quote
John, do you remember removing a buddy from your list?
No. +1, -0
Quote
Or adding someone to the list that's not in your current list..?
Hmm... contacts and buddies are different? You lost me here...
Quote
I could do a 'quick fix' by ...
Don't. This error isn't on account of Wedge.

Way back when this site was a sub-Noisen[1], I added a friend.

Noisen uses Ultimate Profile..

That mod has a ghosting problem, which results in a comma prefixed to the db field.
 1. See what I did there? :P
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Strange buddy list error...
« Reply #2, on June 12th, 2013, 10:35 AM »
Quote from live627 on June 4th, 2013, 07:55 AM
Way back when this site was a sub-Noisen[1], I added a friend.

Noisen uses Ultimate Profile..

That mod has a ghosting problem, which results in a comma prefixed to the db field.
 1. See what I did there? :P
BTW, thanks for figuring that out... ;)