WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Login box
  • Print
Pages: [1]   Go Down

Author Topic: Login box  (Read 12559 times)

dominic

  • Guest
Login box
« on: March 06, 2007, 11:51:08 PM »
I probably am missing it in the wiki docs, but what is the include code for the login box?

Dominic
Logged

dominic

  • Guest
Re: Login box
« Reply #1 on: March 07, 2007, 12:23:31 AM »
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">
<?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;" /><br />
<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">
<?php echo $TEXT[&#39;LOGGED_IN&#39;]; ?>
<br />
<?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>
<br />
<a href="<?php echo ADMIN_URL; ?>/index.php"><?php echo $TEXT[&#39;ADMINISTRATION&#39;]; ?></a>
</form>
<?php
}
?>



Found this in one of the templates, does it look right?

Dominic
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Login box
« Reply #2 on: March 07, 2007, 07:52:27 AM »
Indeed the Login has been left out of the basic template tutorial.

In general you can take the code for the login out of any existing template we do have on offer at the add-on repository. You just need to style the output according to your template needs.

cheers

Klaus
Logged

orko3001

  • Guest
Re: Login box
« Reply #3 on: October 07, 2007, 07:38:12 PM »
Hi, I just want to add a login box onto the main body of one page. Can that be don or done or do i need to build a new template?
Logged

Offline Vincent

  • Posts: 376
  • Gender: Male
    • websites voor ondernemers
Re: Login box
« Reply #4 on: October 08, 2007, 10:01:59 AM »
Hi Orko,

haven't tested, but I suppose it should be possible using the 'code'-section. So what you do is open the page in WB admin and click 'manage sections', add a section 'code' and paste the code there. What you'll get is a login field in the content area, unless of course you've made a section block somewhere else in your page.

The other solution you suggested yourself: make a new template and assign that one to your page.

Regards,
Vincent
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Login box
« Reply #5 on: October 08, 2007, 02:15:50 PM »
Just make a menu link to the login form ... that will do what you want.

cheers

Klaus
Logged

orko3001

  • Guest
Re: Login box
« Reply #6 on: October 09, 2007, 11:01:44 PM »
Quote
Just make a menu link to the login form ... that will do what you want.
cheers
Klaus

That'll log you into the backend. I want people to stay with the frontend. But I only want a login box on one page.

I put the above code into a code box and got this:

Parse error: syntax error, unexpected '<' in /home/site/public_html/modules/code/view.php(30) : eval()'d code on line 4

The code box seems to delete my php tags once saved :s

Cheers
Logged

Ari Lindholm

  • Guest
Re: Login box
« Reply #7 on: October 09, 2007, 11:51:01 PM »
Have you tried to leave <? and ?> marks out from that code (if you want to use paste that code trick)?
< http://forum.WebsiteBaker.org/index.php/topic,3773.0.html#msg23496 >

Other method: Personally i would try to use 2 almost similar templates, one with login code-part in template and other without it. And assign those templates right pages.
This could keep your things much clearer i think...
Logged

gilly

  • Guest
Re: Login box
« Reply #8 on: March 17, 2008, 06:07:28 AM »
Im having the exact same issue as Orko.

I want my login form to be on its own page, with a simple text link to it on each page. When the user logs in they get to see content in the navigation that they wouldnt see if they werent logged in.

I get the same parse error when I put the login script into the Code box, and I have tried both with and without the php tags at the start and end.

I have tried using the 2 templates method, and although this works, is not at all suitable. If its setup like this, and I need to change the CSS or the layout in one template, means I need to make the change in both templates, repackage them, reupload them both. Doesnt sound like a very efficient solution to me.

Could the code be somehow built into the template, but only be displayed when the user is visiting a certain page (eg on a member-login.php page?

Orko, did you come up with a solution?
Logged

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Login box
« Reply #9 on: March 17, 2008, 07:37:20 AM »
Hello,

so why didn't you simply do what you wanna do?

1. Create a "hidden" WYSIWYG Page by using the default template with a login form in it.
2. Place a link to this page in the index.php of your template.

This way, if a user hits the login link a new page is openene with only your login form.

Matthias
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Login box
« Reply #10 on: March 18, 2008, 12:28:23 AM »
Try this in (the footer) of your template index.php

Code: [Select]
<?php if(FRONTEND_LOGIN == &#39;enabled&#39; AND  $wb->get_session(&#39;USER_ID&#39;) == &#39;&#39;) { ?>
 <a href="<?php echo WB_URL; ?>/account/login.php" target="_top">Login</a>
<?php } elseif(FRONTEND_LOGIN == &#39;enabled&#39; AND is_numeric($wb->get_session(&#39;USER_ID&#39;))) { ?>
 <a href="<?php echo WB_URL; ?>/account/logout.php" target="_top">Logout</a>
<?php } ?>

I use this on all mysites.

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline casi

  • Posts: 106
Re: Login box
« Reply #11 on: July 05, 2008, 11:34:59 AM »
Hi Ruud

This works great. Do you have an idea how the logged in user could bes displayed with his name (username):

Code: [Select]
<?php page_footer(); ?>&copy; 2008 Zischtigs Club Loz&auml;rn | Design by <a href="http://www.casi.ch" target="_blank">casi.ch</a> | <a href="http://start.WebsiteBaker.org/" target="_blank">WebsiteBaker</a> | <?php if(FRONTEND_LOGIN == &#39;enabled&#39; AND  $wb->get_session(&#39;USER_ID&#39;) == &#39;&#39;) { ?>
 <a href="<?php echo WB_URL; ?>/account/login.php" target="_top">Login</a>
<?php } elseif(FRONTEND_LOGIN == &#39;enabled&#39; AND is_numeric($wb->get_session(&#39;USER_ID&#39;))) { ?>

Welcome: display Username here | <a href="<?php echo WB_URL; ?>/account/logout.php" target="_top">Logout</a>

<?php } ?>

Thanks Casi
Logged

vyni

  • Guest
Re: Login box
« Reply #12 on: July 05, 2008, 12:03:44 PM »
Hi there,
it´s easy to change the code from an existing template. For example Round. Have a look there.
I made such modifications in the past - give it a try, copy and past the responding login/logout lines to Your template and that´s it.

And if You don't want the link to the backend at all - just find this lines in index.php
Code: [Select]
     <tr>
          <td class="logout"> <a href="<?php echo ADMIN_URL; ?>"><?php echo $MENU[&#39;PREFERENCES&#39;]; ?></a>
           </td>
     </tr>
and remove them.



[gelöscht durch Administrator]
« Last Edit: July 05, 2008, 12:25:06 PM by vyni »
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Login box
« Reply #13 on: July 05, 2008, 12:10:19 PM »
Quote from: casi on July 05, 2008, 11:34:59 AM
This works great. Do you have an idea how the logged in user could bes displayed with his name (username):

Just add
Code: [Select]
<?php echo $wb->get_display_name(); ?>
That's it.

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline casi

  • Posts: 106
Re: Login box
« Reply #14 on: July 05, 2008, 04:46:01 PM »
Fantastic!!! Cheers Ruud
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Login box
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2