Add member ID instead of date to username

is it possible to add the member ID instead of the date when creating the username?
I don't use the username anymore only first/last name on join (version 7.1.4)

any help is welcome...

Quote · 19 Sep 2013

The member ID is created by mySQL when the record is added to the database; the field is an auto incremented field.  Therefore, you don't have access to the member ID.  What you could do in that case is to read the last member ID in use, add one to it, and then append that to the username.

Geeks, making the world a better place
Quote · 19 Sep 2013

That would be inaccurate. You would need to obtain the next index value. If the last member that was added was deleted then the next member id would not match the index thus would not be the actual member id that gets assigned to the new account.

You need to go by the index.

https://www.deanbassett.com
Quote · 19 Sep 2013

 

That would be inaccurate. You would need to obtain the next index value. If the last member that was added was deleted then the next member id would not match the index thus would not be the actual member id that gets assigned to the new account.

You need to go by the index.

Yes, this is true and I was not thinking of this.  When a member is deleted, that ID number is removed but the index is not changed and this is required or we get problems.  What Deano is saying is that if by chance the member that was deleted; either by admin or the member deleting their account, was the last account in the table, then the index is still pointing to the next number that would be assigned; the next ID number to be assigned is not necessarily going to correspond to a simple increment of the last ID value in the table; it will be an increment of the index.

Ignore my answer because it is not a valid answer.  Basically you need to know the index to know the next member ID that will be assign.

Geeks, making the world a better place
Quote · 19 Sep 2013

thanx GG and Deano for ur feedback.

i will have a look at it of how to do this with the index.
Maybe one or both of u could help me in the right direction ;-) php code example... pm maybe.

Quote · 19 Sep 2013

I am not sure which file you are working with but below is a basic guide of how you can accomplish your task.

a) Save the profile with the Nickname + Date .
   I am now assuming that you have NickName stored in variable $sNickName
 
b) Grab the member ID from the recently created profile using :
   $iNewID = db_last_id();

c) Now, update the Profile with the desired Nickname + ID using :

db_res( "UPDATE Profiles SET `NickName`=CONCAT('$sNickName','-', '$iNewID') WHERE `ID`=$iNewID");
createUserDataFile( $iNewID );

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 19 Sep 2013

My opinion is to let the user decide.  If the name is in use, let them know and they can pick something else or add their own numbers to the end.

Geeks, making the world a better place
Quote · 19 Sep 2013

in what file do i make those changes?

i run 7.1.4

 

Quote · 20 Sep 2013

I am with geek girl on this.. let the user decide if the name is in use...

Which brings me to the next question... are suggestions provided?

How is this handled as I have not tested this yet..... :)

Peer

Peer L. Plaut Executive Director, Single Booklovers Connecting Bookworms Since 1970
Quote · 21 Sep 2013

 

I am with geek girl on this.. let the user decide if the name is in use...

Which brings me to the next question... are suggestions provided?

How is this handled as I have not tested this yet..... :)

Peer

I don't think it does.  There use to be a mod in the market for nickname suggestions.

Geeks, making the world a better place
Quote · 21 Sep 2013

Yes there was a mod for nickname suggestions.

But that said, i don't use the username(nickname) on join form only first and lastname.

I let people login with there email and don't want the username(nickname) used.

Quote · 21 Sep 2013

 

Yes there was a mod for nickname suggestions.

But that said, i don't use the username(nickname) on join form only first and lastname.

I let people login with there email and don't want the username(nickname) used.

That was not clear when you first posted.  The user id is used internally for most purposes.  What I would do in this case is to make the nickname field an integer field in the database and have it auto incremented in the database and just have it the same as the ID.  Then remove the user name field from the form.  So User with ID = 324 would have nickname "324"; this is along the lines of FaceSucks.   

Addendum: There are a few other places that need changing; however, you may have already done this.  For example, the photo module creates a default profile photo album that uses the nickname by default, as in Nickname's Photos.  So that would need changing so you don't have 324's Photos.

Geeks, making the world a better place
Quote · 21 Sep 2013

GG, that was my mistake... i should have started with saying that huh...
what would you suggest for photo module fields to use?

I know faceSucks uses that ID idea but i think it's better than a stupid date.

where would i make the changes besides the DB?

Quote · 21 Sep 2013

The best way to know where nicknames show up is to set this up on a test site and play with it.  For the profile photo album, that is done in the settings of the photo module.  Some internal code uses nickname as well but it is the visual aspect that you are probably interested in.  Dolphin 7.1.4 is suppose to display the First Name + Last Name ( or others depending on how you set it).  However, that default setting for the profile album is still nickname; I have a 7.1.4 site with First Name + Last Name set, but the profile album is still nickname.  That may be the only place you need to be concern with.

Geeks, making the world a better place
Quote · 21 Sep 2013

Yes that is what i noticed too. i played around a bit and found out that the nickname is used for a lot of things under the service.

that is why i wanted to add a ID to the NickName.

if i want to try the ID to NickName first what Modzzz suggested... where or what file should i look for to change or add the code?

 

Quote · 21 Sep 2013

 

Yes that is what i noticed too. i played around a bit and found out that the nickname is used for a lot of things under the service.

that is why i wanted to add a ID to the NickName.

if i want to try the ID to NickName first what Modzzz suggested... where or what file should i look for to change or add the code?

 

The nickname is not going to be set by the user; so you are are going to set up some nickname, say User, concatenated with the ID so you end up with User1, User2, User3, User4, etc., by first creating the profile and then reading the profile.  If I understood, you are not going to let the members choose a nickname; otherwise, they can just pick what they want.  So if the nickname is never going to really be used by the members, just do what I suggested and have the nickname be the same as the ID.

The problem I have here is that you first say users won't pick a nickname and then you say you want to add the ID to the user's nickname they choose instead of date.

Geeks, making the world a better place
Quote · 21 Sep 2013

GG,

to answer ur question: So if the nickname is never going to really be used by the members, just do what I suggested and have the nickname be the same as the ID.

my answer: i won't let the members use the nickname!
it's set once on join and that's it. So i want the nickname the same as ID!!

my questions remains:

1. where do i need to change the code to make this happen? (Photo module code so i don't see the ID 324's photos)
2. where do i take the code out for adding the (nickname + date) 

thanks in advance :-)

 

Quote · 21 Sep 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.