1
raskolt
Saying Hello to Xoops signed in user
  • 2006/8/5 12:11

  • raskolt

  • Just popping in

  • Posts: 17

  • Since: 2006/3/2 2


Hello
I have designed a module. I nearly came to the end. Do you know which code allows me to connect the signed in users information.
Assume that I want to say hello to signed in XOOPS user. In the code block, which code allows it. I searched and tried codes, but I could not find it. I think there is a simple code in XOOPS that allows it.

Thanks

2
dave_uk
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 12:28

  • dave_uk

  • Not too shy to talk

  • Posts: 113

  • Since: 2005/11/27


i think <{$xoops_uname}> will display the name of the user that is logged in
Wii Plaza - Wii Fansite community

3
raskolt
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 12:56

  • raskolt

  • Just popping in

  • Posts: 17

  • Since: 2006/3/2 2


Thanks. That code does the job.
In fact, I had asked that in the code block, in php, how can I reach that information. This code works in the templates.

I will use this code to make some process, so I have to reach the user information in the php file. I think most probably it is a code like this.

4
dave_uk
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 13:01

  • dave_uk

  • Not too shy to talk

  • Posts: 113

  • Since: 2005/11/27


the same code will work in PHP you just remove the html tags so it would be {$xoops_uname}
Wii Plaza - Wii Fansite community

5
raskolt
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 15:05

  • raskolt

  • Just popping in

  • Posts: 17

  • Since: 2006/3/2 2


Thank you.

6
khuhner
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 15:23

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


I have a custom HTML block and tried both:

<{$xoops_uname}> and {$xoops_uname}

and they both just render the text

"<{$xoops_uname}>" and "{$xoops_uname}"

I know that these can be used in PHP and templates, but how can I get the user name in a custom block?

Thanks,
Kurt

7
raskolt
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 20:25

  • raskolt

  • Just popping in

  • Posts: 17

  • Since: 2006/3/2 2


I am still trying in PHP, but I could not achieve to show them in php.

I know what you are talking about. First I had tried to show these things in a custom block. Then I gave up. Now I am trying to show them in a block.

8
raskolt
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 21:22

  • raskolt

  • Just popping in

  • Posts: 17

  • Since: 2006/3/2 2


Do you know any tutorial that gives these codes together. I read some of them and I think they are giving very limited information.

I am just trying to reach a signed in XOOPS user's username(uname) in the database. I will process it and write it to the screen. How can I get the information of a XOOPS user? That is the question. Thats all.

I think the best is to examine other XOOPS modules.

9
skenow
Re: Saying Hello to Xoops signed in user
  • 2006/8/5 23:01

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


declare $xoopsUser as a global variable in your PHP code. You can then access the various attributes of the user with something like this

$username $xoopsUser->getVar('uname');


See this for more information.

10
khuhner
Re: Saying Hello to Xoops signed in user
  • 2006/8/6 0:50

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Thanks Steve!

For us not so experienced with Xoops, in what file would you recommend this code:

$username $xoopsUser->getVar('uname');


Would this value then be usedin a custom HTML block?

Thanks,
Kurt

Login

Who's Online

242 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 242


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