1
martyboy
Need some help with smarty code for login bar
  • 2006/8/19 11:08

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


Hi, I have been trying to put a login bar into a theme, this is what I am trying to acchieve:

When a guest visits the site they see
Quote:
Welcome Guest (Login | Register)

with Login and Register linking to user.php and register.php then when they login I want them to see
Quote:
Welcome Username
with the Username linking to thier profile.

This is the code I had tried which resulted in an internal error

Welcome <{if $xoops_isuser == false}>Guest 
      
( <a href="<{$xoops_url}>/user.php">Login</a> | <a href="<{$xoops_url}>/register.php">Register</a
      ) <{/if}><{if 
$xoops_isuser> <a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a><{/if}>


I am guessing ive got the smarty code totally wrong, could someone be kind enough to post the correct code for what I am try8ing to achieve?

Thanks
Michael Jackson = King Of Pop

Xoops = King Of CMS

2
Herko
Re: Need some help with smarty code for login bar
  • 2006/8/19 12:45

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Try this:
Welcome <{if $xoops_isuser}><a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a><{else}>Guest       (<a href="<{$xoops_url}>/user.php">Login</a> | <a href="<{$xoops_url}>/register.php">Register</a>)<{/if}>


I haven't tried this, but it should work.

Herko

3
msdana
Re: Need some help with smarty code for login bar
  • 2006/8/19 17:29

  • msdana

  • Just can't stay away

  • Posts: 817

  • Since: 2005/12/11


This will also work:

<{if !$xoops_isuser}>
Welcome Guest (<a href="<{$xoops_url}>/user.php">Login</a> | <a href="<{$xoops_url}>/register.php">Register</a>) 
<{else}>
Welcome <a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a><{/if}>

[size=x-small]If God is watching us, the least we can do is be entertaining.[/size]
Graphic Worx : Xoops Themes

Login

Who's Online

158 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits