Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2010, 03:10 AM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Possible to use "Real Name" instead of Username?

Is it possible in Vbulletin for users to have their real name as userIDs instead of some made up username? That way when they post in Forums their real name is shown instead of some made up name (just like a facebook or myspace etc)

Can we register them with real names?

Basically in the registration form, we would change "username" to real name, but I would think Vbulletin would have a problem because obviously two people can have the same name and it wouldn't allow it.

Is there any way around this? I know that we can allow people to use their email to login, but I don't see how I can get around the duplicate usernames.

Thanks in advance.
Reply With Quote
  #2  
Old 03-07-2010, 05:21 AM
TimberFloorAu's Avatar
TimberFloorAu TimberFloorAu is offline
 
Join Date: May 2008
Location: Brisbane
Posts: 2,264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What difference does it make?

You only need to change the phrase username to realname just to keep things clean. Couple of templated edits, asking for people to enter their real name instead of a user name. Done.

Forum will not allow 2 people with same username or realname it makes little difference. They would have to add a middle initial or something.

However I think its a BAD move to get people to post their full name !
Unless you are a BY invitation only site, and even do it is begging security issues
Reply With Quote
  #3  
Old 03-07-2010, 07:14 AM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your response. I guess its back to the drawing board!
Reply With Quote
  #4  
Old 03-08-2010, 01:39 AM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
their real name is shown instead of some made up name (just like a facebook or myspace etc)
You are mistaken. Neither FB nor Myspace force users to use 'real' names. Many do, but many make up names as well. There's nothing currently preventing your users from using 'real sounding' names. You're looking for a technical solution for a problem that doesn't exist.
Reply With Quote
  #5  
Old 03-08-2010, 05:01 AM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello thank you for your response.

I was doing some research into this and I saw there was a hack a long time ago about being able to use aliases ie login with "xxxx" but "yyyy" is displayed everywhere.

I saw that the hack was for an old version, is there anything like this available for 4.0?

Basically I would want people to be able to use their own names as opposed to some usernames when displayed. Thank you.
Reply With Quote
  #6  
Old 03-08-2010, 06:32 AM
TimberFloorAu's Avatar
TimberFloorAu TimberFloorAu is offline
 
Join Date: May 2008
Location: Brisbane
Posts: 2,264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

May I ask why you want people to use their real Names ?
Reply With Quote
  #7  
Old 03-08-2010, 06:49 AM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use am interested in adding a social feed to my site (similar to facebook), and I would prefer if real names were to show up rather than usernames so its easier for people to keep track of each other.
Reply With Quote
  #8  
Old 09-05-2010, 06:58 AM
shutterfreak shutterfreak is offline
 
Join Date: Sep 2010
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe what the topic started meant, was a means to always render a display name (screen name) on the boards, and use the login name only for logging onto the boards. The display name can be the real name or any other handle a member uses on the Net.

I bet this will be much simpler to implement than hunting for all occurrences of user name and replacing them with something else. The problem is: how?

I think a solution is to modify the user table and add a displayname column and an unique index on this column. The vBulletin authentication and access control code would then the only consumer of the username field.

FWIW I also came across the vBulletin 2/3 hack to display a profile field instead of the user name. However the hack cannot readily be applied on vBulletin 4 since I believe the template engine changed in vBulletin 4 (the variable names and the syntax are different).

--------------- Added [DATE]1283720093[/DATE] at [TIME]1283720093[/TIME] ---------------

I made it work on vBulletin 4.0.6. This patch basically authenticates the login name instead of the user name. It requires adding one column to the user table and an edit of a core vBulletin file. Hence the following warning:

WARNING: DO NOT ATTEMPT THE FOLLOWING IF YOU ARE NOT ACQUAINTED WITH SQL AND PHP.

Step 1: add an indexed loginname column to the user table and to the strikes table:
ALTER TABLE user ADD loginname varchar(100) NOT NULL DEFAULT '';
CREATE INDEX loginname ON user(loginname);
ALTER TABLE strikes ADD loginname varchar(100) NOT NULL DEFAULT '';
CREATE INDEX loginname ON strikes(loginname);

The index is needed for performance reasons.

