The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with is_member_of condition
I have a custom table setup called 'sellers' and I want to query that table to get all the userid's from there, then match it with the userid's in the vbulletin user table, then see if they're part of specific usergroups.
I figure the easiest option would be to get the sellers userid's and then use it in a loop with is_member_of but what would be the correct syntax? All I know is the basic: PHP Code:
|
#2
|
||||
|
||||
if (is_member_of($vbulletin->userinfo, 1, 2, 3))
{ do this } else { do that } |
#3
|
|||
|
|||
Sorry, that's not what I mean.
What I'm wondering is if I can use that and at the same time match it with the userid's from my sellers table. Something like this: PHP Code:
|
#4
|
|||
|
|||
$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:
[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... |
#5
|
|||
|
|||
Farcaster,
You're right, that would be a big loop to do, so I'll try a join and see what I can come up with. Thanks. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|