Thanks so much for this great extension, but my client has only one request that I can’t quite handle. They really want a space between the numbers and letters in the file size – for example: 917.4 KB, not 917.4KB.
I know this is being a bit picky, but is there any way to achieve this at the moment? Or is it an option that could be quickly added to the plug-in?
Thanks so much for this great extension, but my client has only one request that I can’t quite handle. They really want a space between the numbers and letters in the file size – for example: 917.4 KB, not 917.4KB. I know this is being a bit picky, but is there any way to achieve this at the moment? Or is it an option that could be quickly added to the plug-in?
Quickly added the variables %file_size_raw and %file_size_unit. Download the new version in post #1
Enjoy!
Thanks so much for this great extension, but my client has only one request that I can’t quite handle. They really want a space between the numbers and letters in the file size – for example: 917.4 KB, not 917.4KB. I know this is being a bit picky, but is there any way to achieve this at the moment? Or is it an option that could be quickly added to the plug-in?Quickly added the variables %file_size_raw and %file_size_unit. Download the new version in post #1 Enjoy!
Hi Daniel. Thanks so much for the quick reply. I really appreciate it. The new variables are certainly going to be a great help, but I do seem to have run into one further little issue, though …
You see, when I use {file_size_raw} it doesn’t seem to be affected by the settings I have for the “filesize_precision” parameter. It used to work with the old [file_size} variable, however. The number that used to come out as 917.4KB is now coming out as 917.436523438 KB :-}
Is that something else that is easy to fix, or should it be working properly (in which case I must be doing something wrong)?
Regards Andrew Macpherson
Just been using this on a site running PHP 5.2.9 and was getting undefined index errors when using url_only=’yes’. Did some digging and realised that parse_url was .(JavaScript must be enabled to view this email address). The solution here then seems to be to update lines 115-122 in the plugin to:
$tags['scheme'] = (isset($temp['scheme'])) ? $temp['scheme']: '';
$tags['host'] = (isset($temp['host'])) ? $temp['host'] : '';
$tags['file_path'] = (isset($temp['path'])) ? $temp['path'] : '';
$tags['port'] = (isset($temp['port'])) ? $temp['port'] : '';
$tags['query_string'] = (isset($temp['query'])) ? $temp['query'] : '';
$tags['fragment'] = (isset($temp['fragment'])) ? $temp['fragment'] : '';
$tags['user'] = (isset($temp['user'])) ? $temp['user'] : '';
$tags['pass'] = (isset($temp['pass'])) ? $temp['pass'] : '';
Hope that helps.
This is a handy plug-in and saved me a lot of trouble but I’m using the file size on a different project and for some reason it’s not showing up. Here’s the code for my links:
{exp:zm_extract_url_plus url_only="yes" url="{case_study_file}"}
<a href="http://{full_url}" title="download {file_name}">{file_name}</a> ({file_size} {extension})
{/exp:zm_extract_url_plus}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.