Ajeh,
That is what the comments in the code say it will do, but that is not, what in fact, the code does.
I checked on our live site and if the expiry days is zero (which we have for ALL downloads), when a person goes into his account to re-download, the order shows with a "Remaining" value of "--- *** ---"
Here is the code from includes/templates/template_default/templates/tpl_modules_downloads.php (reformatted to clarify the nesting of parentheses):
First the comments, which come further down in the code:
Code:
// The link will appear only if:
// - Download remaining count is > 0, AND
// - The file is present in the DOWNLOAD directory, AND EITHER
// - No expiry date is enforced (maxdays == 0), OR
// - The expiry date is not reached
Code:
$is_downloadable = (
(file_exists(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'])
&&
(
($downloads->fields['download_count'] > 0 && $download_timestamp > time())
||
$downloads->fields['download_maxdays'] == 0
)
)
) ? true : false;
Here is the code I use (which is a straightforward translation of the comments into code):
Code:
$is_downloadable =
(
( file_exists(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']) &&
( $downloads->fields['download_count'] > 0 &&
(
$download_timestamp > time() ||
$downloads->fields['download_maxdays'] == 0
)
)
)
) ? true : false;
Bookmarks