[3.3][RC] Short Number Twig Extension

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
User avatar
Toxyy
Registered User
Posts: 807
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

[3.3][RC] Short Number Twig Extension

Post by Toxyy »

Extension Name: Short Number Twig Extension
Author: Toxyy

Extension Description: Adds short_number_ext twig function for use in the template. This function converts numbers over 10,000 to their short forms using K for thousand, M for million, B for billion, and T for trillion.
  • 123,123 -> 123K
  • 123,123,123, -> 123M
  • 123,123,123,123 -> 123B
  • 123,123,123,123,123 -> 123T
A language file has been added if K/M/B/T are not used in your language.

Extension Version: 1.0.1

Requirements:
  • phpbb 3.3.x
  • PHP >=7.1.3
Features:
  • Adds short_number_ext twig function for use in the template
Screenshots:
Usage example: {{ short_number_ext(forumrow.POSTS) }} in the forumlist_body.html template file

Image

Installation:
  • Download the latest release and unzip it.
  • Upload the unzipped files to /ext/toxyy/shortnumbertwig and enable it in the ACP
GitHub Repository: https://github.com/toxyy/shortnumbertwig
Extension Download: https://github.com/toxyy/shortnumbertwi ... v1.0.1.zip
Last edited by Toxyy on Fri Sep 04, 2020 5:55 pm, edited 4 times in total.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics || [3.3][RC] Short Number Twig Extension
User avatar
warmweer
Jr. Extension Validator
Posts: 5555
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: [3.3][RC] Short Number Twig Extension

Post by warmweer »

Just a small remark.
Billion and Trillion are English terms and in daily language are used in the short scale. Other languages (e.g. Dutch, German also IIRC) use long scale
I would recommend adding a note to the extension explaining that (especially if it is used with other languages).
see https://en.wikipedia.org/wiki/Metric_prefix
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
User avatar
david63
Registered User
Posts: 18445
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: [3.3][RC] Short Number Twig Extension

Post by david63 »

I would also point out that if this extension is for phpBB 3.3.x then the PHP version must be at least 7.1.3
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
Toxyy
Registered User
Posts: 807
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: [3.3][RC] Short Number Twig Extension

Post by Toxyy »

warmweer wrote:
Mon Aug 31, 2020 12:36 pm
Just a small remark.
Billion and Trillion are English terms and in daily language are used in the short scale.
Language file added now :)
david63 wrote:
Mon Aug 31, 2020 12:50 pm
I would also point out that if this extension is for phpBB 3.3.x then the PHP version must be at least 7.1.3
Changed.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics || [3.3][RC] Short Number Twig Extension
User avatar
DTMWC
Registered User
Posts: 375
Joined: Tue Jan 16, 2018 6:17 am

Re: [3.3][RC] Short Number Twig Extension

Post by DTMWC »

Nice idea :-)
If you use CodePen... Give @SMKS's Thank You NHS pen a like.
Post Reply

Return to “Extensions in Development”