• Page 1 of 1
  • 1
uCoz Community » uCoz Modules » Forum » Forum: Show users 'full name' instead of 'nickname'
Forum: Show users 'full name' instead of 'nickname'
SadieXylander
Posts: 3
Reputation: 1

Message # 1 | 5:00 PM
Greetings smile

I've been poking around with the uCoz system for a few weeks now and nearly everything I've been able to find answers for on my own (either here in the forum or by fiddling a bit). However, I have only been able to find pseudo answers to this question so I figured I'd pop in and say hello *with cookies* and ask the experts.

I've enabled the forum on my site and sprinkled a little CSS fairydust coloring on usernames to denote the different groups for those who are logged in. However, my site is for role playing and each character has a first and last name. When a user creates an account they can use these fields for their character names instead of the nickname/login name (which allows no spaces or %20).

Of course, here's where it gets tricky. I've discovered that the 'body' portion of the forums is kept as private by the lovely builders so untrained users don't accidentally slip in the wrong code and blow things up. Yet I'd love to find a way to modify the 'display name' in the forums to show 'first name last name' instead of 'nickname'.

So...

1. Does anyone know of a way to do this either in the control panel or elsewhere that I've completely overlooked?

2. If this option is simply not available, I'd love a gentle nudge in the direction of a script that could aid me in this. The script just basically needs to find instances of this ($USERNAME$) in the forum code and replace it with this ($USER_FULL_NAME$) so that a character's full name is displayed.

If you need to peek at the forum to get a clearer picture, you can find it here:
http://halon.ucoz.com

Any assistance would be greatly appreciated. Cheers! cool
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 2 | 1:39 AM
SadieXylander, if you open Control Panel > Design > Appearance of entries (for the forum) and search for "$USERNAME$" you should find this tag highlighted somewhere in the code body. To do what you are wanting simply switch the $USERNAME$ tag with $USER_FULL_NAME$ and you're done. smile

With the forums the developers do keep quite a lot of the system under lock and key but if there's anything more you need feel free to ask here or PM myself as if there aren't system methods of doing it in some cases there are a few simple scripts that can be used. wink

Hope this helps, happy

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
SadieXylander
Posts: 3
Reputation: 1

Message # 3 | 2:14 AM
Greetings Paradox and thank you so much for your feedback! It was extremely helpful. smile

This did help to resolve part of the mystery. Not sure why I didn't see it previously, but I must have needed another set of eyes. tongue

As you can see, when you look at the entry here:
http://halon.ucoz.com/forum/8-10-1

... it indeed does show the first and last name as opposed to the login name which is awesome. However, when looking at the forum lineup here:
http://halon.ucoz.com/forum/

... the body itself still shows the login name (which might cause even greater confusion for users). I'm a giant fan of users being able to see their characters' full names, especially when some users prefer logins like as 'miraclegrow57'.

One thought I had was to go into Control Panel > Design > Quick Replacement and simply replace all instances of $USERNAME$ WITH $USER_FULL_NAME$, but I daresay that would cause more issues than it would resolve so that idea was ruled out pretty quickly. happy

Without access to the code (which I totally understand) I've been trying to think about a workaround for this. Without touching the code I'm thinking a little jquery would do the trick, although the j-scripts seem and I get along as well as Superman and Lex Luther. dry

I've been working with the replaceWith API, and while this may be the right direction I don't think it's a proper solution as this method only seems to work with text after the page is loaded. I may need to think about how to have this ($USERNAME$) replaced with this ($USER_FULL_NAME$) during on-load so that the page runs the correct function before the UI is displayed.

Any thoughts on another possible solution? I'd love to discuss this more and see if there's an alternate solution as the choice between these two functions does not yet seem to be a 'control panel' clickable option.

Cheers and thanks for your feedback! I look forward to discussing this more and seeing if a solution or workaround is floating out there somewhere in space. cool

Added (2012-07-04, 8:14 PM)
---------------------------------------------
And as an addendum:

I'm also playing with this piece of code (above the opening html tag):

Code
<? php
if ($USERNAME$)
{
echo '$USER_FULL_NAME$';
}
else
{
echo 'Peter Pan';
}
?>


Which of course does nothing... tongue But if you put instead this code (which is a similar action):
Code
<?if($USERNAME$;)?>$USER_FULL_NAME$<?else?>Peter Pan<?endif?>


... Peter Pan shows up at the top of the page. The difference between the two is that the first bit of code should find all instances of $USERNAME$ whereas the second instance only does the old switcheroo one line at a time (dependent on where the code is placed). </nerd>

I'm sort of circling the drain here but I think I've got the logic right. I just need to find the magic key. Though it is also possible that conditions are built into the $BODY$ tag that prevents this methodology entirely (unless via CSS scripting). I'll keep poking at it... just thought I'd share my progress so far. cool
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 4 | 7:52 AM
SadieXylander, no problem at all. smile

As to your new problem that actually has me completely stumped at the moment as to how to go about changing it. That is one of the few parts of the system that is unchangeable even using JavaScript as far as I can imagine from what I know. The main problem that this stems from is that the username's displayed on the posts are actually a built in part of the system where it directly pulls them from the sites database - meaning it doesn't go through the process of using the $USERNAME$ variable and such. The second problem is that the $NAME$ variable isn't a standard global variable and such. I will keep looking into it but unfortunately I'm not sure if it will be possible to change them all, you can however remove the column if you'd like but that may be destructive to the standard flow of the forums.

The code you've been playing with is a PHP script which unfortunately doesn't work with uCoz sites, the concept is there however. smile The second line of code you provided works exactly as you have said. wink

The uCoz conditional operators do not apply globally but only locally to the section of code you are applying them to. So they allow you to define when a user is logged in or out, as a certain group, certain users, and a myriad of other conditions. But they only apply to the section of code you are writing, they don't function like a script, they just show or hide different pieces of code based on the conditons inside the brackets. You can find more information on them here: http://forum.ucoz.com/forum/37-471-1

Apart from that I will keep looking but I am not sure whether I will be able to find something now. smile

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
SadieXylander
Posts: 3
Reputation: 1

Message # 5 | 1:49 PM
Paradox, you are amazing! Thank you so much for taking the time to look into this. biggrin

Your words above describe perfectly what my thoughts have been circling around. Because this portion of the dev work is under lock and key, that it might have been written differently to deflect any changes to specific areas.

As for removing the column, I agree that such a removal would be more destructive than beneficial. Another workaround is to have users do their username this way (FirstnameLastname), but it still gives a character the feel of a single name. Even with two capitalized letters to show separation. You may have picked up on that I'm a huge fan of things that are very intuitive and easy when it comes to my users.

I will also keep looking into things on my end and see if I can find a solution, or at least take us one step closer to one. Cheers and thanks again for all your wisdom and insightfulness in this! cool
uCoz Community » uCoz Modules » Forum » Forum: Show users 'full name' instead of 'nickname'
  • Page 1 of 1
  • 1
Search: