Display Name
4 posters
Page 1 of 1
Display Name
Hi there,
Is there any way to make display name different from username? For example, I want to display the users' full names rather than their usernames, which are hard to recognize. It should be something like this forum: http://www.hn-ams.org/forum/, just go to the register section and you will see (sorry, this is in Vietnamese and powered by vB, just an example).
Moreover, if you could make the usernames become something like the Facebook's alternative names, that would be very much appreciated .
Is there any way to make display name different from username? For example, I want to display the users' full names rather than their usernames, which are hard to recognize. It should be something like this forum: http://www.hn-ams.org/forum/, just go to the register section and you will see (sorry, this is in Vietnamese and powered by vB, just an example).
Moreover, if you could make the usernames become something like the Facebook's alternative names, that would be very much appreciated .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
You can use jQuery to change the display name everywhere but in the chatbox and on profile pages, if that is what you want.
Re: Display Name
Indeed, it is possible.
I will wait for the original poster to comment on this before I post the script.
I will wait for the original poster to comment on this before I post the script.
Re: Display Name
Ultron's Vision wrote:You can use jQuery to change the display name everywhere but in the chatbox and on profile pages, if that is what you want.
That is exactly what I want . However, the problem is that I don't know what jQuery is :|. Is it something like CSS? Does it mean that we can use either jQuery or CSS to solve this problem?
Oh and mine is phpBB3, but, in case I may change the version in the future, what is the difference between those versions (in terms of the coding, CSS, jQuery, etc.)?
Thank you .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
There shouldn't be a difference between the two phpBB versions...
jQuery is a JavaScript framework. Add the code below under Admin Panel -> Modules -> HTML & JavaScript -> JavaScript pages management -> Create new and select 'In all the pages'.
You need to replace /u1 with the appropriate number for each user, and replace Old Username with the username of the user you want to change.
Note that you shouldn't use too many names there, it might cause the page to load slower.
jQuery is a JavaScript framework. Add the code below under Admin Panel -> Modules -> HTML & JavaScript -> JavaScript pages management -> Create new and select 'In all the pages'.
- Code:
jQuery(document).ready(function(){
var newName = '<span><strong>New Name here</strong></span>';
jQuery('a[href="/u1"] span').html(newName);
jQuery('a[title="Old Username"]').html(newName);
});
You need to replace /u1 with the appropriate number for each user, and replace Old Username with the username of the user you want to change.
Note that you shouldn't use too many names there, it might cause the page to load slower.
Re: Display Name
So, is there any difference between phpBBs and punBB or IPB?
It seems like I can't get you. Where can I get the "appropriate number for each user"? Is it User ID or something? Btw, actually I want to make this change for all users; this means every user's display name will be changed, not only some users' only. Or did I misunderstand you?
It seems like I can't get you. Where can I get the "appropriate number for each user"? Is it User ID or something? Btw, actually I want to make this change for all users; this means every user's display name will be changed, not only some users' only. Or did I misunderstand you?
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Ah, you're referring to IPB's display name change, I know.
You are using a forumotion forum, right? Each user can be accessed by a certain User ID, yes, mine is /u82318 in here, for example.
So I would change a[href="/u1"] span to a[href="/u82318"] span and a[title="Old Username"] to a[title="Ultron\'s Vision"].
There is a difference between each of these forums, yes.
You are using a forumotion forum, right? Each user can be accessed by a certain User ID, yes, mine is /u82318 in here, for example.
So I would change a[href="/u1"] span to a[href="/u82318"] span and a[title="Old Username"] to a[title="Ultron\'s Vision"].
There is a difference between each of these forums, yes.
Re: Display Name
I just tested the code in my Test Forum and it really worked! Since my forums current just have 2 members, I just let it be "u1" LOL. However, the problem is that if I want to change the display name or every user, will I have to create a code for each user?
One of my efforts: I created a field named "Full name" and make it required in registration. Now, is there any way for me to redirect the "new name" in your code to my field "full name"?
Oh and IPB offered display name change feature? That would be cool!
One of my efforts: I created a field named "Full name" and make it required in registration. Now, is there any way for me to redirect the "new name" in your code to my field "full name"?
Oh and IPB offered display name change feature? That would be cool!
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Well, yes, it would be possible to do so within topics, but outside topics, not really.
You can use the script I gave you for quite some usernames, yes, but be sure to find the right number of usernames so that you forum does not lag.
And IPB is paid forum software so you can expect it to have quite some features forumotion does not have. But that aside.
You can use the script I gave you for quite some usernames, yes, but be sure to find the right number of usernames so that you forum does not lag.
And IPB is paid forum software so you can expect it to have quite some features forumotion does not have. But that aside.
Re: Display Name
Sorry, what do you mean by "inside / outside the topics", does it mean the changes only apply inside the threads?
Yes, I could do that for many usernames manually, but is there a way, I mean automatic way, to do that, such as let users fill in a field named "Full name", for example, when they register, and then automatically make that field their display names?
Yes, I could do that for many usernames manually, but is there a way, I mean automatic way, to do that, such as let users fill in a field named "Full name", for example, when they register, and then automatically make that field their display names?
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Inside topics I can query the content of the Full Name field, outside of topics the field doesn't exist (well, it does exist in profiles, but that aside) so I wouldn't be able to access it there, sorry.
Re: Display Name
Well, it would still be OK if you can handle it just inside topics . So what do I have to change in your code ?
Nevertheless, if the field exists in profiles, could you use it to replace the usernames outside the topics?
Nevertheless, if the field exists in profiles, could you use it to replace the usernames outside the topics?
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Well, I could try.
I would need a link to your forum for testing purposes, though, and an admin account to test the script would be great, too.
You can do so via PM, if you decide to provide me an admin account, do not ever post it publicly.
I would need a link to your forum for testing purposes, though, and an admin account to test the script would be great, too.
You can do so via PM, if you decide to provide me an admin account, do not ever post it publicly.
Re: Display Name
Well basically my forum is just like every new forum you can create, so testing in my forum or in your test forum is just the same. Moreover, my forum is in Vietnamese, so it will probably be difficult for you to understand... However, if you really need to test it in my forum, just let me know, via either post here or pm .
Mine is phpBB3, btw .
Mine is phpBB3, btw .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
BUMP. Where are you Ultron's Vision, or everybody else...
Just say sth if you're still there, or are you all sleeping? .
Just say sth if you're still there, or are you all sleeping? .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Display Name
Thing is, I need some time, as I won't be home much today and that tomorrow I got some work to do for a while, so you can expect me to be done with it on Sunday maybe...
Sorry for the inconvenience.
Sorry for the inconvenience.
Re: Display Name
No problem, Ultron's Vision; I'm in the same situation LOL, flooded by homework X_X. See you Sunday .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
Okay, I have some code ready, but this implies that you have the profile field "Display Name" set as 1st profile field (otherwise, you must change a number in the code below).
Tested in phpBB 3 and my console, should work.
- Code:
jQuery(document).ready(function(){
var pp = document.getElementsByClassName("postbody");
for(var i = 0; i < pp.length; i++) {
var dispName = pp[i].getElementsByTagName("dd")[2].getElementsByClassName("label")[0].nextSibling;
/* You need to replace 0 with the number of the profile field number you have set for the display name profile field minus 1; arrays start counting at 0, not at 1, so the first element is [0], not [1], [1] is the second element. If you need help with this, post here. */
// now a long, long line
pp[i].getElementsByTagName("dl")[0].getElementsByTagName("dt")[0].getElementsByTagName("strong")[0].getElementsByTagName("a")[0].getElementsByTagName("span")[0].getElementsByTagName("strong")[0].innerHTML = dispName;
}
});
Tested in phpBB 3 and my console, should work.
Re: Display Name
RikudouSennin wrote:Solved and no spamming like Grey said please
Please, do wait for the original poster to mark this as solved.
Also, I think SLGray did already made that clear, no need for you to repeat it.
Re: Display Name
sir I was merely helping beccause he repeated himself twice and plus other users say solved so do iUltron's Vision wrote:RikudouSennin wrote:Solved and no spamming like Grey said please
Please, do wait for the original poster to mark this as solved.
Also, I think SLGray did already made that clear, no need for you to repeat it.
Guest- Guest
Re: Display Name
I do not wish to get into an argument now - I'm merely mentioning that I would appreciate for you to wait until the original poster has marked this as solved.
Also, if you follow the messages in this topic, you get to see that SLGray posted only once, so there is - as I mentioned above - no need for you to repeat it, the original poster has seen it.
Also, if you follow the messages in this topic, you get to see that SLGray posted only once, so there is - as I mentioned above - no need for you to repeat it, the original poster has seen it.
Re: Display Name
Please refrain from moderating members, this is a staff job.RikudouSennin wrote:Solved and no spamming like Grey said please
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Display Name
...I'm afraid that this does not work in my 2 forums . Note that I already had a field named "Display Name" set as the first profile field, and I already enabled the JavaScript. Maybe you should test it yourself in my forum (because I probably did something wrong...), I will PM you .Ultron's Vision wrote:Okay, I have some code ready, but this implies that you have the profile field "Display Name" set as 1st profile field (otherwise, you must change a number in the code below).
- Code:
jQuery(document).ready(function(){
var pp = document.getElementsByClassName("postbody");
for(var i = 0; i < pp.length; i++) {
var dispName = pp[i].getElementsByTagName("dd")[2].getElementsByClassName("label")[0].nextSibling;
/* You need to replace 0 with the number of the profile field number you have set for the display name profile field minus 1; arrays start counting at 0, not at 1, so the first element is [0], not [1], [1] is the second element. If you need help with this, post here. */
// now a long, long line
pp[i].getElementsByTagName("dl")[0].getElementsByTagName("dt")[0].getElementsByTagName("strong")[0].getElementsByTagName("a")[0].getElementsByTagName("span")[0].getElementsByTagName("strong")[0].innerHTML = dispName;
}
});
Tested in phpBB 3 and my console, should work.
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Re: Display Name
I shall have a look at it today or tomorrow (now that school is over for this year, I will definitely have more time).
Re: Display Name
OK, whenever you have time .
mybubulov3- New Member
- Posts : 12
Reputation : 1
Language : Vietnamese | English | French
Location : Ho Chi Minh City, Vietnam
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum