vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [SOLVED] Where are stored "Browsing Options" on database (https://vborg.vbsupport.ru/showthread.php?t=315229)

omardealo 11-04-2014 12:23 PM

[SOLVED] Where are stored "Browsing Options" on database
 
1 Attachment(s)
Hello ,

I Look for the table name that stores the Browsing Options values ​​inside database

and i ask is there a way to grant specific moderator authority to change/edit this option only "Receive Admin Emails?" for users Without the appearance of the rest of the other options .

thnx alot ,

omardealo 11-04-2014 02:34 PM

okay i found it , all options user stored on options filed on user table
now , how i can update only option Receive Admin Emails [adminemail] for specific user by php code ?

Lynne 11-04-2014 03:41 PM

What are you wanting to do this via a query and not the admincp?

kh99 11-04-2014 05:46 PM

Quote:

Originally Posted by omardealo (Post 2521273)
okay i found it , all options user stored on options filed on user table
now , how i can update only option Receive Admin Emails [adminemail] for specific user by php code ?

You could execute the query
Code:

UPDATE user SET options = options + 16 WHERE (NOT (options & 16)) AND userid = ID
to set it to Yes, and
Code:

UPDATE user SET options = options - 16 WHERE options & 16 AND userid=ID
to set it to No. Note that you must change ID to the actual userid in each case. I'm assuming you can write php to do those queries.


As Lynne says, this can be done from the admincp without writing php, but since you said in the first post that you want moderators to be able to do it without giving them permission to change any other settings, I'm guessing that you've decided to write your own code to allow them to do it.

omardealo 11-04-2014 07:54 PM

Quote:

Originally Posted by Lynne (Post 2521284)
What are you wanting to do this via a query and not the admincp?

Becouse , i want gave grant to specific moderator authority to change/edit this option only "Receive Admin Emails?" for users Without the appearance of the rest of the other options .

thnx ,

omardealo 11-07-2014 03:10 PM

Quote:

Originally Posted by kh99 (Post 2521308)
You could execute the query
Code:

UPDATE user SET options = options + 16 WHERE (NOT (options & 16)) AND userid = ID
to set it to Yes, and
Code:

UPDATE user SET options = options - 16 WHERE options & 16 AND userid=ID
to set it to No. Note that you must change ID to the actual userid in each case. I'm assuming you can write php to do those queries.


As Lynne says, this can be done from the admincp without writing php, but since you said in the first post that you want moderators to be able to do it without giving them permission to change any other settings, I'm guessing that you've decided to write your own code to allow them to do it.

thnx brother , yeah that's what i want to do
now everything is good
Thank you for your understanding of my request kh99

PHP Code:

if ($_REQUEST['do'] == 'editemailadmin'


        
$user $db->query_first("
            SELECT options
            FROM " 
TABLE_PREFIX "user
            WHERE userid = '" 
$_REQUEST['userid'] ."'
        "
);
        
$user array_merge($userconvert_bits_to_array($user['options'], $vbulletin->bf_misc_useroptions));
    

print_form_header('index','updateemailadmin',$vbphrase['receive_admin_emails']);
construct_hidden_code("userid",intval($_REQUEST['userid']));
print_cp_header($vbphrase['browsing_options']);
print_radio_row('This is a radio row''inputname', array( '1' => 'yes''0' => 'no' ) , $user['adminemail']);  
print_submit_row($vbphrase['save']);
}

if (
$_REQUEST['do'] =="updateemailadmin"

if (
$_REQUEST['inputname'] == 0)
{
$db->query_write("UPDATE " TABLE_PREFIX " user SET options = options - 16 WHERE options & 16 AND userid = ".$_REQUEST['userid']." ");
print_cp_message('DONE'"index.php?do=useradminemail");
}elseif (
$_REQUEST['inputname'] == 1)
{
$db->query_write("UPDATE " TABLE_PREFIX " user SET options = options + 16 WHERE (NOT (options & 16)) AND userid = ".$_REQUEST['userid']." ");
print_cp_message('DONE'"index.php?do=useradminemail");
}



iref2010 10-13-2015 05:50 AM

@all
@kh99;

How do i get the mapping of the user options fields, couldnt find anywhere online.
I want to enable "Receive Email from Other Users" for all the users by using sql query

This needs to be done so that people start receiving mention emails.

Lynne 10-14-2015 03:59 PM

According to this thread, it would be:

Code:

UPDATE user
SET options = options - 256
WHERE options & 256

Make sure you backup your database first before running this query!!!!! Better yet, test it on your test site first before doing it on the live site.


All times are GMT. The time now is 10:03 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
  • Page Generation 0.01171 seconds
  • Memory Usage 1,749KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_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