Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 11-04-2014, 12:23 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [SOLVED] Where are stored "Browsing Options" on database

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 ,
Attached Images
File Type: png 2014-11-04_16-10-40.png (90.7 KB, 0 views)
Reply With Quote
  #2  
Old 11-04-2014, 02:34 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #3  
Old 11-04-2014, 03:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What are you wanting to do this via a query and not the admincp?
Reply With Quote
Благодарность от:
omardealo
  #4  
Old 11-04-2014, 05:46 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by omardealo View Post
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.
Reply With Quote
Благодарность от:
tbworld
  #5  
Old 11-04-2014, 07:54 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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 ,
Reply With Quote
  #6  
Old 11-07-2014, 03:10 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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");
}

Reply With Quote
2 благодарности(ей) от:
kh99, Lynne
  #7  
Old 10-13-2015, 05:50 AM
iref2010 iref2010 is offline
 
Join Date: Jun 2010
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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.
Reply With Quote
  #8  
Old 10-14-2015, 03:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04276 seconds
  • Memory Usage 2,275KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (4)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete