Posted on: 09/02/02 10:36pm
By: Anonymous (Anonymous)
is it possible to do that? i have a script blah.php and i want to show it's outout in the block. thanks
PHP script output in the block?
Posted on: 09/03/02 12:22am
By: Dirk
Yes, that's possible. Create a block of type "PHP block" and make a function that returns the output of your script to Geeklog. I.e. your script should not use echo, print, etc. but collect the output in a string and return that string to Geeklog. It will then show up in the block.
bye, Dirk
PHP script output in the block?
Posted on: 09/03/02 06:51am
By: Anonymous (Anonymous)
is it possible to enable php commands in blocks? or is it possible to use php "include" in lib-common.php?
PHP script output in the block?
Posted on: 09/03/02 09:01am
By: efarmboy
It is possible to do both - as a phpblock type.
Examples of simple phpblocks - which are defined in lib-custom.php:
-------
function phpblock_blocktest () {
$display = "Hello World";
return $display;
}
-------
function phpblock_getweather () {
global $_CONF;
$path = $_CONF['path_html'] . "weather";
include_once($path . "/display_weather.php"
;
$display = getweather();
return $display;
}
-------
You will notice how the block output is assigned to a variable and appended as it's build. The output text in $display is then returned and formatted into the block.
The second example is where the phpblock calls an external main file which is written to return it's final assembled output text in a variable which is assigned to $display and then finally returned to the GL code for formatting into the block.
Blaine