View Full Version : What field/table has the values for "Receive Email From Administartors"
dynamot
10-03-2007, 11:35 AM
Hi All,
What field and table stores the value "Receive Email from Administrators" in the vbulletin database?
I tried looking at the user table, there was one field called "autosubscribe". I am not sure if thats the one
Tx in advance
Analogpoint
10-03-2007, 01:29 PM
It's in the options field of the user table.
To turn it on (where X is the user id that you want to change):
UPDATE user SET options = options + 16 WHERE NOT (options & 16) AND userid = X LIMIT 1
And this would turn it off:
UPDATE user SET options = options - 16 WHERE (options & 16) AND userid = X LIMIT 1
dynamot
10-03-2007, 03:08 PM
Hi analogpoint,
Tx for helping me out the last couple of days.
Why are you doing (options + 16)
When I fired a query on the database, the options field show me a 4 digit number. Like 3143, 3159. Is there a reference table that has a desc for these numeric values?
My goal is to fire a query that will show me the number of users who have "checked" or "Not Checked" the option for "Receive Email from Administrators" during a registration process.
tx
Analogpoint
10-03-2007, 04:34 PM
You're welcome :)
Those options are a bitfield, so it can store many options in a single int field in the database.
SELECT userid, username, IF(options & 16, 1, 0) as acceptsadminemail FROM `user`
That will list all your users and acceptsadminemail will be 1 or 0 depending on if they accept admin emails or not.
dynamot
10-03-2007, 04:59 PM
Thats awesome. Tx so much.
One last question.
joindate. I see it stored as something like this "1186389780"
What is this date format and how I can I see its as say "mm/dd/yyyy"
I tried firing a sql statement like this:
Select
DATE_FORMAT(joindate, '%M %e, %Y, %l:%i%p') as joindate, email, username, password, birthday, IF(options & 16, 1, 0) as acceptsadminemail from user
But the join date returns as null
What am I doing wrong?
Analogpoint
10-03-2007, 05:29 PM
I think it's just a Unix timestamp. Try this date('m/d/Y', $joindate);
dynamot
10-04-2007, 11:59 AM
Thats works for me. Tx Analogpoint ...
Analogpoint
10-04-2007, 03:26 PM
You're welcome.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.