1
recupsoft
Trying to display the username
  • 2006/8/5 18:11

  • recupsoft

  • Friend of XOOPS

  • Posts: 151

  • Since: 2003/10/30


Hi,
I've created a usermenu, so not using the default one, from admin / block / new block in php script.

But I'm blocked to valid 2 tests inside:

- if user belongs to moderator group (g_id=4) then ...

- if username = "toto" then ...

For instance, I tried with
if ($this->_tpl_vars["xoops_uname"] == "toto")
for example but I doesn't work

Maybe wrong test, something missing before... Thx for help.
FR/EN sites: OverFiles.com + TotalJeux.fr / FR seulement : Sos-Adsl.com + PlaneteFree.fr

2
nekro
Re: Trying to display the username
  • 2006/8/5 18:19

  • nekro

  • Quite a regular

  • Posts: 213

  • Since: 2005/11/9


try with --->
if ($xoopsUser->getVar('uname') == "toto")

Luck!

3
recupsoft
Re: Trying to display the username
  • 2006/8/5 18:30

  • recupsoft

  • Friend of XOOPS

  • Posts: 151

  • Since: 2003/10/30


if ($xoopsUser->getVar("uname") == "toto")
{ echo "bingo"; } else { echo "wrong"; }
=> site display wrong

if ($xoopsUser->getVar("uname") = "toto")
{ echo "bingo"; } else { echo "wrong"; }
=> no site display problem but no result on screen.

if ($this->_tpl_vars["xoops_uname"] == "toto")
{ echo "bingo"; } else { echo "wrong"; }
=> always displays "wrong".

Maybe a "global;" or something else before "if..." ?
FR/EN sites: OverFiles.com + TotalJeux.fr / FR seulement : Sos-Adsl.com + PlaneteFree.fr

Login

Who's Online

276 user(s) are online (170 user(s) are browsing Support Forums)


Members: 0


Guests: 276


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