basically a second username field

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: basically a second username field

Post by Ather »

also one more thing,

Open :
includes/ucp/ucp_register.php

Find :

Code: Select all


             // Game Username For Registration - Ather
                    'game_username'         => array('string', false, $config['min_name_chars'], $config['max_name_chars']),
        // Game Username For Registration - Ather
     
 
Replace With :

Code: Select all


                 // Game Username For Registration - Ather
                        'game_username'         => array('string', true, 5, 255),
            // Game Username For Registration - Ather
     
 
The previous code used the min & max length from the acp (which is used for username), so if the value is left empty, it will say value is too short, i've fixed it in the code for already reg'd users
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

registering with minecraft name works perfectly :D

but when i try to change it in profile it gives me an error (also, i can live with it but it made all the text on the profile page bigger :S)

Code: Select all

SQL ERROR [ mysql4 ]

Column 'minecraft_username' cannot be null [1048]

SQL

UPDATE phpbb_users SET minecraft_username = NULL, user_icq = '', user_aim = '', user_msnm = '', user_yim = '', user_jabber = '', user_website = '', user_from = '', user_occ = '', user_interests = '', user_notify_type = '0', user_birthday = ' 0- 0- 0' WHERE user_id = 2

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: includes/ucp/ucp_profile.php
LINE: 380
CALL: dbal_mysql->sql_query()

FILE: includes/functions_module.php
LINE: 507
CALL: ucp_profile->main()

FILE: ucp.php
LINE: 327
CALL: p_master->load_active()
User avatar
topdown
Registered User
Posts: 635
Joined: Wed Sep 19, 2007 5:16 pm
Location: NE Wisconsin
Name: Jeff Behnke
Contact:

Re: basically a second username field

Post by topdown »

In phpMyAdmin under the users table click Structure at the top.
Then click the edit icon for the field minecraft_username
Set the default dropdown to None
Save

Then check the page with the issue again.
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

still the same

Code: Select all

SQL ERROR [ mysql4 ]

Column 'minecraft_username' cannot be null [1048]

SQL

UPDATE phpbb_users SET minecraft_username = NULL, user_icq = '', user_aim = '', user_msnm = '', user_yim = '', user_jabber = '', user_website = '', user_from = '', user_occ = '', user_interests = '', user_notify_type = '0', user_birthday = ' 0- 0- 0' WHERE user_id = 2

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: includes/ucp/ucp_profile.php
LINE: 380
CALL: dbal_mysql->sql_query()

FILE: includes/functions_module.php
LINE: 507
CALL: ucp_profile->main()

FILE: ucp.php
LINE: 327
CALL: p_master->load_active()


just in case the errors different
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: basically a second username field

Post by 4_seven »

topdown wrote:In phpMyAdmin under the users table click Structure at the top.
Then click the edit icon for the field minecraft_username
Set the default dropdown to None *
Save
* remove value NOT NULL from minecraft_username column.

or is it the same :?:
Current Mods | Mod Base | php(BB) programming | No help via PM
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: basically a second username field

Post by Ather »

open /includes/ucp/ucp_profile.php
find:

Code: Select all

 'game_username'         => array('string', true, 5, 255),
replace with:

Code: Select all

 'game_username'         => array('string', false, 5, 255),
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

The value you entered is too short.

registering with it is fine still.
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

this would be a good time to mention that i've replaced game_username each time with minecraft_username (in caps etc the same)
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: basically a second username field

Post by Ather »

Hmm that could be the issue, u might have messed up some edits, try doing the orignal edits because they worked fine till this morning for me..even after adding the UCP option
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

usin game_username didnt make a difference
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

http://pastebin.com/3SZcrAWB ucp_register in styles/template

http://pastebin.com/nctyc7fE ucp_profile_profile_info in styles/template

http://pastebin.com/2FWyXD5r ucp_profile in includes/ucp

http://pastebin.com/m3JY66Br ucp_register in includes/ucp


thats all the files that i edited, switched back to minecraft instead of game
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

really need help with this :(
i know its to do with how the profile page is fillin out the field...
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

'minecraft_username' => utf8_normalize_nfc(request_var('minecraft_username', '', true)),


could something be missing here? other fields have

'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
Patey
Registered User
Posts: 17
Joined: Sun Aug 28, 2011 7:20 am

Re: basically a second username field

Post by Patey »

Code: Select all

'minecraft_username' => utf8_normalize_nfc(request_var('minecraft_username', '', true)),

had to be

Code: Select all

'minecraft_username' => utf8_normalize_nfc(request_var('minecraft_username', $user->data['minecraft_username'], true)),
Locked

Return to “[3.0.x] MOD Requests”