1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Set default options to "watch this thread" and receive email notifications?

Discussion in 'XenForo Questions and Support' started by cmeinck, Oct 6, 2010.

  1. cmeinck

    cmeinck Well-Known Member

    Is it possible to pre-set users option defaults to "watch this thread" and "receive email notifications" checked?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't see any system for managing user prefs yet. But you can run this query to set those two checkboxes for all current users:

    Code:
    UPDATE xf_user_option
    SET default_watch_state = 'watch_email'
    
    I tested it and it appears to work. Backup first.
     
    Samet Chan, Simon and najaru like this.
  3. cmeinck

    cmeinck Well-Known Member

    Excellent, thanks Jake. Hopefully, that will make it in one of the updates.
     
  4. cedivad

    cedivad Active Member

    Use
    Code:
    UPDATE xf_user_option
    SET default_watch_state = 'watch_no_email'
    
    to disable the email notification.

    Any guess on how we can set this as default on newly registered members to (editing the mysql default don't work)?
     
    Jake Bunce likes this.
  5. Simon

    Simon Active Member

    Thanks for this, found it helpful. :)
     
  6. cedivad

    cedivad Active Member

    Also, this should work for new users:
    Code:
    	/**
    	 * Form to add a user.
    	 *
    	 * @return XenForo_ControllerResponse_Abstract
    	 */
    	public function actionAdd()
    	{
    		$user = array(
    			'user_id' => 0,
    			'timezone' => XenForo_Application::get('options')->guestTimeZone,
    			'user_group_id' => XenForo_Model_User::$defaultRegisteredGroupId,
    			'style_id' => 0,
    			'language_id' => XenForo_Application::get('options')->defaultLanguageId,
    			'user_state' => 'valid',
    			'content_show_signature' => 1,
    			'show_dob_year' => 1,
    			'show_dob_date' => 1,
    			'receive_admin_email' => 1,
    			'visible' => 1,
    			'allow_view_profile' => 'everyone',
    			'allow_post_profile' => 'everyone',
    			'allow_send_personal_conversation' => 'everyone',
    			'allow_view_identities' => 'everyone',
    			'allow_receive_news_feed' => 'everyone',
    			'default_watch_state'=> 'watch_no_email'
    		);
    
     
    Jake Bunce likes this.
  7. cedivad

    cedivad Active Member

    That don't work. I've edited frontController_register.php and addded a query do edit it "manually". That edit works, but only when you add users in the admincp. Or at least i suppose so.
     
  8. Paul M

    Paul M Well-Known Member

    Wouldnt the last line in your code above need to be

    'default_watch_state'=> 'watch_email'

    Rather than watch_no_email ?
     
  9. dieketzer

    dieketzer Well-Known Member

    anyone made any headway on this?
     
  10. dieketzer

    dieketzer Well-Known Member

    it appears there is no straight-forward way to do it then.
    looking at this template code i wonder what the function of 'value=1' is
    PHP:
    <label><input type="checkbox" name="default_watch_state" value="1" class="Disabler"
    {xen:checked $visitor.default_watch_state} /> {xen:phrase  automatically_watch_threads_you_create_or_when_you_reply}...</label>
     
  11. dieketzer

    dieketzer Well-Known Member

    it also defaults to displaying age?!?
    really need to work out a way to change default user options!
     
  12. TrevC

    TrevC Well-Known Member

    Hey guys, any updates? Is there a method to enable email notifications by default? (seems pretty important, IMO. Expected behavior the same as other forums).
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    It's done in the ACP for new members - Options -> User Registration: Watch threads when creating or replying

    For existing members you will need to run the query Jake posted.
    Code:
    UPDATE xf_user_option
    SET default_watch_state = 'watch_email'
     
    bibitbunga likes this.
  14. TrevC

    TrevC Well-Known Member

    Sorry to take up your time with this Brogan. Appreciate it. I just saw another thread with those exact details.
     

Share This Page