1
possm
xoopsUser
  • 2004/7/4 17:18

  • possm

  • Just popping in

  • Posts: 2

  • Since: 2004/7/4 1


logged in as: <? echo $xoopsUser->getVar('uname')?>

i edited phpkoax for my own theme, when i use this smarty in in theme.html, for showing which user is logged in.

all the page returns is :

logged in as: getVar('uname')?>


what have i done wrong ?

2
Dave_L
Re: xoopsUser
  • 2004/7/4 17:30

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


That's PHP, not Smarty. To use PHP within a Smarty template, you would have to bracket it with <{php}>...<{/php}>, instead of using the normal PHP brackets <? ... ?> or <?php ... ?>.

But the username is already assigned as a Smarty template variable, so this should work:

Logged in as: <{$xoops_uname}>

3
tl
Re: xoopsUser
  • 2004/7/4 17:38

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


A little addition to Dave's suggestion, don't forget to use <{if ...}>:

<{if $xoops_isuser}>
logged in as: <{$xoops_uname}>
<{else}>
You are not logged in.
<{/if}>

something like that.

4
possm
Re: xoopsUser
  • 2004/7/4 17:39

  • possm

  • Just popping in

  • Posts: 2

  • Since: 2004/7/4 1


thnxz...

now i get it...

tried both of the options, and they worked... thnxz alot


Login

Who's Online

236 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 236


more...

Donat-O-Meter

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

Latest GitHub Commits