There have been other topics about this. E.g. see this one.
Yes, I went through all those posts but I’m getting stuck on one thing. I basically want the user to select between two options. Either join the main league, or join without entering a league.
Right now, whatever the user selects, he will always go into my league which has ID = 3. When selecting the other option, he will still be entered in that league.
I’ve been staring at that code snippet with the cases, and I can’t seem to see what I’m doing wrong. All I need for now is that they don’t get assigned to that one league if they choose the other option in the drop down.
There is no option to join a league or not with leagues enabled. You either have 2 or more leagues and have users select one, or you disable leagues and have all users in one pool.
With leagues enabled, the plugin also shows a ranking with all users (regardless of selected league), but that’s just a view on the data, not an option for the user upon registration. Offering just one league, simply means that every user has to select that league (it’s a mandatory field). Users will end up in a default league if the plugin can’t determine which league to link the user to upon registration.
So, basically I don’t see an option to support what you want. Or, I don’t understand your question, that’s also possible 😀
Maybe what I am trying does not make much sense.
WE have one main league which is linked to prizes, but we also wanted to give players the chance to create their own private league. I have a way to let someone create their own league without being an admin, but for that to happen, they need to not be entered automatically into a league.
So the idea was to have a drop down on the sign up page where you select to be added to the main league (for the prizes), or say no league (so you can create your own). You then log in and create your own league.
This approach is giving two issues however. 1) Everyone is being added in the same league regardless of choice. 2) I still would not know how you invite / add your friends after you create your private pool.
What you’re trying does make sense, but it will require some PHP coding to get it done. Basically what you want to achieve, can be done by doing one of the below.
option 1
You create two leagues and name them “main league” and “create your own”. Then let users register with these two options. You can use the auto approval extension to not be bothered as an admin about what your users choose.
Then you add your own code to have the users create their own league and automatically transfer the user to that league (the ‘no admin approval’ code shows how to set the league via code). Now this extra league is also available as an option on the registration screen and your user can reach out to their friends telling them to choose that league instead of the “main league” or “create your own”.
option 2
You seamlessly incorporate the creation of leagues in the registration process and also create an invite screen for the league admin to send messages with some unique invite ID (e.g. via email). With some clever coding this can be done, but this will require quite some work and testing.