1
bob640
Accessing Xoops Username from outside a module
  • 2006/5/16 12:09

  • bob640

  • Just popping in

  • Posts: 10

  • Since: 2005/11/29


I have custom block on the top page and in there is a href link to a php page. I need the XOOPS username of the person clicking the link to be sent as part of the link URL. Everytime I try and include the <{$xoops_uname}> tag in the URL, it actually sends the tag rather than using the variable that the tag relates to. how could i get around this? I am using xoops's block builder to create this block.

Also;

If i wanted to access the XOOPS username variable from outside of a XOOPS module (i.e. the page that the above link relates to) then what files and code would i need to include and how would i access this variable?

Basically, the link gets the browser to display a php page in the main section of the whole page so that it is nicely wrapped by the theme etc. This page is not part of any module that is installed, its just lives in its own folder on the root directory of the site. The problem i'm having is that I need that page to know the username of the person who is veiwing it. How can i do that?

I know a reasonable amount of php but integrating it with XOOPS is a nightmare for me at the moment. Im desperate coz I have to get this page working by friday and i need to get this problem solved before then.

Cheers

Rob

2
rboyle
Re: Accessing Xoops Username from outside a module
  • 2006/5/22 20:53

  • rboyle

  • Just popping in

  • Posts: 5

  • Since: 2006/5/15


Hi Rob,

Just wondering if you made any progress or heard any wise replies - I happen to be in exactly the same position, & basically I'm looking for how to access (or what to include so that I can access) the XOOPS variables, e.g. <{$xoops_uname}>, from my own pages. I've done a trawl of the FAQs & help but no joy yet unfortunately.

Cheers

Richard

3
rboyle
Re: Accessing Xoops Username from outside a module
  • 2006/6/13 0:42

  • rboyle

  • Just popping in

  • Posts: 5

  • Since: 2006/5/15


Hi Rob,

I posted a similar question on the beginner's forum and got immediate and helpful responses, the short answer is ":

- include mainfile.php and header.php in your php file
- echo $xoopsUser->getVar('uname'); //displays username

This is "directly using $xoopsUser object".

..you can see the full thread here: Xoops Help

Login

Who's Online

282 user(s) are online (246 user(s) are browsing Support Forums)


Members: 0


Guests: 282


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