1
komeil4life
change uname with displayname

hi
i make a display name feild with profile modules, and now i need to use my display name instead user name in newbb!

i edit class/user.php

$name $user->getVar('name');          $name = (empty($xoopsModuleConfig['show_realname'])||empty($name))?$profile->getVar('user_namaieshi'):$name;


but now display name feild just show in post. how can i change my display name with user name in this modules to show my displayname in everywhere at modules?

2
irmtfan
Re: change uname with displayname
  • 2012/6/17 6:31

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


The user name (using uname field in the xoops_user table in database) is hardcoded in many core files and also modules and you cant change it by editing just one file.

from 2.2 afterward xoops core developers decided to discard the display name feature and their ONLY reason on that time was the simplicity to avoid confusing for new users.
In my opinion that was a very bad decision. they could simply made the display name as an optional feature.
they could do it like this:
default option: user name = login name so the new users even didnt notice a difference in the site after install it.
then more experienced users could make the user name different from login name and could hide the login name.
Anyway now the only way is to hack many files in the core and modules to force them to show your custom made "display name" instead of "user name"

Also please attention to the below side note:
currently in some modules you can select the "real name" (name filed in the xoops_user table) to be displayed instead of user name but this is just available in some few modules like news and newbb and it is a poor solution i think.


3
komeil4life
Re: change uname with displayname

that is not enough for me, becouse i need realname field...how can i change user name preview from core?

4
irmtfan
Re: change uname with displayname
  • 2012/6/17 7:29

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Komeil:
I dont know any easy way for doing that.
i just know that you should change all codes like this:->getVar('uname')
changed to ->getVar('YOUR_FIELD_TO_DISPLAY')

maybe a more experienced developer could help you better or find a solution for this.

5
komeil4life
Re: change uname with displayname

tnx :)

Possible to change realname field with another field?

6
thipiechu
Re: change uname with displayname
  • 2012/7/4 4:16

  • thipiechu

  • Just popping in

  • Posts: 1

  • Since: 2012/7/3 1


Also please attention to the below side note: currently in some modules you can select the "real name" (name filed in the xoops_user table) to be displayed instead of user name but this is just available in some few modules like news and newbb and it is a poor solution i think. __________________________________________________________________

Login

Who's Online

154 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 154


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits