1
cybz96
A little question about a php code
  • 2005/9/7 1:50

  • cybz96

  • Just popping in

  • Posts: 4

  • Since: 2005/8/26


Hello, I found a little script to alternate between login and logout depending on what the user is. Here it is:

<{if $xoops_isuser}>
<{$xoops_uname}>&nbsp;<a href="<{$xoops_url}>/user.php?op=logout">Logout</a>&nbsp;~&nbsp;<a href="<{$xoops_url}>/user.php">Account</a>
<{else}>
nbsp;<a href="<{$xoops_url}>/user.php">Log in</a>&nbsp;of&nbsp;<a href="<{$xoops_url}>/register.php">Register</a>nbsp;
{/if}

It gives me an error, probably a stupid one:"syntax error: unclosed tag {else}". How do i close it?

And also, i'd like to display the user name, like: Welcome, anonymous, Welcome (name). Can u help me with this one? Thanks

2
davidthomas1
Re: A little question about a php code

Is it just me or should that last {/if} tag be an <{/if}> ??

i.e

<{if $xoops_isuser}>
<{
$xoops_uname}>&nbsp;<a href="<{$xoops_url}>/user.php?op=logout">Logout</a>&nbsp;~&nbsp;<a href="<{$xoops_url}>/user.php">Account</a>
<{else}>
nbsp;<a href="<{$xoops_url}>/user.php">Log in</a>&nbsp;of&nbsp;<a href="<{$xoops_url}>/register.php">Register</a>nbsp;
<{/if}>


good luck!

D
みんなちがってみんないい。

XOOPS 2.0.13.2

3
cybz96
Re: A little question about a php code
  • 2005/9/7 15:14

  • cybz96

  • Just popping in

  • Posts: 4

  • Since: 2005/8/26


YEA i knew it was a stupid mistake. thanks. Can anyone tell me how to display the name of the user?

4
adrock
Re: A little question about a php code
  • 2005/9/7 16:01

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


Quote:

<{if $xoops_isuser}>Welcome Back <{$xoops_uname}>!
<{else}>Welcome Guest!
<{/if}>


Enjoy!
Affordable Web Hosting - Family - Fun!...and not always in that order!

Login

Who's Online

154 user(s) are online (111 user(s) are browsing Support Forums)


Members: 0


Guests: 154


more...

Donat-O-Meter

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

Latest GitHub Commits