global $gid, $mybb, $db, $templates, $attachcache, $lang;
$lang->load("hideattachmentsuntilreply", false, true);
$haurgroups = explode(",",$mybb->settings['hideattachmentsuntilreply_groups']);
$haurwhite = explode(",",$mybb->settings['hideattachmentsuntilreply_white']);
if($mybb->settings['hideattachmentsuntilreply_enable'] == 1)
{
if(in_array($mybb->user['usergroup'], $haurgroups))
{
if(in_array($mybb->user['uid'], $haurwhite))
{
}
else
{
if(is_array($attachcache[$post['pid']]) && $mybb->user['uid'] != $post['uid'] && !is_moderator($post['fid']))
{
$query = $db->simple_select("posts", "pid", "tid = '".$post['tid']."' AND uid = '".$mybb->user['uid']."'");
if(!$db->num_rows($query) || $mybb->user['uid'] == 0)
{
eval("\$post['attachments'] = \"".$templates->get("hideattachmentsuntilreply")."\";");
}
}
}
}
else
{
}
}
}
Still needs some tidying up.