Step 2: set the loginname value for all users to the current username value:
UPDATE user SET loginname = username;
Step 3: set the username for one test user you can log on with to the display name. In my case, the display name is stored as field5 in the userfield table. Updating only the user name from a test user with user ID = 1234 can be done in my case with the following SQL query:
UPDATE user SET username = (SELECT field5 from userfield where userid = 1234) where userid = 1234;
Step 4: go to your webserver and locate the file "includes/functions_login.php".
4.1. Copy that file to functions_login.php.orig so you can revert your edit should something go wrong
4.2. Apply the following patch to functions_login.php:
Code:
--- functions_login.php.orig    Mon Aug 30 15:37:07 2010
+++ functions_login.php Thu Sep  9 18:12:35 2010
@@ -93,16 +93,18 @@

        if (!empty($username))
        {
+               // FYI - the 'strikes' table records strikes for a given username,
+               // hence we add a 'loginname' column to the 'strikes' table.
                $strikes_user = $vbulletin->db->query_first("
                        SELECT COUNT(*) AS strikes
                        FROM " . TABLE_PREFIX . "strikes
                        WHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "'
-                               AND username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'
+                               AND loginname = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($loginname)) . "'
                ");

                if ($strikes_user['strikes'] == 4)              // We're about to add the 5th Strike for a user
                {
-                       if ($user = $vbulletin->db->query_first("SELECT userid, username, email, languageid FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string($username) . "' AND usergroupid <> 3"))
+                       if ($user = $vbulletin->db->query_first("SELECT userid, username, email, languageid FROM " . TABLE_PREFIX . "user WHERE loginname = '" . $vbulletin->db->escape_string($loginname) . "' AND usergroupid <> 3"))
                        {
                                $ip = IPADDRESS;
                                eval(fetch_email_phrases('accountlocked', $user['languageid']));
@@ -114,9 +116,9 @@
        /*insert query*/
        $vbulletin->db->query_write("
                INSERT INTO " . TABLE_PREFIX . "strikes
-               (striketime, strikeip, username)
+               (striketime, strikeip, username, loginname)
                VALUES
-               (" . TIMENOW . ", '" . $vbulletin->db->escape_string(IPADDRESS) . "', '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "')
+               (" . TIMENOW . ", '" . $vbulletin->db->escape_string(IPADDRESS) . "', '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "', '" . $vbulletin->db->escape_string(htmlspecialchars_uni($loginname)) . "')
        ");
        $strikes++;

@@ -128,7 +130,7 @@
 {
        global $vbulletin;

-       $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "strikes WHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "' AND username='" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'");
+       $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "strikes WHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "' AND loginname='" . $vbulletin->db->escape_string(htmlspecialchars_uni($loginname)) . "'");
 }

 // ###################### Start set_authentication_cookies #######################
@@ -157,7 +159,7 @@
        global $vbulletin;

        $username = strip_blank_ascii($username, ' ');
-       if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
+       if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE loginname = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
        {
                if (
                        $vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') AND
Step 5: Login with this test user to verify you can still log onto the vBulletin platform.

Step 6: Go to the Admin CP > Maintenance > Rebuild thread information and then run Rebuild forum information to update the user name in threads. This may take a while on bigger boards.

I have checked with a regular user and a moderator on the boards with this hack in place. It works for both (the user can post, and the moderator can moderate the threads).

Please note that I still have to more thoroughly check all vBulletin functionality with this hack in place. Review from more experienced vBulletin developers/coders is appreciated!

I hope it is OK to post this hack here. Who knows it might get into the vBulletin code base?
Reply With Quote
  #9  
Old 09-06-2010, 08:58 PM
shutterfreak shutterfreak is offline
 
Join Date: Sep 2010
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I managed to almost entirely implement the login name / display name dissociation on vBulletin. To get the user registration bit done, I had to edit the 'register' template, which now contains the following <div> section after the login name <div>:

PHP Code:
            <div class="blockrow">
                <
label for="regloginname">{vb:rawphrase loginname}:</label>
                <
div class="rightcol">
                    <
input class="primary textbox" id="regloginname" type="text" name="loginname" maxlength="{vb:raw vboptions.maxuserlength}" value="{vb:raw loginname}" tabindex="1" />
                    <!--<
img src="{vb:raw vboptions.cleargifurl}" id="reg_verif_login_image" alt="" />-->
                    <
div id="reg_verif_login_div" class="primary" style="display:none;"></div>
                    <
script type="text/javascript" src="clientscript/vbulletin_ajax_loginverif.js?v={vb:raw vboptions.simpleversion}"></script>
                    <
script type="text/javascript">
                    <!--
                        
reglogin_verif = new vB_AJAX_LoginVerify('reglogin_verif''regloginname');
                    
//-->
                    
</script>
                    <
class="description">{vb:rawphrase enter_your_loginname}</p>
                </
div>
            </
div
This means I also had to create an AJAX script named "clientscript/vbulletin_ajax_loginverif.js" (basis is "clientscript/vbulletin_ajax_nameverif.js", edits reflect 'loginname' instead of 'username', new method name, reference to the "reg_verif_login_div" <div> element, replace the URL parts wih "do=verifyloginname", ...).

Then I had to edit ajax.php (mainly copying verifyusername() to verifyloginname() and edit accordingly), class_dm_user.php, user.php and adminfunctions_user.php in order to add the 'loginname' bits where needed.

Finally I also had to add a couple new phrases for the login text snippets:
Register Phrases Containing 'loginname'
  1. enter_your_loginname
Notices Phrases Containing 'loginname'
  1. loginname_is_valid
GLOBAL Phrases Containing 'loginname'
  1. loginname
Error Messages Phrases Containing 'loginname'
  1. fieldmissing_loginname
  2. loginname_contains_semi_colons
  3. loginnametaken
  4. loginnametaken_edit_here
  5. loginnametoolong
  6. loginnametooshort
  7. sameloginnamepass
I then edited the default text for the 'enter_your_username' phrase so it does not mention the login process anymore.

I still have to add a couple options as well, but right now I copied them from the username settings.

Eventually I should create a patch against a fresh 4.0.6 install.

Best regards,

Olivier
Reply With Quote
  #10  
Old 09-06-2010, 10:43 PM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure why you're posting in this thread, as the virtual names hack you're working on doesn't bear any resemblance to what the OP was asking for. Maybe you should be posting over in the programming forum so people could assist with that aspect.

I'm sure if I think about it I can think of several administrative options with virtual names. Like - how many people could use the same name? I guess there's no technical reason everyone on the board couldn't just use the same virtual name.

Oh, and don't even think of releasing this as a mod until there are no template edits.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04084 seconds
  • Memory Usage 2,285KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete