[3.2][RC] New User Default Settings

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
davye
Registered User
Posts: 20
Joined: Mon Aug 19, 2019 12:49 pm

Re: [3.2][RC] New User Default Settings

Post by davye » Tue Oct 08, 2019 8:54 pm

Your description is exactly the manifestation of the bug that I fixed on my system.
I don't know what david63 did to the file on github but it still has the bug

here is the complete fix before(commented code) and after (uncomment the print_r's and echo's to see how it works.

Code: Select all

    protected function set_options()
    {
        $this->config->set('ud_allow_massemail', $this->request->variable('ud_allow_massemail', 0));
        $this->config->set('ud_allow_pm', $this->request->variable('ud_allow_pm', 0));
        $this->config->set('ud_allow_viewemail', $this->request->variable('ud_allow_viewemail', 0));
        $this->config->set('ud_date_format', $this->request->variable('ud_date_format', ''));
        $this->config->set('ud_moderation_queue', $this->request->variable('ud_moderation_queue', 0));
        $this->config->set('ud_notify', $this->request->variable('ud_notify', ''));
        $this->config->set('ud_notify_pm', $this->request->variable('ud_notify_pm', ''));
        //echo "phpbb_optionset" . "<br />";
        //echo $this->config['ud_options'] . "<br />";

        // this was experiment - $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);

        //echo $keyoptions['attachsig'] . "<br />";
        //echo $this->request->variable('ud_sig', 0)."<br />";
        //echo $this->config['ud_options']."<br />";

        //$this->config->set('ud_options', phpbb_optionset(constants::ATTACHSIG, $this->request->variable('ud_sig', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::BBCODE, $this->request->variable('ud_bbcode', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::SMILIES, $this->request->variable('ud1_smilies', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWAVATARS, $this->request->variable('ud_avatars', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWCENSORS, $this->request->variable('ud_wordcensor', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWFLASH, $this->request->variable('ud_flash', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWIMG, $this->request->variable('ud_images', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWSIGS, $this->request->variable('ud_sigs', 0), $this->config['ud_options']));
        //$this->config->set('ud_options', phpbb_optionset(constants::VIEWSMILIES, $this->request->variable('ud_smilies', 0), $this->config['ud_options']));

        //print_r($udconstants);
        //print_r($this->request);
        //print_r($this->constants);

        $bitfield = $this->config['ud_options'];
        //echo decbin($bitfield) . "<br />";

        $bitfield = phpbb_optionset($this->constants['attachsig'], $this->request->variable('ud_sig', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['bbcode'], $this->request->variable('ud_bbcode', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['smilies'], $this->request->variable('ud1_smilies', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewavatars'], $this->request->variable('ud_avatars', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewcensors'], $this->request->variable('ud_wordcensor', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewflash'], $this->request->variable('ud_flash', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewimg'], $this->request->variable('ud_images', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewsigs'], $this->request->variable('ud_sigs', ''), $bitfield);
        $bitfield = phpbb_optionset($this->constants['viewsmilies'], $this->request->variable('ud_smilies', ''), $bitfield);
        $this->config->set('ud_options', $bitfield);

        //echo decbin($bitfield) . "<br />";

        $this->config->set('ud_post_sd', $this->request->variable('post_sd', 'a'));
        $this->config->set('ud_post_sk', $this->request->variable('post_sk', 't'));
        $this->config->set('ud_post_st', $this->request->variable('post_st', 0));
        $this->config->set('ud_topic_sd', $this->request->variable('topic_sd', 'd'));
        $this->config->set('ud_topic_sk', $this->request->variable('topic_sk', 't'));
        $this->config->set('ud_topic_st', $this->request->variable('topic_st', 0));
        $this->config->set('ud_type_bookmark', $this->request->variable('ud_type_bookmark', 0));
        $this->config->set('ud_type_group', $this->request->variable('ud_type_group', 0));
        $this->config->set('ud_type_needs_approval', $this->request->variable('ud_type_needs_approval', 0));
        $this->config->set('ud_type_pm', $this->request->variable('ud_type_pm', 0));
        $this->config->set('ud_type_post', $this->request->variable('ud_type_post', 1));
        $this->config->set('ud_type_quote', $this->request->variable('ud_type_quote', 0));
        $this->config->set('ud_type_report', $this->request->variable('ud_type_report', 0));
        $this->config->set('ud_type_topic', $this->request->variable('ud_type_topic', 1));

		$this->config->set('ud_type_subfor', $this->request->variable('ud_type_subfor', 1));

        //$this->config->set('ud_options', phpbb_optionset(constants::ATTACHSIG, $this->request->variable('ud_sig', 0), $this->config['ud_options']));

    }

urzh
Registered User
Posts: 126
Joined: Mon Aug 05, 2019 1:51 pm
Name: Robert

Re: [3.2][RC] New User Default Settings

Post by urzh » Tue Oct 08, 2019 11:20 pm

Thank you. I implemented and its working fine. But, this option: "Notify me when a reply is posted" is still not ticking when i draft a new post after I set it to yes: "Notify the user upon replies by default:" I purged cache

urzh
Registered User
Posts: 126
Joined: Mon Aug 05, 2019 1:51 pm
Name: Robert

Re: [3.2][RC] New User Default Settings

Post by urzh » Tue Oct 08, 2019 11:21 pm

Oh. I realized this is for NEW users. So anyone making new accounts will get the setting. Hmm ok.

User avatar
DavideBianchini
Registered User
Posts: 61
Joined: Thu Oct 17, 2019 3:47 am

Re: [3.2][RC] New User Default Settings

Post by DavideBianchini » Mon Oct 21, 2019 7:08 pm

Subscribing, hoping for an official fix soon...

User avatar
dingus33
Registered User
Posts: 125
Joined: Fri Sep 29, 2017 11:11 am

Re: [3.2][RC] New User Default Settings

Post by dingus33 » Thu Oct 24, 2019 10:13 pm

i'm hoping for an update too 🙏

Post Reply

Return to “Extensions in Development”