vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   "Receive Email from Administrators": Which members have set this to "no"? (https://vborg.vbsupport.ru/showthread.php?t=293542)

licensinglinks 01-03-2013 06:46 AM

"Receive Email from Administrators": Which members have set this to "no"?
 
Is there a way of getting a list of usernames who have set it to "no"?

Similarly I would like to know who has selected "Don't receive Email Notification of new Private Messages"

Thanks.

--------------- Added [DATE]1357252509[/DATE] at [TIME]1357252509[/TIME] ---------------

anyone any thoughts?

licensinglinks 01-04-2013 12:49 PM

anyone got any ideas?

snakes1100 01-04-2013 12:51 PM

You would have to create a custom script or use a query directly thru mysql or phpmyadmin.

licensinglinks 01-04-2013 01:12 PM

Yes I know that. Does anyone know what query I would need to run in phpmyadmin?

Brandon Sheley 01-04-2013 02:27 PM

I'd check the user table and see what field that is, then something like
select * from user where admin_emails = no

Simon Lloyd 01-04-2013 03:02 PM

You'd need to know which option in the user table is for recieve admin emails and then get the matches like this
PHP Code:

SELECT 
FROM `user`
WHERE substr(`options`, 51) = '1' 

So this one says show all the people who have the option set for 1 at position 5 in the string of options, so maybe in phpmyadmin the options column looks like 432516780 as you can see in this example position 5 shows 1 so it would be a match.

I dont know what the criteria is for creating the options list or how they arrive at the figures, if i did i could help further :)

--------------- Added [DATE]1357315487[/DATE] at [TIME]1357315487[/TIME] ---------------

Quote:

Originally Posted by Brandon Sheley (Post 2394658)
I'd check the user table and see what field that is, then something like
select * from user where admin_emails = no

Unfortunately that column doesn't exist :(

kh99 01-04-2013 03:19 PM

It would be:
Code:

SELECT username FROM user WHERE options & 16 = 0

Simon Lloyd 01-04-2013 03:27 PM

Hi Kevin could you possibly explain the & 16 =0 obviously it works but i don't know why? :)

kh99 01-04-2013 03:39 PM

It's kind of like what you said, only for your method to work the value would have to be a string, with the number represented in binary. The & operator is kind of like treating an integer field as if it were a binary string, and checking only one character out of it. '&' means 'bitwise and', and 16 is 10000 in binary, so it's checking the 5th bit from the right. When you '&' the values, you'll get either 16 or 0, depending on whether or not that bit is set, so then you just have check for whether or not the result is 0.

I hope that makes some sense. Maybe this is better: http://en.wikipedia.org/wiki/Mask_%28computing%29

Simon Lloyd 01-04-2013 03:44 PM

It makes perfect sense, i had the right idea but just not the skill to execute it properly! - thanks for the explanation and it's something i'll add to my toolchest for future :)


All times are GMT. The time now is 06:50 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.01121 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete