by axew3 » Sun Apr 09, 2017 1:22 pm
for the ajax joke, that will pass all phpBB events listeners values into phpBB, on next release, i've fall
into /includes/functions_content.php, because i need to see how the thing was built. Well in true i've stop to go deep yesterday but, on
/includes/functions_content.php i've see this instead at line 1581 (where i think in case is better to hook into)
Code: Select all
/**
* Use this event to change the output of get_username_string()
*
* @event core.modify_username_string
* @var string mode profile|username|colour|full|no_profile
* @var int user_id String or array of additional url
* parameters
* @var string username The user's username
* @var string username_colour The user's colour
* @var string guest_username Optional parameter to specify the
* guest username.
* @var string custom_profile_url Optional parameter to specify a
* profile url.
* @var string username_string The string that has been generated
* @var array _profile_cache Array of original return templates
* @since 3.1.0-a1
*/
$vars = array(
'mode',
'user_id',
'username',
'username_colour',
'guest_username',
'custom_profile_url',
'username_string',
'_profile_cache',
);
extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars)));
return $username_string;
}
Now, there is a problem, that also you have note, if you go to change usernames all work fine in phpBB, until a link is built containing an ID of the user, but won't work if the link is built by username.
I mean for example when you select an username to PM to an user. The list show usernames, and against this value phpBB return the correct user which the PM will be send out. If the username is not the same, than phpBB fail and return you that the user not exist. The same on all other situations where links are built for queries against usernames, and not by id.
So i've stop to go more deep at this point. But what next step i will see into when i can a while (that can also point you to final correct solution (maybe, maybe not we will see)) is: the main phpBB function that retrieve data for users, if possible to see where can be added a switch.
The switch to be effective, should check against real username: association of this, should maybe be a custom field or something not very clear at moment into my mind. Most of the time the right answer come out after, you have check all what you still do not know.
for the ajax joke, that will pass all phpBB events listeners values into phpBB, on next release, i've fall
into /includes/functions_content.php, because i need to see how the thing was built. Well in true i've stop to go deep yesterday but, on
/includes/functions_content.php i've see this instead at line 1581 (where i think in case is better to hook into)
[code]/**
* Use this event to change the output of get_username_string()
*
* @event core.modify_username_string
* @var string mode profile|username|colour|full|no_profile
* @var int user_id String or array of additional url
* parameters
* @var string username The user's username
* @var string username_colour The user's colour
* @var string guest_username Optional parameter to specify the
* guest username.
* @var string custom_profile_url Optional parameter to specify a
* profile url.
* @var string username_string The string that has been generated
* @var array _profile_cache Array of original return templates
* @since 3.1.0-a1
*/
$vars = array(
'mode',
'user_id',
'username',
'username_colour',
'guest_username',
'custom_profile_url',
'username_string',
'_profile_cache',
);
extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars)));
return $username_string;
}[/code]
Now, there is a problem, that also you have note, if you go to change usernames all work fine in phpBB, until a link is built containing an ID of the user, but won't work if the link is built by username.
I mean for example when you select an username to PM to an user. The list show usernames, and against this value phpBB return the correct user which the PM will be send out. If the username is not the same, than phpBB fail and return you that the user not exist. The same on all other situations where links are built for queries against usernames, and not by id.
So i've stop to go more deep at this point. But what next step i will see into when i can a while (that can also point you to final correct solution (maybe, maybe not we will see)) is: the main phpBB function that retrieve data for users, if possible to see where can be added a switch.
The switch to be effective, should check against real username: association of this, should maybe be a custom field or something not very clear at moment into my mind. Most of the time the right answer come out after, you have check all what you still do not know.