I was given a snippet in this thread: #226423: PHP snippets that worked with BL don't seem to with BL2

but the "WHERE received=0" is breaking it. Why should that be in there? All my buddylist entries in the buddylist table in my DB have "received=1". I looked through the code and there seems to be something about integration with privatemsg module.

I am heavily using tpl templates so don't get to see the default user/x page - maybe some "accept" link is put onto that page which turns 1 to 0 in the "received" column.

Comments

criz’s picture

I had a quick look and I also think that "WHERE received=0" isn't right. Why don't you use a snippet like the following (not tested, but this would be more future proof I think). By the way buddy_api_get_buddies() is not using this received-column too...

<?php
$buddies = buddy_api_get_buddies($user->uid);
$number_of_buddies = count($buddies);

?>
nodestroy’s picture

primary this column is in buddylist2 because it was in buddylist (db backward compatibility)
in buddylist table, all entries should have received = 1

nodestroy’s picture

Status: Active » Closed (fixed)