Does anyone know how to make it so that an attachment is mandatory? Or at least if there is no attachment then put something in the custom output saying so?
Quote:
Originally Posted by bananalive
Form Hook: Before Submit:
PHP Code:
if (empty($postattach))
{
$currentattaches = $db->query_read("
SELECT dateline, filename, attachmentid
FROM " . TABLE_PREFIX . "attachment
WHERE posthash = '" . $db->escape_string($posthash) . "'
AND userid = " . $vbulletin->userinfo['userid']
);
while ($attach = $db->fetch_array($currentattaches))
{
$postattach["$attach[attachmentid]"] = $attach;
$attachcount++;
$formoutput = str_replace('[attach]'.$attachcount.'[/attach]','[attach]'.$attach['attachmentid'].'[/attach]',$formoutput);
}
}
Then use this in Custom Form Output:
|