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']));
}