WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Bloody on January 22, 2008, 07:16:45 AM

Title: Put the login form/signup and account in the default template
Post by: Bloody on January 22, 2008, 07:16:45 AM
Hi,  :wink:

I'm want to Put the login form in the default template and a welcome text.
I search on WB ste but i found nothing at all.
I see the files : login_form.php, signup.php and preferences.php.
But I don't know to include in my defaul template.  :oops:
Title: Re: Put the login form/signup and account in the default template
Post by: ruebenwurzel on January 22, 2008, 07:50:02 AM
Hello,

make a WYSIWYG Page, choose the source view of the editor and put there the code from below adapted to your page:

Code: [Select]
<form class="login_table" method="post" action="http://www.yourdomain.com/account/login.php?redirect=http://www.yourdomain.com/pages/thepage where users hould be redirected after login.php" name="login">
    <table width="50%" cellspacing="0" cellpadding="5" border="0" align="center">
        <tbody>
            <tr>
                <td style="text-align: right;">User:</td>
                <td><input type="text" name="username" /></td>
            </tr>
            <tr>
                <td style="text-align: right;">Password:</td>
                <td><input type="password" name="password" /></td>
            </tr>
            <tr>
                <td style="text-align: left;">&nbsp;</td>
                <td><input type="submit" value="Login" name="submit" /></td>
            </tr>
            <tr align="left">
                <td style="text-align: center;" colspan="2"><a href="http://www.yourdoamain.com/account/forgot.php">Forgot your Login?</a></td>
            </tr>
        </tbody>
    </table>
</form>

Have fun

Matthias
Title: Re: Put the login form/signup and account in the default template
Post by: Bloody on January 22, 2008, 08:46:32 PM
Thanks a lot ruebenwurzel.
Works fine; :)
How could put a link on the frontend to admin panel if a admistrator is log.
Title: Re: Put the login form/signup and account in the default template
Post by: ruebenwurzel on January 23, 2008, 04:41:00 AM
Hello,

simply place a link to admin panel on your page. Look in the index.php of the builtin templates like round or allcss for example code.

Matthias
Title: Re: Put the login form/signup and account in the default template
Post by: Bloody on January 23, 2008, 03:35:23 PM
Wonderful !  :-D
Thanks Ruebenwurzel for your fast answers. :)
I use the php code of Allcss template.
Code: [Select]
       <?php
        
if(FRONTEND_LOGIN == &#39;enabled&#39; AND VISIBILITY != &#39;private&#39; AND $wb->get_session(&#39;USER_ID&#39;) == &#39;&#39;) {
        
?>

        <form name="login" action="<?php echo LOGIN_URL?>" method="post" class="login_table">
            <h1><?php echo $TEXT[&#39;LOGIN&#39;]; ?></h1>
            <?php echo $TEXT[&#39;USERNAME&#39;]; ?>:
            <input type="text" name="username" style="text-transform: lowercase;" />
            <?php echo $TEXT[&#39;PASSWORD&#39;]; ?>:
            <input type="password" name="password" />
            <input type="submit" name="submit" value="<?php echo $TEXT[&#39;LOGIN&#39;]; ?>" style="margin-top: 3px; text-transform: uppercase;" />
            <a href="<?php echo FORGOT_URL?>"><?php echo $TEXT[&#39;FORGOT_DETAILS&#39;]; ?></a>
                <?php if(is_numeric(FRONTEND_SIGNUP)) { ?>
                    <a href="<?php echo SIGNUP_URL?>"><?php echo $TEXT[&#39;SIGNUP&#39;]; ?></a>
                <?php ?>
        </form>
        <?php
        
} elseif(FRONTEND_LOGIN == &#39;enabled&#39; AND is_numeric($wb->get_session(&#39;USER_ID&#39;))) {
        
?>

        <form name="logout" action="<?php echo LOGOUT_URL?>" method="post" class="login_table">
            <h1><?php echo $TEXT[&#39;LOGGED_IN&#39;]; ?></h1>
            <?php echo $TEXT[&#39;WELCOME_BACK&#39;]; ?>, <?php echo $wb->get_display_name(); ?>
            <br />
            <input type="submit" name="submit" value="<?php echo $MENU[&#39;LOGOUT&#39;]; ?>" />
            <br />
            <a href="<?php echo PREFERENCES_URL?>"><?php echo $MENU[&#39;PREFERENCES&#39;]; ?></a>
            <a href="<?php echo ADMIN_URL?>/index.php"><?php echo $TEXT[&#39;ADMINISTRATION&#39;]; ?></a>
        </form>
        <?php
        
}
        
?>

    </div>
    <?php ?>