1
jonyk
Re: Custom Block which calls a function from an include file
  • 2006/11/9 3:19

  • jonyk

  • Just popping in

  • Posts: 4

  • Since: 2006/11/9


This is what I got if I use the 2nd option:
Warning [PHP]: Unknown(): URL file-access is disabled in the server configuration in file /home/mypage/public_html/html/class/xoopsblock.php(146) : eval()'d code line 7
Warning [PHP]: Unknown(http://www.mypage.com/html/test_special.php): failed to open stream: no suitable wrapper could be found in file /home/mypage/public_html/html/class/xoopsblock.php(146) : eval()'d code line 7
Warning [PHP]: (null)(): Failed opening 'http://www.mypage.com/html/test_special.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in file /home/mypage/public_html/html/class/xoopsblock.php(146) : eval()'d code line 7

Not sure why my ISP disable it tough =).



2
jonyk
Re: Custom Block which calls a function from an include file
  • 2006/11/9 2:29

  • jonyk

  • Just popping in

  • Posts: 4

  • Since: 2006/11/9


I have also tried using absolute path, but still in vain.

Did you also call a function from the include?
I think include is working, just that you can't call the function from the include file.



3
jonyk
Re: Custom Block which calls a function from an include file
  • 2006/11/9 2:18

  • jonyk

  • Just popping in

  • Posts: 4

  • Since: 2006/11/9


Thanks for your reply m0nthy.

I did all what u said but problem still persist.

I wonder if include/require in custom block does not actually means including the file like normal php file?

Thanks.



4
jonyk
Custom Block which calls a function from an include file
  • 2006/11/9 0:49

  • jonyk

  • Just popping in

  • Posts: 4

  • Since: 2006/11/9


I created a custom block with code:
require('\test_lib.php');
test();

the test_lib.php:
<?
function test()
{
echo "testing...";
}
?>

Amazingly the output complaining that test() is not defined. I dont' get it.

Another funny thing is that if I wrap my custom block code into its own php file for example wrapper.php, then in the custom block,i wrote:
require('wrapper.php');
then the code works.

The problem is that my ISP disallow the 2nd option.

Anyone has any clues?

Thanks.




TopTop



Login

Who's Online

215 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 215


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits