Hey , guys I am trying to create another registration page .
I've created it and added it to the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
But when I try to access it through this url www.mysite.com/index.php?action=registerdonator
I get this error " Unable to load the 'main' template. "
Any Ideas ?
Well, it's expecting to have a template to display on said page. By default $context['sub_template'] contains 'main' which means it will try to run a template function called template_main() which must have already been loaded by a loadTemplate() call during your action.
Hard to tell you any more without more information.
Moved this...Arantor answered better than what I was going to ask. But I'll have a go anyway. How exactly are you coding this?
Thank you .
Here is what i did :
I have duplicated the register.php file and created and named the other file register_donator.php which means that they both are the same , but when I try to access the register_donator.php file using index.php?action=registerdonator I get the error .
Please tell me if you need more information .
How you added it to the action array would be useful. Not that it would work properly anyway if you tried to do that, for at least half a dozen other reasons.
Why a separate registration file anyway? So people can donate as soon as they register? People do not generally do that.
This is how i added it to the action array :
'activate' => array('register_donator.php', 'Activate'),
'coppa' => array('register_donator.php', 'CoppaForm'),
'registerdonator' => array('register_donator.php', 'registerdonator'),
I also added it here :
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'registerdonator', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))
Actually , People have already donated and the donations are off .
This file link will be sent to donators to make them join the donators group without asking for a request .
I have added a code that will add them to a requestable group without the admin approval .
I would explain but I get the distinct feeling you won't listen and will try and bodge it together your own way... there's no possible way that will work currently.
I'm not disputing that you'll get donations. I'm disputing the nature of donate-at-registration, never seen it pulled off successfully before.
Can you please explain how to make the other php file work ?
I will listen to you , please tell me how to do it . :(
Without providing code bits and file names, can you describe what you are trying to achieve?