Page 1 of 1

change the view of the username

Posted: 2024-02-17 19:19
by lramirez
Good morning to the entire forum... (excuse my English :-D)
I have a question, if someone with knowledge can help me, I want to change the view of the username to the custom name written in the "custom2" like the example shown in the images.

Can someone guide me if this can be done...??
Thank you very much for your help.

Re: change the view of the username

Posted: 2024-02-17 20:36
by pbottcher
Hi,

you can add the following code to the hooks/footer-extras.php

Code: Select all

<?php
$mi=getMemberInfo();
?>
<script>
$j('nav .navbar-link').text('<?php echo $mi['custom'][1]; ?>');
</script>

Re: change the view of the username

Posted: 2024-02-19 06:21
by lramirez
Thank you very much pböttcher, for the help, I made a correction and it worked as I wanted... Thank you.

Code: Select all

<?php $mi=getMemberInfo(); ?>
<script>
$j('nav .profile-menu-text').text('<?php echo $mi['custom'][1]; ?>');
</script>

Re: change the view of the username

Posted: 2024-02-29 22:58
by lramirez
Hello...
(excuse my English)
I want to clarify that in order to achieve the result of the query
I made and that was answered by the user pböttcher, the code:

Code: Select all

<?php $mi=getMemberInfo(); ?>
<script>
$j('nav .profile-menu-text').text('<?php echo $mi['custom'][1]; ?>');
</script>
was placed in /hooks/header-extras.php and it worked.
Thanks for the collaboration.

Re: change the view of the username

Posted: 2024-03-03 02:58
by xbox2007
Nice work
Thanks a lot