$checkBox = $this->_input->filterSingle('userBox', XenForo_Input::BOOLEAN);
if ($checkBox)
{
$messageId = XenForo_Application::get('options')->messageId;
$dw = XenForo_DataWriter::create('Test_DataWriter_Test');
$dw->set('user_id', 2);
$dw->set('username', 'hakdi');
$dw->save();
}
else
{
$dw = XenForo_DataWriter::create('Test_DataWriter_Test');
$dw->set('user_id', $visitor['user_id']);
$dw->set('username', $visitor['user_id'] > 0 ? $visitor['username'] : new XenForo_Phrase('guest'));
$dw->save();
}