1
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



2
rboyle
Re: How can I access Xoops variables in my page?
  • 2006/6/13 0:27

  • rboyle

  • Just popping in

  • Posts: 5

  • Since: 2006/5/15


Many thanks for your help and your time guys, it's working now.

I offer you a free surfing lesson as a reward!


Resized Image



3
rboyle
Re: How can I access Xoops variables in my page?
  • 2006/6/12 21:56

  • rboyle

  • Just popping in

  • Posts: 5

  • Since: 2006/5/15


Thanks for the replies guys

I call my php page /modules/testme.php via a menu item, and it displays perfectly, only I need to access the username of the person logged in, as follows:

Quote:

<?php

include(XOOPS_ROOT_PATH."/header.php");//xoops stuff
include(XOOPS_ROOT_PATH."/mainfile.php");//xoops stuff
include ("mainfile.php"); //just to be sure! I copied them into same directory
include ("header.php");

echo {$xoops_uname}; //this gives me a PHP error
echo $xoops_uname; // is blank
...
...

include(XOOPS_ROOT_PATH."/footer.php");
?>


Am I missing something obvious or how can I access the value of $xoops_uname (and other variables)

Many thanks



4
rboyle
How can I access Xoops variables in my page?
  • 2006/6/12 15:35

  • rboyle

  • Just popping in

  • Posts: 5

  • Since: 2006/5/15


Hi folks,

I've got a trial installation of XOOPS working and I like it a lot, but I have one critical problem: I need to access some XOOPS variables in my custom php page, e.g. <{$xoops_uname}>, but when I refer to it I just get "<{$xoops_uname}>" displayed rather than the actual username.

I'd really appreciate if someone knows if there is a module which I need to include in my PHP page, or if I somehow need to 'turn on' smarty variable access, or what?

Many thanks,

Antonia



5
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




TopTop



Login

Who's Online

159 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 159


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