SQL query to set certain options

Jake Bunce

XenForo moderator
Staff member
#3
For the default watch state:

Code:
UPDATE xf_user_option
SET default_watch_state = 'watch_email';
Or:

Code:
UPDATE xf_user_option
SET default_watch_state = 'watch_no_email';
Depending on if you want emails too. Note that this preference is not retroactive to existing threads.

For the rich editor:

Code:
UPDATE xf_user_option
SET enable_rte = 1;
For showing signatures:

Code:
UPDATE xf_user_option
SET content_show_signature = 1;
For online status:

Code:
UPDATE xf_user
SET visible = 1;
You can set the default prefs for new users here:

Admin CP -> Home -> Options -> User Registration -> Default Registration Values
 

fredrikse

Active member
#5
Jake, you're the man! :)

Thanks a lot for your help. This was exactly what I was looking for. This weekend I'm about to migrate my vBulletin forum and my intention is to set a few of these values for all members and then hide them to prevent them from being altered again. Some of these options might come back later on in a different membership package.
 
#6
I just discovered a problem. When I use TMS to control the visibility of certain settings with permission groups it also effects what information is being stored in the database. Those settings that are not visible when I save a visible setting, is not getting stored. How can I handle this?
 

Jake Bunce

XenForo moderator
Staff member
#7
You probably want to turn those fields into hidden input fields so their values are still present in the form:

Rich (BB code):
<input type="hidden" name="fieldname" value="value" />
 
#8
That did it!
Rich (BB code):
<input type="hidden" name="fieldname" value="value" />
I also added this code to prevent these hidden fields from being active when a user is member of a group that will allow these options to be set:
Code:
en:if is="!{xen:helper ismemberof, $visitor, 12}">
<input type="hidden" name="allow_view_profile" value="members" />
<input type="hidden" name="allow_post_profile" value="members" />
<input type="hidden" name="allow_receive_news_feed" value="members" />
<input type="hidden" name="allow_send_personal_conversation" value="members" />
<input type="hidden" name="allow_view_identities" value="members" />
</xen:if>
 
Top