Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 02:08:25 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155555
Posts in
21715
Topics by
7737
Members
Latest Member:
gx-world
WebsiteBaker Community Forum
English
Templates, Menus & Design
(Moderator:
Argos
)
Login box
Pages: [
1
]
Go Down
Author
Topic: Login box (Read 3515 times)
dominic
Offline
Posts: 34
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
---------------------------------------------------------------
Business Strategy Articles:
www.businessatwar.c
om
dominic
Offline
Posts: 34
Re: Login box
«
Reply #1 on:
March 07, 2007, 12:23:31 AM »
Code:
<?php
if(
FRONTEND_LOGIN
==
'enabled'
AND
VISIBILITY
!=
'private'
AND
$wb
->
get_session
(
'USER_ID'
) ==
''
) {
?>
<form name="login" action="
<?php
echo
LOGIN_URL
;
?>
" method="post" class="login_table">
<?php
echo
$TEXT
[
'USERNAME'
];
?>
:
<input type="text" name="username" style="text-transform: lowercase;" />
<?php
echo
$TEXT
[
'PASSWORD'
];
?>
:
<input type="password" name="password" />
<input type="submit" name="submit" value="
<?php
echo
$TEXT
[
'LOGIN'
];
?>
" style="margin-top: 3px; text-transform: uppercase;" /><br />
<a href="
<?php
echo
FORGOT_URL
;
?>
">
<?php
echo
$TEXT
[
'FORGOT_DETAILS'
];
?>
</a>
<?php
if(
is_numeric
(
FRONTEND_SIGNUP
)) {
?>
<a href="
<?php
echo
SIGNUP_URL
;
?>
">
<?php
echo
$TEXT
[
'SIGNUP'
];
?>
</a>
<?php
}
?>
</form>
<?php
} elseif(
FRONTEND_LOGIN
==
'enabled'
AND
is_numeric
(
$wb
->
get_session
(
'USER_ID'
))) {
?>
<form name="logout" action="
<?php
echo
LOGOUT_URL
;
?>
" method="post" class="login_table">
<?php
echo
$TEXT
[
'LOGGED_IN'
];
?>
<br />
<?php
echo
$wb
->
get_display_name
();
?>
<br />
<input type="submit" name="submit" value="
<?php
echo
$MENU
[
'LOGOUT'
];
?>
" />
<br />
<a href="
<?php
echo
PREFERENCES_URL
;
?>
">
<?php
echo
$MENU
[
'PREFERENCES'
];
?>
</a>
<br />
<a href="
<?php
echo
ADMIN_URL
;
?>
/index.php">
<?php
echo
$TEXT
[
'ADMINISTRATION'
];
?>
</a>
</form>
<?php
}
?>
Found this in one of the templates, does it look right?
Dominic
Logged
---------------------------------------------------------------
Business Strategy Articles:
www.businessatwar.c
om
kweitzel
Forum administrator
Offline
Posts: 6977
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
WebsiteBaker Org e.V. - for WebsiteBaker
orko3001
Offline
Posts: 110
Re: Login box
«
Reply #3 on:
October 07, 2007, 06: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
Please assume I have searched for the answer first - because I have.
Vincent
Offline
Posts: 360
Re: Login box
«
Reply #4 on:
October 08, 2007, 09: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
kweitzel
Forum administrator
Offline
Posts: 6977
Re: Login box
«
Reply #5 on:
October 08, 2007, 01:15:50 PM »
Just make a menu link to the login form ... that will do what you want.
cheers
Klaus
Logged
WebsiteBaker Org e.V. - for WebsiteBaker
orko3001
Offline
Posts: 110
Re: Login box
«
Reply #6 on:
October 09, 2007, 10: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
Please assume I have searched for the answer first - because I have.
Ari Lindholm
Offline
Posts: 31
Re: Login box
«
Reply #7 on:
October 09, 2007, 10: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
Offline
Posts: 49
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
ruebenwurzel
WebsiteBaker Org e.V.
Offline
Posts: 7973
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
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2298
Re: Login box
«
Reply #10 on:
March 18, 2008, 12:28:23 AM »
Try this in (the footer) of your template index.php
Code:
<?php
if(
FRONTEND_LOGIN
==
'enabled'
AND
$wb
->
get_session
(
'USER_ID'
) ==
''
) {
?>
<a href="
<?php
echo
WB_URL
;
?>
/account/login.php" target="_top">Login</a>
<?php
} elseif(
FRONTEND_LOGIN
==
'enabled'
AND
is_numeric
(
$wb
->
get_session
(
'USER_ID'
))) {
?>
<a href="
<?php
echo
WB_URL
;
?>
/account/logout.php" target="_top">Logout</a>
<?php
}
?>
I use this on all mysites.
Ruud
Logged
Professional WebsiteBaker Solutions
casi
Offline
Posts: 49
Re: Login box
«
Reply #11 on:
July 05, 2008, 10: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:
<?php page_footer
();
?>
© 2008 Zischtigs Club Lozä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
==
'enabled'
AND
$wb
->
get_session
(
'USER_ID'
) ==
''
) {
?>
<a href="
<?php
echo
WB_URL
;
?>
/account/login.php" target="_top">Login</a>
<?php
} elseif(
FRONTEND_LOGIN
==
'enabled'
AND
is_numeric
(
$wb
->
get_session
(
'USER_ID'
))) {
?>
Welcome: display Username here | <a href="
<?php
echo
WB_URL
;
?>
/account/logout.php" target="_top">Logout</a>
<?php
}
?>
Thanks Casi
Logged
vyni
Offline
Posts: 566
Re: Login box
«
Reply #12 on:
July 05, 2008, 11:03:44 AM »
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:
<tr>
<td class="logout"> <a href="
<?php
echo
ADMIN_URL
;
?>
">
<?php
echo
$MENU
[
'PREFERENCES'
];
?>
</a>
</td>
</tr>
and remove them.
«
Last Edit: July 05, 2008, 11:25:06 AM by vyni
»
Logged
PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen, ungefähr verfolgen und glauben.
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2298
Re: Login box
«
Reply #13 on:
July 05, 2008, 11:10:19 AM »
Quote from: casi on July 05, 2008, 10: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:
<?php
echo
$wb
->
get_display_name
();
?>
That's it.
Ruud
Logged
Professional WebsiteBaker Solutions
casi
Offline
Posts: 49
Re: Login box
«
Reply #14 on:
July 05, 2008, 03:46:01 PM »
Fantastic!!! Cheers Ruud
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...