![]() |
How to decode user options
Hello,
I would like to use my forum for mailing list purposes too, and I want to send emails only to the members that have the "Receive emails" option enabled. I looked on the vbulletin 3 database, and I saw that the user options preferences are coded with a number, so it's quite difficult to see which number represents the desire to receive emails... Can anyone help me "decoding" the number? Thanks ;) |
The user options are just a bitfield.
From init.php PHP Code:
So if you want to get all users which have this options enabled;: [sql]SELECT username, email FROM user WHERE options & 16[/sql] |
Quote:
It works fine :D |
Hi guys, I'm not familiar with bitfields... There's a way to set the bit #16 to 0 with just a mysql query?
Thanks ;) |
Yes. Bit #16 = 2^15 = 32768
[sql]UPDATE table SET field=field-32768 WHERE field & 32768[/sql] Or to set it where it is not set [sql]UPDATE table SET field=field+32768 WHERE NOT (field & 32768)[/sql] |
Except, I think he means the bit valued at 16, not the 16th bit . In the above options case the value should be 16. :)
|
But he said bit #16 ;)
|
Quote:
|
Quote:
or where could I find more info? google doesn't help :( |
Correct me if I'm wrong - but you want to set the 'adminemail' option (which is bit 5, value 16) to zero ?
|
All times are GMT. The time now is 03:10 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|