MyBB Community Forums

Full Version: MyDownloads Hide Empty Button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using MyDownloads plugin. And if I don't upload any file, or type download links the "Download" button will appear instead of being hidden. 
Can anyone tell me how to fix that? 
 https://community.mybb.com/mods.php?acti...w&pid=1475
So I found this piece of code in root/mydownloads.php and I'm sure that it's what I need but not so sure what to change here. Any tips?



// in case there's a download url
// show a page with the links

if ($dl['url'] != "")
 {
 $parser_options = array(
 'allow_mycode' => 1,
 'allow_smilies' => 0,
 'allow_imgcode' => 0,
 'allow_html' => 0,
 'filter_badwords' => 0
 );

 mydownloads_error($lang->sprintf($lang->mydownloads_url_download, $parser->parse_message("[code]".$dl['url']."
", $parser_options)), $lang->mydownloads_url_download_title, $lang->mydownloads_url_download_title, $dl['did'], $dl['cid'], $dl['name']);
}

// output download
$ext = get_extension($dl['download']);

switch($dl['filetype'])
{
case "application/pdf":
case "image/bmp":
case "image/gif":
case "image/jpeg":
case "image/pjpeg":
case "image/png":
case "text/plain":
/*header("Content-type: {$dl['filetype']}");
$disposition = "inline";*/
//header("Content-type: application/force-download"); // commented because this breaks on devices that can't save to disk
header("Content-type: {$dl['filetype']}");
$disposition = "attachment";
break;

default:
header("Content-type: application/force-download");
$disposition = "attachment";
}