1
alfredxz
username in the home page
  • 2003/11/13 15:55

  • alfredxz

  • Just popping in

  • Posts: 15

  • Since: 2003/2/11


hi,
i want to include in my home page a short "Welcome back, [username]" with the username that varies depending on which user logs in.
so i edited [theme]%2Ftheme.html and created a login box:



User:

Pass:


 

Join



  Welcome back, _tpl_vars['user_realname']; ?>


Unfortunately it only works while browsing the User Page, the other pages give a "Welcome back,." with no username.
What function shall i include to make it work???

2
hsalazar
Re: username in the home page
  • 2003/11/25 6:29

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


alfredxz:

This code will suffice (of course, add the necessary code for the login form):

<{if !$xoops_isuser}>

<{else}>
Hello, <{$xoops_uname}>
<{/if}>

This code goes in the theme.html file, most probably in the header, but you can in fact use the variable anywhere.

Now, if you NEED this to go in a block, please read

https://xoops.org/modules/newbb/viewtopic.php?topic_id=12057&forum=14#forumpost48232

Cheers.

3
alfredxz
Re: username in the home page
  • 2003/11/25 17:32

  • alfredxz

  • Just popping in

  • Posts: 15

  • Since: 2003/2/11


Thanks a lot!

It worked with:
_tpl_vars['xoops_uname']; ?>

4
Mithrandir
Re: username in the home page

We generally don't advise people to edit the compiled templates, but instead change the templates through the template editor in the admin menu

Login

Who's Online

248 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 248


more...

Donat-O-Meter

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

Latest GitHub Commits