This hack will fully override the basic permissions. So if a usergroup is set to always moderate, it won't be moderated if you also upload a non-moderated attachment............i think
i think the following would be better:
PHP Code:
$visible = iif($moderate, 0, 1);
if ($visible)
{
$attachment_name2 = strtolower($attachment_name);
$extension = file_extension($attachment_name2);
$moderatethisattachments = array(
'pdf',
'txt',
'doc',
'xls'
);
if(in_array($extension, $moderatethisattachments)) {
$visible = '0';
}
}