$vbulletin->userinfo contains an array of variables for the user who is viewing the page. Instead, you would need to create a userinfo array for your seller. You
could do this by using the fetch_userinfo function (included in functions.php). Example:
PHP Code:
// this is going to add a query for every time you loop through.. not very good.
$seller_userinfo = fetch_userinfo($row['seller_userid']);
if (!is_member_of($seller_userinfo, 1, 2, 3)) {
// Do this if the seller is not in group 1, 2, or 3
} else {
// Do this if the seller IS in group 1, 2, 3
}
Personally though, I would not want to use this implementation because every loop through is going to require an additional query to get the sellers account information. Instead, I'd probably just join to the user table on the seller ID and use a WHERE clause like this:
[sql]WHERE (user.usergroupid IN (1,2,3) OR user.membergroupids IN (1,2,3))[/sql]
You could also use that in a CASE statement in the SQL Query if you want to assign a particular value to a field that your program would read. Like this:
[sql]CASE WHEN (user.usergroupid IN (1,2,3) OR user.membergroupids IN (1,2,3))
THEN 1 ELSE 0 END) AS valid_seller[/sql]
Hope that helps...