I wanted to add chrono forms to create event registration.
i've created a registration form, which works, but is there a way to check if the user is already logged in, and show a "register for event" form, if the user is not loggen in, then make them register/login and then show the "register for the event" form...
Thanks!
if it works, it'll solve all my problems right now🙂
i've created a registration form, which works, but is there a way to check if the user is already logged in, and show a "register for event" form, if the user is not loggen in, then make them register/login and then show the "register for the event" form...
Thanks!
if it works, it'll solve all my problems right now🙂
Shouldn't be too hard with a little creative php-coding..
First step, get the user object:
Once we've got this, we can test the uid property of the object. If it's 0, the user is not logged it, otherwise it'd be the users unique userid.
First step, get the user object:
$user =& JFactory::getUser();
Once we've got this, we can test the uid property of the object. If it's 0, the user is not logged it, otherwise it'd be the users unique userid.
if ($user->uid == 0) {
// Create form for user registration
} {
// User is registered and logged in, show the "register for event"-form.
}
This topic is locked and no more replies can be posted.