1
seesoe
php block
  • 2009/7/22 2:58

  • seesoe

  • Just popping in

  • Posts: 33

  • Since: 2007/1/3 4


hello, when creating a custom block, it has the option for php code. i have scripts already made to output stuff that i want to show on the block, so i am trying to put the following in a block

2
tcnet
Re: php block
  • 2009/7/22 3:22

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


Try include 'scripts/random.php';

I don't think the is needed in a custom php block.

3
seesoe
Re: php block
  • 2009/7/22 4:08

  • seesoe

  • Just popping in

  • Posts: 33

  • Since: 2007/1/3 4


perfect:) thanks, for some reason i tried that before, but it didn't work i think i actually didn't call the right file though (i remember block)

with a php block it uses pure php right?

edit:
sorry my question was unclear of what i was asking, i meant like is there XOOPS stuff that i can use? like username thats logged in and stuff?

4
MrThemeDzn
Re: php block
  • 2009/7/22 6:18

  • MrThemeDzn

  • Just popping in

  • Posts: 2

  • Since: 2009/7/22


Get uname of logged in user:
global $xoopsUser;
if (
$xoopsUser) {
  
//User is logged in, display welcome message
  
$uname $xoopsUser->getVar('uname');
  echo(
"Welcome, $uname");
} else {
  return 
false;
}

Login

Who's Online

410 user(s) are online (305 user(s) are browsing Support Forums)


Members: 0


Guests: 410


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