vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What field/table has the values for "Receive Email From Administartors" (https://vborg.vbsupport.ru/showthread.php?t=159362)

dynamot 10-03-2007 10:35 AM

What field/table has the values for "Receive Email From Administartors"
 
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 12: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):
Code:

UPDATE user SET options = options + 16 WHERE NOT (options & 16) AND userid = X LIMIT 1
And this would turn it off:
Code:

UPDATE user SET options = options - 16 WHERE (options & 16) AND  userid = X LIMIT 1

dynamot 10-03-2007 02: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 03:34 PM

You're welcome :)

Those options are a bitfield, so it can store many options in a single int field in the database.

Code:

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 03: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 04:29 PM

I think it's just a Unix timestamp. Try this
Code:

date('m/d/Y', $joindate);

dynamot 10-04-2007 10:59 AM

Thats works for me. Tx Analogpoint ...

Analogpoint 10-04-2007 02:26 PM

You're welcome.


All times are GMT. The time now is 11:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02794 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete