[RFC|Implemented] get_username_string hook

These requests for events in core phpBB have been merged into 3.1/Ascraeus and will be available with the next release.
Post Reply
Sam
Registered User
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

[RFC|Implemented] get_username_string hook

Post by Sam »

Name: hook_username_string
Rationale: This hook will allow someone to overwrite the get_username_string function
Placement: includes/functions_display.php
Input arguments: $mode, $user_id, $username, $username_colour, $guest_username, $custom_profile_url (get_username_string clone)
Output format: string
Output semantics: Returns what get_username_string returns.
Infrastructure: This would allow people to generate things such as username prefixes, pretty viewprofile urls, different viewprofile urls, and other custom effects on the username as it is displayed.

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: [RFC] get_username_string hook

Post by 3Di »

I would add also the user_ip thinghy here. ;)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
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

Sam
Registered User
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] get_username_string hook

Post by Sam »

The hook would essentially act as a full replacement for the get_username_string() function. The User IP is not used for it.

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: [RFC] get_username_string hook

Post by 3Di »

SyntaxError90 wrote:The hook would essentially act as a full replacement for the get_username_string() function. The User IP is not used for it.
It does not harm to have it, I can use it. :ugeek:
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
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

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: [RFC] get_username_string hook

Post by 3Di »

At the end of all, anyway I mean, I could use that proposed hook ( that's a good idea IMHO ) just forking it or whatever and blah blah, adding whatever I like (hopefully). I do not see where the problem is .. so, adding the IP?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
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

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] get_username_string hook

Post by imkingdavid »

I added the event: core.alter_username_string

This will let you take the output generated by get_username_string and modify as needed, or even completely overwrite that.

This has not yet been added to the core. To see the changes made, you can view the following: https://github.com/imkingdavid/phpbb3/c ... 576570acaa

3Di wrote:I would add also the user_ip thinghy here. ;)
User IP is not provided to the get_username_string function, so it is not available to the event.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] get_username_string hook

Post by nickvergessen »

should be "modify" instead of "alter" as we used that several times
Member of the Development-TeamNo Support via PM

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] get_username_string hook

Post by imkingdavid »

This has been merged.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Post Reply