str_starts_with($m, "image/") || str_starts_with($m, "video/"); $fileAttachments = array_filter($attachments, fn(Attachment $a) => !$isImage($a->mimeType)); $imageAttachments = array_filter($attachments, fn(Attachment $a) => $isImage($a->mimeType)); $canReply = !$topic->isLocked && ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_POST) ?? false); $canEdit = ($GLOBALS["currentUser"]?->id === $postAuthor?->id && $postAuthor?->hasPermission(UserPermissions::EDIT_OWN_POST)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::EDIT_OTHER_POST)); $canEdit = $canEdit && !$topic->isLocked; $canDelete = ($GLOBALS["currentUser"]?->id === $postAuthor?->id && $postAuthor?->hasPermission(UserPermissions::DELETE_OWN_POST)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::DELETE_OTHER_POST)); $canViewAttachments = $GLOBALS["currentUser"] !== null; $hide_actions ??= false; $hide_pfp ??= false; $your_are_the_author = $GLOBALS["currentUser"]?->id === $postAuthor?->id; $is_op = $postAuthor?->id === $topicAuthor?->id && $postAuthor?->id !== null; ?> deleted): ?>