1
44444
Php block
  • 2008/9/13 10:18

  • 44444

  • Just popping in

  • Posts: 15

  • Since: 2008/4/16


Hi everyone!

I have a question... I want to create php block with XOOPS user variables, but it works only with html :( and only with one system template block called system_block_user.html. There I can put <{$xoops_uname}> and as result I'll have user name. That's ok. But if I make php block, there is only one variable working - {X_SITEURL}, and no like {X_UNAME}! That's bad.
I tryed to recode /class/xoopsblock.php with something like this

elseif ( $c_type == 'P' ) {
                
ob_start();
                echo eval(
$this->getVar('content''N'));
                    
$content ob_get_contents();
                    
ob_end_clean();
                return 
str_replace('{X_SITEURL}'XOOPS_URL.'/'$content);


to

elseif ( $c_type == 'P' ) {
                
ob_start();
                echo eval(
$this->getVar('content''N'));
                    
$content ob_get_contents();
                    
ob_end_clean();
                return 
str_replace('{X_SITEURL}'$user->getVar("uname"), $content);


and many others

but nothing happened :(

Plz anybody tell me how to make this thing..
TNX!

2
trabis
Re: Php block
  • 2008/9/13 14:42

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1



3
44444
Re: Php block
  • 2008/9/13 15:27

  • 44444

  • Just popping in

  • Posts: 15

  • Since: 2008/4/16


?Thak you so!
But that code doesn't working :(

4
44444
Re: Php block
  • 2008/9/15 17:52

  • 44444

  • Just popping in

  • Posts: 15

  • Since: 2008/4/16


Don't matter...
Another problem is non-working some php-functions.
$fls = file_get_contents ("{X_SITEURL}file.php");
echo "$fls";// NOT WORKING!
But echo "{X_SITEURL}file.php"; we can see that the way is right!
I can't understand what is wrong!
HLP!

5
44444
Re: Php block
  • 2008/9/16 12:36

  • 44444

  • Just popping in

  • Posts: 15

  • Since: 2008/4/16


hello, people!!!

Login

Who's Online

417 user(s) are online (309 user(s) are browsing Support Forums)


Members: 0


Guests: 417


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