Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Quick register

edited June 2008 in Vanilla 1.0 Help
Hello everyone,

I want it to make super easy and quick for people to register. The form should be on the Vanilla index, and have only three fields:
1. desired username
2. email
3. password

After the visitor has filled these three fields, he/she will click "Register" and will be automatically logged into his/hers new account.

How to go about this?

Comments

  • Options
    you might want to take a look at & adapt this one: (sorry for the spam :P) http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=394
  • Options
    That's a login, I need register. What would I need to add/change in order to turn it into a registering form?
  • Options
    well instead of adding the signin form, add
    $ApplyForm = $Context->ObjectFactory->CreateControl($Context, "ApplyForm", "ApplicationForm");

    with a bit of css, could work
  • Options
    I tried just adding it where I'd like the form to appear but nothing happened..
    Add that where, miquel? And should it be wrapped in something?
  • Options
    where do you want it to appear?

    have you looked at the extension I mentioned? maybe you could also want to take a look at Guest Sign In, which adds a login form in the sidebar

    if you don't want to deep into the code, just give me more details and I'll try to get it

    the extension I made, just displays the same login form that appears on people.php when logging in, but css'd to fit more or less, the default vanilla styling. so changing the position (the weight) where the control (the login form) is displayed will affect in which part of the html structure will be 'echoed', tweaking its css, will affect in which part of the result page will be displayed

    hope it cleared something ;)
  • Options
    Ah ok, starting to get it now. But when I change that line you posted above in your extension, it didn't give me the registering form - it displayed nothing.

    This is your extension code:

    if($Context->Session->UserID == 0 and $Context->SelfUrl != 'people.php') { if(isset($Head)) $Head->AddStyleSheet('extensions/DirectMenuSignIn/style.css'); $SignInForm = $Context->ObjectFactory->CreateControl($Context, "SignInForm", "frmSignIn"); $Page->AddRenderControl($SignInForm, $Configuration["CONTROL_POSITION_HEAD"] + 1); if($Context->SelfUrl == 'index.php') $Context->PageTitle = $Context->GetDefinition('AllDiscussions'); } ?>

    To what should I change it to?
  • Options
    well, almost at first sight, it should be something like:if($Context->Session->UserID == 0 and $Context->SelfUrl == 'index.php') { if(isset($Head)) $Head->AddStyleSheet('extensions/name_of_the_extension/style.css'); $ApplyForm = $Context->ObjectFactory->CreateControl($Context, "ApplyForm", "ApplicationForm"); $Page->AddRenderControl($ApplyForm, $Configuration["position_in_the_html_structure"] + 1); }
  • Options
    Nope, says this error about the line below:

    "Notice: Undefined index: position_in_the_html_structure"

    $Page->AddRenderControl($ApplyForm, $Configuration["position_in_the_html_structure"] + 1);
  • Options
    edited May 2008
    well instead of $Configuration["position_in_the_html_structure"] + 1 you can put any number that will play as its weight, the lower the weight, the higher the control will display. if you want to see an example in here
    well sorry, in this case it seems to be just the other way round, just run some tests ;)
  • Options
    Ahh ok, but no luck still. No error, no nothing this time. Tried different positions too, this is the full default.php atm:

    <?php /* Extension Name: Direct Menu Sign In Extension Url: N/A Description: Adds a sign in form to the top menu if the person viewing the forum doesn't have an active session. Version: 0.1 Author: miquel Author Url: N/A Code & Inspiration from Mark O'Sullivan & WallPhone (GuestSignIn extension) Portions Copyright 2003 - 2005 Mark O'Sullivan */ if($Context->Session->UserID == 0 and $Context->SelfUrl == 'index.php') { if(isset($Head)) $Head->AddStyleSheet('extensions/name_of_the_extension/style.css'); $ApplyForm = $Context->ObjectFactory->CreateControl($Context, "ApplyForm", "ApplicationForm"); $Page->AddRenderControl($ApplyForm, $Configuration["CONTROL_POSITION_MENU"] + 1); } ?>
  • Options
    well make sure that AddStyleSheet('extensions/name_of_the_extension/style.css');is set up correctly to the path wher the css file is, and also be careful to change the name of the extension if you also have the other one enabled
  • Options
    OK, fixed the CSS path but still shows nothing. GuestSignIn disabled.
  • Options
    try to comment out the css line, so no stylesheet is added. does now the form displays itself anywhere on the page?
  • Options
    Nope, still missing in action.
  • Options
    edited May 2008
    Anyone? How to have the application/registering form appear on the main Vanilla forum?
  • Options
    Anyone? *sad puppy eyes*
    I've tried all I can with my limited code knowledge.
  • Options
    I don't know why you would want it there any more prominently than it is already.
    A link to that form is all you need, why take up space with it on the main page?

    However I'm sure there's a way to do it, you'll have to wait for a better qualified person to reply though.
  • Options
    Could still use a hand with this.
This discussion has been closed.