Skip to Content Skip to Menu

Auto-generate numeric username

  • Battra
  • Battra
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #163155 by Battra
Auto-generate numeric username was created by Battra
Does CB support auto-generation of numeric username?

My client already has a list of members, each is assigned a unique membership ID (numeric). If I manually import the existing members to CB, can it do the following for new members?

1. Membership is paid annually (possibly using CB + SB Subs)
2. Hide username field from registration form
3. Once registration process is completed, username will be automatically generated based on the last membership ID. For example, if the last member's membership ID is 1200 then the new member will be assigned 1201 and so on.
4. Members will log in using their membership ID and password

I found 2 old posts discussing similar issue but I can't conclude if they will solve my current problem, especially #3 above. There should be some kind of counter that keep track the last membership ID generated.

www.joomlapolis.com/forum/154-advanced-members-support/151682-solved-can-i-use-this-hack-for-email-as-username#151682
www.joomlapolis.com/forum/159-wishlist/152046-numeric-usernames--numeric-membership-ids

Please Log in or Create an account to join the conversation.

  • Battra
  • Battra
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #163721 by Battra
Replied by Battra on topic Re: Auto-generate numeric username
No one? I assume this is not possible then?

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2174
  • Thanks: 463
  • Karma: 352
13 years 7 months ago #163955 by beat
Replied by beat on topic Re: Auto-generate numeric username
CB allows to autogenerate username from Email at registration.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • Battra
  • Battra
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #164061 by Battra
Replied by Battra on topic Re: Auto-generate numeric username
That's not exactly my question. I need auto-increment numeric username. Is this possible with CBSubs + any of the add-on/incubator project?

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2174
  • Thanks: 463
  • Karma: 352
13 years 7 months ago #164095 by beat
Replied by beat on topic Re: Auto-generate numeric username
Probably the CB Queries from incubator could be your solution here:

www.joomlapolis.com/cb-solutions/incubator

Execute fully customizable database queries when CB events happen. This tool can be used to provide rudimentary integration with other bridged scripts. You can even connect to external host databases!


Using the on after new user creation and on after registration events you could set jos_users-username = jos_users.id

And not show username at registration, so that cb auto-fills it based on email before your trigger sets it to id.

I didn't try above, but it might work, if your joomla version accepts such all-numeric usernames. Otherwise prefix in the query with an alphanumerical character.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • Battra
  • Battra
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #164100 by Battra
Replied by Battra on topic Re: Auto-generate numeric username
Thanks! That sounds doable. I'll go ahead with the purchase once my client approve the budget :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum