WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Login box
Ruud:
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 } ?>
--- End code ---
I use this on all mysites.
Ruud
casi:
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 } ?>
--- End code ---
Thanks Casi
vyni:
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>
--- End code ---
and remove them.
[gelöscht durch Administrator]
Ruud:
--- 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):
--- End quote ---
Just add
--- Code: ---<?php echo $wb->get_display_name(); ?>
--- End code ---
That's it.
Ruud
casi:
Fantastic!!! Cheers Ruud
Navigation
[0] Message Index
[*] Previous page
Go to full version