MyBB Community Forums

Full Version: Disabling size for external links in Downloads Section
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After allowing external links in MusicalMidget's Downloads Section, by deleting the following code from forums/downloads.php:

        if(!$_FILES['attachment']['size'])
	{
		error($lang->error_no_file);
	}

Users are no longer required to upload a file, & could just leave the uploading area empty & link to it instead in the Desctription area. Now even if they post links, the size (usually of a few kb's) still displays below them.

My question is this:
What code should I be inserting inorder to avoid displaying the size if there's no uploaded attachment? Something like this?

if($_FILES['attachment']['size'] < 12000)
	{
not display $download['size'];
	}

N.B: I chose the size as 12000, 'cause I don't think a link in the description could exceed 12kb's.
Thanks in advance.