[geeklog-users] Adding Blocks to article.php

geeklog-users-admin at lists.geeklog.net geeklog-users-admin at lists.geeklog.net
Wed May 21 17:52:24 EDT 2003


>I wish to add a custom block to article.php.
>
>However, I'm not really good at coding and I was looking for a little help
>as to where I would put the code, and how could I call it from
>lib-common.php?

In what way do you mean "block"? Normally, you wouldn't add anything to lib-common.php for a block that shows up on the right or left column.

If the block contains no dynamic content, you can do it directly from the block editor.

If the block contains dynamic content (i.e., PHP code), you add the code to lib-custom.php in the "geeklog/system" directory. For example, the following will create a php_block that displays the current weekday:

function phpblock_weekday() {
	$theDayName = date('%l');
	$theText = "Today is $theDayName.";
	return $theText;
}

Any phpblock has to begin with "phpblock". You then add the function's name to the phpblock section of the block editor.

Jerry
-- 
jerry at sandiego.edu
http://www.sandiego.edu/~jerry/
Serra 188B/x8773
--
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at and repair."--Douglas Adams (Mostly Harmless)



More information about the geeklog-users mailing list