Max Number for Custom Field

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
miket80
Registered User
Posts: 59
Joined: Fri Feb 14, 2020 4:42 pm

Max Number for Custom Field

Post by miket80 »

Hi,

I want to add a new custom user profile field of Number type. The numbers that are adding should support 0 - 200,000,000

However I keep getting told that the max number supported is 999,999

Is there anyway to increase this limitation - seems a bit strange to me...

User avatar
david63
Registered User
Posts: 17247
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Max Number for Custom Field

Post by david63 »

Without checking the database I cannot be 100% sure but the reason it is limited to 999,999 will be the size of that field. You could try changing the size, but I don't know what implications that may have.

Depending on what you intend doing with that data you could perhaps use a text field
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
Steve
Registered User
Posts: 1078
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact:

Re: Max Number for Custom Field

Post by Steve »


miket80
Registered User
Posts: 59
Joined: Fri Feb 14, 2020 4:42 pm

Re: Max Number for Custom Field

Post by miket80 »

Thanks for the replies, but I don't think this is a DB limitation.

The field in the DB is a bigint(20) with storage range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808

It's some limit within the app it seems that numbers can only go up to 999,999 but why?

User avatar
david63
Registered User
Posts: 17247
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Max Number for Custom Field

Post by david63 »

miket80 wrote: ↑
Sat Feb 15, 2020 10:38 am
It's some limit within the app it seems that numbers can only go up to 999,999 but why?
I don't have access to files at the moment but I would check the parameters on the input field in the template
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
3Di
Former Team Member
Posts: 14823
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Max Number for Custom Field

Post by 3Di »

That
miket80 wrote: ↑
Sat Feb 15, 2020 10:38 am
It's some limit within the app it seems that numbers can only go up to 999,999 but why?
Look at ROOT\phpbb\profilefields\type\type_int.php

See public function get_options() - there is where those template inputs are defined.

Code: Select all

	public function get_options($default_lang_id, $field_data)
	{
		$options = array(
			0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'],		'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
			1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'],	'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
			2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'],	'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
			3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'],		'FIELD' => '<input type="number" name="field_default_value" value="' . $field_data['field_default_value'] . '" />'),
		);

		return $options;
	}
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

miket80
Registered User
Posts: 59
Joined: Fri Feb 14, 2020 4:42 pm

Re: Max Number for Custom Field

Post by miket80 »

Thank you for this! - It worked. Although I still don't really understand why it's so fixed in the files and not flexible based on user input. I thought that was the purpose of the fields on those settings.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 22083
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket.

Re: Max Number for Custom Field

Post by Mick »

Maybe whoever wrote that part of the software thought 999,999 was enough?
"The more connected we get the more alone we become" - Kyle Broflovski

Please read: β€œAm I In The Right Place?” before posting.

User avatar
3Di
Former Team Member
Posts: 14823
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Max Number for Custom Field

Post by 3Di »

miket80 wrote: ↑
Sat Feb 15, 2020 10:38 am
...

The field in the DB is a bigint(20) with storage range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808
...
A BIGINT is always 8 bytes and can store
-9223372036854775808 to 9223372036854775807 (signed)
or
0 to 18446744073709551615 (unsigned).
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

Post Reply

Return to β€œ[3.3.x] Support Forum”