MyBB Community Forums

Full Version: template attachment file size
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi

Im try two code in my different page template.

this code
{$attachment['filesize']} 
working but not show bytes or kilobytes or megabytes. only show bytes value like this 5156484

this code empty don't output file size.
{$attachment['size']}

How can I fix it.
Add bove it:
$attachment['filesize'] = get_friendly_size($attachment['filesize']);
(2014-08-09, 02:00 PM)marcus123 Wrote: [ -> ]Add bove it:
$attachment['filesize'] = get_friendly_size($attachment['filesize']);

thx but Template found a potential safety issue.
is that php custon page you are talking about here?
If you want to use PHP in MYBB templates you need this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260
(2014-08-09, 03:26 PM)marcus123 Wrote: [ -> ]is that php custon page you are talking about here?
If you want to use PHP in MYBB templates you need this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260

is there any way without using a plugin?
I need help guys
I need help guys
I've tried many things.
You don't need a plugin: instead, you need to fix your core files. By default, {$attachment['filesize']}  shows the friendly value, not the huge bytes number.

I mean, maybe you have been playing with some core files, like attachments.php, functions_post.php, etc, and something went wrong. Try reverting those modified files to the original version

(Sorry for my English, I hope you can understand me)