I duno if there is a vb function, but try something like this (did it real quick, may contain errors):
PHP Code:
// Get Buddy List
$buddylist = $vbulletin->db->query_first("
SELECT buddylist
FROM " . TABLE_PREFIX . "usertextfield
WHERE userid = '" . $userinfo['userid'] . "'
LIMIT 1
");
// Convert to List
$buddies = str_replace(" ", ",", $buddylist['buddylist']);
// Get Their Usernames
$getbuddies = $vbulletin->db->query_read("
SELECT username, userid
FROM " . TABLE_PREFIX . "user
WHERE userid IN(0" . $buddies . ")
ORDER BY username ASC
");
// Print out Each Buddy
while ($buddy = $vbulletin->db->fetch_array($getbuddies))
{
$buddycounter++;
$comma = ($buddycounter > 1) ? ", " : "";
echo $comma . '<a href="member.php?u=' . $buddy['userid'] . '">' . $buddy['username'] . '</a>';
}
change $userinfo['userid'] to the userid of the user you want to get.