AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] How to attribute a number to each registered user

4 Posts
3 Users
3 Reactions
2,747 Views
Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@elforo)
Active Member
Joined: 7 years ago
[#7244]

Hello!

Please, how can I assign a number to each registered user in order of registration date?
I want to make a raffle and I need an order to know which user wins the prize.

Thank you
a greeting


3 Replies
Sofy
Posts: 5774
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

Hi elforo,

I'm sorry, but wpForo doesn't have such a feature. You need to use some additional plugin for this purpose, or write a custom code like this:

  https://wordpress.stackexchange.com/questions/191481/generate-unique-number-when-registering-a-new-user


VereK
Posts: 522
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@verek)
Honorable Member
Joined: 8 years ago

@elforo

Actually each user is automatically assigned a unique user id on registering and same will generally be consecutively numbered according to date and time of registration. You can see this in action if you go to Dashboard/Forums/Settings/Members/Member url structure and switch from nice name to user id. After changing that setting you will see their user id in the url.  Instead of url/profile/elforo it would be url/profile/1 for example.

As a rule of thumb the last user id will be the same as the total members as stated in the forum statics bar. However, if you have at some point deleted members then the former will not be true. There is no handy sort fields in the Member directory so in this case you should login into phpmyadmin, click on the wpforo_profiles table and click the user id column and sort it so that the latest members are displayed first.  So 1 to whatever that user id is will be your draw range.

Edit: Or, switch the url structure to "user_id", clear he WPforo caches, control+f5 on the main forum page and hover over "Our newest member" name in the forum statistics bar and that will show you the latest unique member number.


Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@elforo)
Active Member
Joined: 7 years ago

Thank you very much Sofy and VereK !!


Share: