Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
building registration page into front page
I have managed to build the registration page into my front page when users are not signed in:
$UserID = $this->Request->Get('userid', Gdn::Session()->UserID); if ($UserID == 0 ) { include(CombinePaths(array(PATH_LIBRARY, 'vendors/recaptcha', 'functions.recaptchalib.php'))); echo "<div id=\"Content\">\n"; include($this->FetchViewLocation('/....snip../applications/dashboard/views/entry/registercaptcha.php')); echo "</div>\n"; }
It looks good :-)
But doesn't actually function :-(
I'm sure there is a much better way to achieve this that actually works.
Illumination will be much appreciated.
0
Best Answer
-
x00 MVP
It won't work becuase it is cargo cult
http://en.wikipedia.org/wiki/Cargo_cult_programminggrep is your friend.
0
Answers
It won't work becuase it is cargo cult
http://en.wikipedia.org/wiki/Cargo_cult_programming
grep is your friend.
Okay I accept I don't fully understand how this system works.
And you have a solution?
basically you need to reproduce the controller method code (Register), you don't need to do the post back stuff, instead you will point through the form target to the entry controller and the. It would be an idea to modularise it.
Another way is to load it through the api and javascript. This is probably the simplest for you.
$('#SomeDiv').load(gdn.url('/entry/register?DeliveryType=VIEW&DeliveryMethod=XHTML'));
grep is your friend.
I assume by this you don't mean reproducing the relevant content of registercaptcha.php within default.master.php.
So is this utilising the code from function RegisterCaptcha() in a new class to be called under the appropriate conditions?
EG