$comment = new Comment($_POST['id']); $member_id = $comment->user_id; $video = new Video($comment->video_id); $url = $video->url; $name = "Comments: {$comment->comments}"; $type = 'Comment'; Plugin::Trigger('flag.ajax.flag_comment'); break; } // Verify user doesn't flag thier content if ($user->user_id == $member_id) { throw new Exception(Language::GetText('error_flag_own')); } // Verify Flag doesn't exist $data = array('type' => $_POST['type'], 'id' => $_POST['id'], 'user_id' => $user->user_id); if (Flag::Exist($data)) { throw new Exception(Language::GetText('error_flag_duplicate')); } Plugin::Trigger('flag.ajax.before_flag'); // Send admin alert if (Settings::Get('alerts_flags') == '1') { $subject = 'Content Flagged As Inappropriate'; $body = "One of your members flagged content as inappropriate. "; $body .= "Please review the content to verify it is valid. "; $body .= "You can login to the Admin Panel to dismiss the flag, or uphold it and ban the content."; $body .= "\n\n=======================================================\n"; $body .= "Content Type: {$type}\n"; $body .= "URL: {$url}\n"; $body .= "{$name}\n"; $body .= "======================================================="; Plugin::Trigger('flag.ajax.alert');