The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Show Real Names on Forum
We recently converted in FUDforum. We have always required "Real Names" in order to post in the forum. Here, there is no field for an Alias to display throughout the site.
Searching through the forums, I found multiple posts on having a custom profile field's entry display above each specific post. Is there a way to replace any display of a username throughout the entire site with that custom profile field's entry? (Display Name or Real Name) Thanks |
#2
|
|||
|
|||
Not without mass editing all your templates (and i do mean mass editing there would be alot)
Thats the only way i could think of doing this |
#3
|
||||
|
||||
You could try creating a replacement variable.
|
#4
|
|||
|
|||
What is a replacement variable?
|
#5
|
||||
|
||||
Admin CP -> Styles & Templates -> Style Manager -> Replacement Variables
|
#6
|
|||
|
|||
Quote:
What is the user-name variable called right now? Thanks |
#7
|
|||
|
|||
<a href="https://vborg.vbsupport.ru/showthread.php?t=228961" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=228961</a>
|
#8
|
|||
|
|||
Quote:
--------------- Added [DATE]1296524323[/DATE] at [TIME]1296524323[/TIME] --------------- Quote:
|
#9
|
|||
|
|||
Not sure if what I did will be of help for this topic. Hopefully someone else will get some use out of it. It works great for my environment. I'm using vBulletin 4.1.2
I wanted users to login with their email addresses, but have their names display when they post on the forum. For my message board, I will be registering all my users. So in username, I just put their full name. But when they log in all they will have to do is enter their email address. (Instead of logging in as "Art Vandelay", just avandel@domain.com) I went into phpMyAdmin and created a new table in my vbulletin database called 'user_alias'. 'user_alias' has two fields - 'login' and 'display'. I then edited vBulletin's code. I added a statement in the registration code so the alias will be inserted into my newly created table whenever I add a new user in admincp. So open admincp/user.php and around line 1060 right before Code:
// save data $userid = $userdata->save(); Code:
/**add user alias*/ $emailAddress = $vbulletin->GPC['user']['email']; $displayName = $vbulletin->GPC['user']['username']; //make sure not already in user_alias $result = mysql_query("select * from user_alias where displayName = '$displayname'"); if ( mysql_num_rows($result) == 0){ mysql_free_result($result); $useralias_query = "insert into user_alias(display,login) values('$displayName','$emailAddress')"; $result = mysql_query($useralias_query) or die("failed to insert username alias"); } mysql_free_result($result); I then added some php to another vBulletin file to query the database and lookup the user's alias whenever someone logs in. The file is 'login.php' around line 100, right before Code:
// can the user login? $strikes = verify_strike_status($vbulletin->GPC['vb_login_username']); Code:
//change login name to display name $login_name = $vbulletin->GPC['vb_login_username']; $useralias_query = "select display from user_alias where login = '$login_name'"; $result = mysql_query($useralias_query) or die("failed alias name lookup"); $row = mysql_fetch_array($result, MYSQL_NUM); if(! empty($row[0])){ $vbulletin->GPC['vb_login_username'] = $row[0]; } mysql_free_result($result); So now when someone logs in they use their email, but it actually will log them in as their fullname. This of course can be customized a bunch of different ways. For instance if everyone on the messageboard will have the same domain name "@whatever.com" you could have them login with just the first part of their email. Or you could edit the user registration instead of the admin registration to do this. Just follow the first php edit except find a way to do it in register.php located in the root of the website. -Joe Corall |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|