The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
how do you get the usergroups of a particular userid?
I'm doing a cron job and want to process something based on the usergroups of a user.
example: If userid belongs to usergroup 10, or 15, or 20 do this end if The cron job calls vbulletin's global file, so instead of me running extra queries and writing my own functions, does vb has something build-in? I know you can pass an array of usergroups IDs to a function and will return true if user belongs to the any of the groups in the array, but I think that only works for the current user only. Since I running a cron job I'm going to have to pass the userid and the usergroups IDs into the function. Does vb have a function like this? thanks! |
#2
|
|||
|
|||
Where are you getting the userids you're processing? If you're doing a query for them, you might be able to add in the usergroupids and membergroupids fields from the user table. If you aren't doing the query for the userid, then you'll have to do one yourself. Then you might be able to use is_member_of() (which maybe is the function you were talking about), and pass it a $userinfo array (which has to contain userid, usergroupid, and membergroupid).
|
#3
|
|||
|
|||
I ended up using the fetch_userinfo(), then I passed it through the function you mentioned above. Thanks kh99.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|