1
TinaMarieF
Blocks and modules and xoopsUser, oh my!
  • 2005/8/24 21:41

  • TinaMarieF

  • Just popping in

  • Posts: 2

  • Since: 2005/8/24


I have this bit of code:

< ?php
include '../../mainfile.php';
function dl_show($options) {

global $xoopsUser;

$domainListing[0] = "domain1.com";
$domainListing[1] = "domain2.com";
$domainListing[2] = "domain3.com";

$form['domainList'] = $domainListing;
if ($xoopsUser) {
$form['myUserName'] = $xoopsUser->getVar('uname');
}
return $form;
}
?>

This is curretly in a block, and no matter what I do, I can't seem to get $xoopsUser to be anything valid. Yes,I am logged in. I've taken out the "global $xoopsUser" statement, searched the forums, and meandered through the source code of a half-dozen modules. If I put the same code in my module's index.php, it gets the user without a problem.

I'm tearing my hair out. There's got to be something I'm not understanding about the differences between a module and a block inside a module.

Any suggestions?

Thanks!

Tina Marie

2
soconfused
Re: Blocks and modules and xoopsUser, oh my!
  • 2005/8/24 22:15

  • soconfused

  • Not too shy to talk

  • Posts: 108

  • Since: 2005/4/2 1


Hi,
If it's a custom block you need to remove the php start & end tags before it will display ie:
take out the < ?php bit at the beginning and the ?> at the end.

3
TinaMarieF
Re: Blocks and modules and xoopsUser, oh my!
  • 2005/8/24 22:17

  • TinaMarieF

  • Just popping in

  • Posts: 2

  • Since: 2005/8/24


It's not a custom block - it's a block defined by my module.

Login

Who's Online

97 user(s) are online (73 user(s) are browsing Support Forums)


Members: 0


Guests: 97


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