Форуми / Cotonti / Bugs / Archive / Fix: User extrafields title

GHengeveld
#1 03.02.2009 07:52
I noticed that the Seditio tag USER_EXTRA1_TITLE and the like no longer work in Cotonti.
Here's what I did to fix that:

Place the following code:
$t3 = $t1."_TITLE";
$t4 = $row['field_description'];
$useredit_array[$t3] = $t4;
In (system/core/users/):
users.edit.inc.php - line 333
users.profile.inc.php - line 594
Trustmaster
#2 03.02.2009 16:22
Is it missing in Admin => Users => Add/Edit extra fields?
May the Source be with you!
GHengeveld
#3 03.02.2009 22:47
Yes it is. You can make custom fields with that module but it only makes a tag for the field. With my code it will also make a tag for the description of each field.

For example, I could make an extra input field named 'firstname', with description 'First name'. The module would make a tag {USERS_PROFILE_FIRSTNAME}, which in users.profile.tpl will be replaced by the HTML code for an input field. What is missing here is the tag {USERS_PROFILE_FIRSTNAME_TITLE}, which would be replaced by the description for this field, so 'First name'. My 3 lines of code will do exactly that.

It would be nice to see this fixed in the next Cotonti release.
Trustmaster
#4 04.02.2009 01:59
I have added a Trac ticket. It will be fixed soon. You should start using Trac for things like this.
May the Source be with you!
GHengeveld
#5 04.02.2009 18:59
Never used Trac before.. I'll try to figure it out.
Kilandor
#6 04.02.2009 19:06
I think the reason it was probably left not to have a title, is because that forces it to be hard coded language. And not dynamic, you could simply use your skinlang and add a lang in there, and use {PHP.L.skinlang.whatever}. Or the title tag could be set to output a $L and not use the desc row.
GHengeveld
#7 04.02.2009 19:11
Certainly true, but it's nice to have the option to go with the _TITLE tag instead of the skinlang. Most of my sites only support one language anyway.
medar
#8 04.02.2009 19:31
Internalization is reason why i don`t add _TITLE in extrafields system.

But this may be done in next release for reasons of compatibility..
rangjungyeshe.ru
Trustmaster
#9 04.02.2009 23:01
_TITLE could try isset($L[$extra_title]) and if it fails just assign the title as is.
May the Source be with you!