1
shelley
my custom block
  • 2003/12/7 6:47

  • shelley

  • Just popping in

  • Posts: 31

  • Since: 2003/10/8


Because if I create a new block html and I put this code
$name $xoopsUser->getVar("uname");$email $xoopsUser->getVar("email");echo "nome $name";?>
echo "email $email"?>


in preview it works

and in home page I have this result?

getVar("uname"); $email = $xoopsUser->getVar("email"); echo "nome $name"; ?>

2
finalfiler
Re: my custom block
  • 2003/12/7 7:18

  • finalfiler

  • Documentation Writer

  • Posts: 111

  • Since: 2002/1/19


Have you tried setting content type to PHP?

regards


3
shelley
Re: my custom block
  • 2003/12/7 12:24

  • shelley

  • Just popping in

  • Posts: 31

  • Since: 2003/10/8


yes
but using php the block is empty

4
jlm69
Re: my custom block
  • 2003/12/7 12:44

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


Try removing the opening and closing php tags, in a block you don't need them, they are already assumed when you select php script.

5
shelley
Re: my custom block
  • 2003/12/7 13:09

  • shelley

  • Just popping in

  • Posts: 31

  • Since: 2003/10/8


I removed...
this way:

$name $xoopsUser->getVar("uname");
$email =$xoopsUser->getVar("email");
echo 
"nome $name";
echo
"email $email";



but now in home page a blank page...

6
jlm69
Re: my custom block
  • 2003/12/7 13:25

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I have a question.
What it looks like, you are trying to make a block to display username and email in a block. First question is why? Next, What if they are anonymous? Are you only letting registered users use this block? What exactly are you wanting to do in this block. Maybe we can find a better way to do what you want.


7
robekras
Re: my custom block
  • 2003/12/7 13:28

  • robekras

  • Documentation Writer

  • Posts: 187

  • Since: 2002/12/10


This will work:

global $xoopsUser;

$name $xoopsUser->getVar("uname");
$email =$xoopsUser->getVar("email");
echo 
"nome $name";
echo
"email $email";



8
shelley
Re: my custom block
  • 2003/12/7 13:53

  • shelley

  • Just popping in

  • Posts: 31

  • Since: 2003/10/8


jlm69, Thanks, but this is simply a test

robekras, Great!!!
I have not put the global declaration


Login

Who's Online

304 user(s) are online (181 user(s) are browsing Support Forums)


Members: 0


Guests: 304


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