Bytes to better terms?
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Bytes to better terms?
I'm wondering how I can take the 'filesize' column from the attachments table, and make it not show Bytes, but show better terms, considering size, eg 446.51 KiB instead of 457222 Bytes. First of all, I looked into phpBB3's code, and I can't figure out how they do it. Second of all, I don't know what function I need, or whatever. Thanks!
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- Mighty Gorgon
- New member
- Posts: 44
- Joined: 25 Jul 2007, 12:34
- Real name: Luca
- Location: Italy
- Contact:
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Re: Bytes to better terms?
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Bytes to better terms?
- we're poor!
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Re: Bytes to better terms?
Wait? I don't understand...?
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Bytes to better terms?
Instead of adding false as second argument you just let it default to true, then you don't have to add the $filesize checks because they are performed by the function itself.
- we're poor!
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Re: Bytes to better terms?
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Bytes to better terms?
Yep Take a look at the function in includes/functions.php yourself
- we're poor!
- Mighty Gorgon
- New member
- Posts: 44
- Joined: 25 Jul 2007, 12:34
- Real name: Luca
- Location: Italy
- Contact:
Return to “phpBB Development discussion”
Who is online
Users browsing this forum: No registered users and 31 guests