public static function add_comment($module_id, $id_in_module, $topic_identifier, $topic_path, $message, $pseudo = '') { if (!CommentsTopicDAO::topic_exists($module_id, $id_in_module, $topic_identifier)) { $id_topic = CommentsTopicDAO::create_topic($module_id, $id_in_module, $topic_identifier, $topic_path); } else { $id_topic = CommentsTopicDAO::get_id_topic_module($module_id, $id_in_module, $topic_identifier); } if (self::$user->check_level(User::MEMBER_LEVEL)) { $id_comment = CommentsDAO::add_comment($id_topic, $message, self::$user->get_id(), self::$user->get_display_name(), AppContext::get_request()->get_ip_address()); } else { $id_comment = CommentsDAO::add_comment($id_topic, $message, self::$user->get_id(), $pseudo, AppContext::get_request()->get_ip_address()); } CommentsTopicDAO::incremente_number_comments_topic($id_topic); self::regenerate_cache(); return $id_comment; }