phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[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.

[RFC|Implemented] get_username_string hook

Postby Sam » Thu Aug 19, 2010 5:08 pm

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
Sam
Website Team
Website Team
 
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] get_username_string hook

Postby 3Di » Sat Aug 21, 2010 12:55 am

I would add also the user_ip thinghy here. ;)
Give Peace A Chance.. Pass ON It! ° phpBB wiki in Italiano ° Ich bin ein Berliner
Image
User avatar
3Di
 
Posts: 467
Joined: Tue Nov 01, 2005 9:50 pm
Location: Berlin - Milan

Re: [RFC] get_username_string hook

Postby Sam » Sat Aug 21, 2010 1:26 am

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
Sam
Website Team
Website Team
 
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] get_username_string hook

Postby 3Di » Sun Aug 22, 2010 3:14 am

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:
Give Peace A Chance.. Pass ON It! ° phpBB wiki in Italiano ° Ich bin ein Berliner
Image
User avatar
3Di
 
Posts: 467
Joined: Tue Nov 01, 2005 9:50 pm
Location: Berlin - Milan

Re: [RFC] get_username_string hook

Postby 3Di » Mon Sep 26, 2011 10:20 pm

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?
Give Peace A Chance.. Pass ON It! ° phpBB wiki in Italiano ° Ich bin ein Berliner
Image
User avatar
3Di
 
Posts: 467
Joined: Tue Nov 01, 2005 9:50 pm
Location: Berlin - Milan

Re: [RFC] get_username_string hook

Postby imkingdavid » Mon Aug 20, 2012 4:27 pm

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
imkingdavid
Development Team
Development Team
 
Posts: 905
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] get_username_string hook

Postby nickvergessen » Tue Aug 21, 2012 7:53 am

should be "modify" instead of "alter" as we used that several times
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 357
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC] get_username_string hook

Postby imkingdavid » Sat Sep 01, 2012 8:08 pm

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.
User avatar
imkingdavid
Development Team
Development Team
 
Posts: 905
Joined: Thu Jul 30, 2009 12:06 pm


Return to [3.1/Ascraeus] Merged Event Requests

Who is online

Users browsing this forum: No registered users and 1 guest