private function onChange() { $form = $this->getForm(); if (false !== ($error = $form->validate($this->module))) { return $error; } $row = GWF_ForumOptions::getUserOptionsS(); $options = isset($_POST['hide_subscr']) ? GWF_ForumOptions::HIDE_SUBSCR : 0; $data = array('fopt_subscr' => $form->getVar('subscr'), 'fopt_options' => $options, 'fopt_signature' => $form->getVar('signature')); if (false === $row->saveVars($data)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } return $this->module->message('msg_options_changed'); }
public function canSubscribe() { $fopts = GWF_ForumOptions::getUserOptionsS(); if ($fopts->getVar('fopt_subscr') === GWF_ForumOptions::SUBSCRIBE_ALL) { return false; } if (GWF_ForumSubscrBoard::hasSubscribed(GWF_Session::getUserID(), $this->getID())) { return false; } return true; }