usetags)) { error('Tags are disabled!'); } if (isguestuser()) { print_error('noguest'); } if (!confirm_sesskey()) { print_error('sesskey'); } switch ($action) { case 'addinterest': $id = optional_param('id', 0, PARAM_INT); $name = optional_param('name', '', PARAM_TEXT); if (empty($name) && $id) { $name = tag_name($id); } tag_an_item('user',$USER->id, $name); if (!empty($name) && !$id) { $id = tag_id(tag_normalize($name)); } redirect($CFG->wwwroot.'/tag/index.php?id='.$id); break; case 'flaginappropriate': $id = required_param('id', PARAM_INT); tag_flag_inappropriate($id); redirect($CFG->wwwroot.'/tag/index.php?id='.$id, get_string('responsiblewillbenotified','tag')); break; } ?>