@ character prefix for username (@username)
Hi,
I am setting up Vanilla 2.1.1 and jsConnect to connect to Vanilla to enable SSO from my membership site.
My membership site software enables the use of a unique "nickname" that I can then use to create a unique username in Vanilla. All tests out well so far.
But a bit like Twitter and to differentiate a nickname from a "real name", I would like to prefix all my nicknames, and therefore Vanilla usernames with the @ character.
First of all, I can't seem to find anything here on allowed characters for usernames.
So am I able to create and use usernames in Vanilla that are prefixed with the @ symbol?
If so, would this conflict with any other functions or plugin that I may use?
On the other side, would it have a possible benefit that the inclusion of an @username in a post, automatically creates a mention for that username?
@username to make those things work as well?
Would appreciate your thoughts and advice.
Thanks kindly,
- Neil
Answers
OK, Sorry, half answered the above question myself by trying to create an additional username with an @ prefix and got the error message.
However, in searching the forums previously I did see somewhere where foreign such as Chinese characters can be used with some tweaking of the code.
So can this same tweak be used to include the @ prefix in all usernames and, again, would that cause problems elsewhere?
Thanks again,
Well, you could use the Mentions+ plugin to allow arbitrary characters to be atmentioned.
The regex for username validation can be changed with the config setting
Garden.User.ValidationRegex
@ though, and if I were you I would really overthink this first, as I don't see a benefit in prefixing every username, especially when the character already has a similar meaning in Vanilla.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Thanks for the prompt response Blei.
Yes, I hear what you are saying but basically wanted to explore all options before proceeding.
The other thing that I am thinking of is just differentiating real user names (which are shown in my member site as well as nicknames) from nicknames/Vanilla usernames is by just showing the nicknames/Vanilla usernames across all areas in italics. I believe I should be able to do this by just adjusting the css.
I also have blogs and other user scripts and do want to keep the whole thing consistent across all areas.
So as you say, using the same constraints/formats across all areas is no doubt the best approach and I just wanted to see how far I could take that.
Usernames linked as @mentions don't have a css class, so this might be a little tricky.
If you only want real names to be displayed, maybe this is the plugin you are looking for:
http://vanillaforums.org/addon/firstlastnames-plugin
There is also a "DisplayName" plugin with a little different functionality, but it is from 2011 and only in a comment:
http://vanillaforums.org/discussion/comment/144526/#Comment_144526
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Thanks again Blei for the input.
Yeah, I have no problem with using the nicknames/Vanilla usernames, and prefer them over the real firstname/lastname.
My site management software and the jsConnect plugin both give me good control over the SSO and passing the site nickname across to Vanilla as the Vanilla username.
But the site management software also uses the eMail address as the login so I don't want to use that as a username in Vanilla and while I am able to have a real firstname/lastname username for my site it does start to get a bit messy with SSO and Vanilla - needing additional plugins, etc, as you mention.
It is also not so much having the @mention in italics as that is a class in itself but, if for example, our usernames as above were shown as Bleistivt, NeilWeston, etc. that may just be enough to keep the names in consistent format if I also show the nicknames on my site in italics.
Please also see my response below to vrijvlinder as another alternative that may even be exactly what I am after.
Thanks again
Thanks vrijvlinder.
Does that physically change the username itself, or just format the username with the prepended @?
Is it just a "formatting" adjustment?
In other words, a possible solution may be that in real terms, the actual username and nicknames may be just that.
So they would really be just, vrijvlinder, Bleistivt, NeilWeston, etc and that is how they are held and manipulated.
But when they are displayed on a page, they are displayed (formatted) as @vrijvlinder, @Bleistivt, @NeilWeston, etc so that even in a mention they would show just as @vrijvlinder.
No it does not change the Username as it appears in the database. This simply adds it on the page as it is displayed. Doing this might cause a double @ if you use quotes plugin or any other plugin which adds it. I have not tested this to see if the double one happens but it is a possibility. Just add the script to your master and test it yourself.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Thanks again vrijvlinder,
Yes on that basis it could perhaps work, so I will give it a try.
If I can find the appropriate Vanilla style sheet and classname for the username I also had the thought of trying it through css with the "content" property. e.g.;
.username:before {
content: "@";
font-style: italic;
}
As you say, hopefully one of these will not conflict with any other plugin, but if they pull the username straight out of the database and not off the formatted page, it may be OK.
I will give them both a try and report back in case anyone wants to do a similar thing.
I don't think this much point in changing the name in the database.
I also don't it is good ides using @ becuase it is confused with mentions.
I think the cosmetic css solution is best.
perhaps a better idea is using nothing or, instead of using a nickname removing the white space out of their full name for their around and cammel casing for vanilla accounts.
I just think an extra character would be more of an inconvenience than useful.
grep is your friend.
I guess there is still something that you are not aware of. Look at that:
a) NeilWeston
b) @NeilWeston
Although a) is a user name, there is no way to style it. It is just a word in a sentence and I think that is how it should behave. Guess one of your users calls himself "user" - there would be quite a lot false links if you would implement some automatic "WordToUserProfileLinkBot" (but I would love to see the icon, @vrijvlinder would create for that)
If your user names in the database would all start with "@", theoretically@mention a user. But look at b)! If you write a normal user name with a prefixed "@ you are already where you want to be: there is a link to the profile and the name is prefixed with an @".
So I would say, you are thinking to complicated: if someone wants to specifically write down the name of a user, the user name has to be prefixed with something so that there will not be any false positives for users that have chosen normal words as user names.
If you dictate usernames a special form, you are adding a complexity to the mention mechanism that ensures that every username in a post is a link, but the price is some kind of awkwardness, when all user names are prefixed with a special character.
But you could think about a js approach to help your users: look what's happening here when you start mentioning someone. There is a lookup right after the first letter that you type: you could monitor the input of users and whenever there is a match between the input of a normal word and a username, you could show a dropdown to the user so that he can easily "accept" this proposal and the js will prepend the just type word with a "@", so that the normal mention mechanism can be used.
Thank you x00 and R_J.
So far everyone has convinced me to definitely not force people to adopt a username prefixed with the @ symbol so that it is how it appears in the database.
But I am still seriously thinking about the css or jQuery option as above.
I guess my other limitation is that I have not been an active user of Vanilla so far and therefore do not know how people use it and all of the associated plugins.
So please correct me if I am wrong here, but how many times would a user actually type another user's name into any part of the forum?
For example, if your usernames were visually represented here by formatting alone as "@x00" and "@R_J" clicking on your username link in that @ format should still take me to your x00 and R_J profiles shouldn't it, as it is only a visual representation of the link? (A bit like "click here" where the actual link is not what you see.)
So it would seem the inclusion of the @ symbol in the formatting is not going to change anything there.
If I were to enter your usernames by ignoring the @ formatting it would be the same as I did above when I entered "x00 and R_J". Again, nothing seems to be any different.
If I do pick up the formatted @ symbol and enter "@x00" and "@R_J" (without the quotes) that would then still pick up as a mention or bring up the drop down - albeit that the names would not represent in the list with the @ symbol before them. That may promote a few extra unintentional mentions but would that be so bad?
So all in all, nothing would seem to change from a usage factor, other than how the usernames appear at the top of each post.
Does that sound correct?
But are there other places within the program or add-ons where this could be a problem?
it depends on how you so it. if you do
:before
it won't change the link itself.But as other pointed out detecting this in posts is more difficult and fraught with false positives.
grep is your friend.