Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.2k views
in Q2A Core by

I basically would like to add a login button to each site, that holds the login form:

<FORM METHOD="POST" ACTION="./login?to=questions">
<TABLE CLASS="qa-form-tall-table">
    <TR>
        <TD CLASS="qa-form-tall-label">
            E-Mail-Adresse oder Benutzername:
        </TD>
    </TR>
    <TR>
        <TD CLASS="qa-form-tall-data">
            <INPUT NAME="emailhandle" ID="emailhandle" TYPE="text" VALUE="" CLASS="qa-form-tall-text">
        </TD>
    </TR>
    <TR>
        <TD CLASS="qa-form-tall-label">
            Passwort:
        </TD>
    </TR>
    <TR>
        <TD CLASS="qa-form-tall-data">
            <INPUT NAME="password" ID="password" TYPE="password" VALUE="" CLASS="qa-form-tall-text">
            <DIV CLASS="qa-form-tall-note"><A HREF="./forgot">Ich habe mein Passwort vergessen</A></DIV>
        </TD>
    </TR>
    <TR>
        <TD CLASS="qa-form-tall-label">
            <LABEL>
                <INPUT NAME="remember" TYPE="checkbox" VALUE="1" CLASS="qa-form-tall-checkbox">
                Auf diesem Computer eingeloggt bleiben
            </LABEL>
        </TD>
    </TR>
    <TR>
        <TD COLSPAN="1" CLASS="qa-form-tall-buttons">
            <INPUT VALUE="Einloggen" TITLE="" TYPE="submit" CLASS="qa-form-tall-button qa-form-tall-button-login">
        </TD>
    </TR>
</TABLE>
<INPUT TYPE="hidden" NAME="dologin" VALUE="1">
</FORM>

I have done that by implementing the code into an advanced theme, however, I cannot figure out how to get/set the correct login URL, see above red highlighted: ./login?to=questions

Could somebody point me in the right direction?

Thanks and happy new year!
Kai

 

I guess this is a similar, still open question:
http://www.question2answer.org/qa/16099/how-to-place-login-hyperlink-in-my-website-like-above

1 Answer

0 votes
by

Guess I found it:

            // loginbox layer with redirect to recent page ?to=
            $request=qa_request();
            $topath=qa_get('to');
            $userlinks=qa_get_login_links(qa_path_to_root(), isset($topath) ? $topath : qa_path($request, $_GET, ''));

            $this->output('<div id="loginBox">
                    <form method="post" action="'.qa_html(@$userlinks['login']).'" id="loginForm">
                     // ...
                    </form>
            </div>');
 

...