Difference between revisions of "Block Types"

From GeeklogWiki
Jump to: navigation, search
m
m (Added category + cosmetics)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
There are four different Block types that have completely independent functionalities:
 
There are four different Block types that have completely independent functionalities:
  
<h2>Default Blocks</h2>
+
== Default Blocks ==
 
These blocks are built-in and cannot be deleted. They can be deactivated however. Usually, only their name, helpfile, position, and permissions can be changed.
 
These blocks are built-in and cannot be deleted. They can be deactivated however. Usually, only their name, helpfile, position, and permissions can be changed.
  
<h2>PHP Block</h2>
+
== PHP Block ==
This block usually calls a function that is provided by a plugin or standard functionality of geeklog. The name of the php function is entered in the "Block Function:"-Field. Concerning the function entered, there is the following text displayed in the standard layouts:
+
This block usually calls a function that is provided by a plugin or standard functionality of geeklog. The name of the PHP function is entered in the "Block Function:" field. Concerning the function entered, there is the following text displayed in the standard layouts:
  
"If you would like to have one of your blocks use PHP code, enter the name of the function above. Your function name must start with the prefix "phpblock_" (e.g. phpblock_getweather). If it does not have this prefix, your function will NOT be called. We do this to keep people who may have hacked your Geeklog installation from putting arbitrary function calls that may be harmful to your system. Be sure not to put empty parenthesis "()" after your function name. Finally, it is recommended that you put all your PHP Block code in /path/to/geeklog/system/lib-custom.php. That will allow the code to stay with you even when you upgrade to a newer version of Geeklog."
+
<blockquote>
 +
If you would like to have one of your blocks use PHP code, enter the name of the function above. Your function name must start with the prefix "<code>phpblock_</code>" (e.g. <code>phpblock_getweather</code>). If it does not have this prefix, your function will '''not''' be called. We do this to keep people who may have hacked your Geeklog installation from putting arbitrary function calls that may be harmful to your system. Be sure not to put empty parenthesis "<code>()</code>" after your function name. Finally, it is recommended that you put all your PHP Block code in <tt>/path/to/geeklog/system/lib-custom.php</tt>. That will allow the code to stay with you even when you upgrade to a newer version of Geeklog."
 +
</blockquote>
  
 
These blocks can provide a very large variety of functions, only depending on the function used.
 
These blocks can provide a very large variety of functions, only depending on the function used.
Line 13: Line 15:
 
A PHP block will only be displayed if the function actually returned any content to be displayed in the block. This can be used to create blocks that only show up on certain conditions.
 
A PHP block will only be displayed if the function actually returned any content to be displayed in the block. This can be used to create blocks that only show up on certain conditions.
  
<h2>Portal Block</h2>
+
== Portal Block ==
 
The Portal Block is diplaying an RSS/RDF feed. The content can not be changed since it is completely determined by the content of the RSS/RDF file. For a new block, at least the complete URL of the RSS/RDF-file has to be given.
 
The Portal Block is diplaying an RSS/RDF feed. The content can not be changed since it is completely determined by the content of the RSS/RDF file. For a new block, at least the complete URL of the RSS/RDF-file has to be given.
  
<h2>Normal Block</h2>
+
Also see [[Limit Portal Block Entry]].
The Normal block usually is a simple HTML-text, that can contain announcements, links and even advertising. It can be used as a Navigation-tool and link to static pages as well as external sites.
 
  
Geeklog assumes that a normal block contains HTML-formatted content when the very first character of the block content is a < character (for an opening tag). If it is any other character, Geeklog assumes the content to be plain text and will translate linebreaks to HTML BR tags.
+
== Normal Block ==
 +
The Normal Block usually is a simple HTML text, that can contain announcements, links and even advertising. It can be used as a navigation tool and link to static pages as well as external sites.
 +
 
 +
Geeklog assumes that a normal block contains HTML formatted content when the very first character of the block content is a < character (for an opening tag). If it is any other character, Geeklog assumes the content to be plain text and will translate linebreaks to HTML <code><br></code> tags.
 +
 
 +
 
 +
[[Category:Blocks]]

Latest revision as of 18:28, 12 May 2009

There are four different Block types that have completely independent functionalities:

Default Blocks

These blocks are built-in and cannot be deleted. They can be deactivated however. Usually, only their name, helpfile, position, and permissions can be changed.

PHP Block

This block usually calls a function that is provided by a plugin or standard functionality of geeklog. The name of the PHP function is entered in the "Block Function:" field. Concerning the function entered, there is the following text displayed in the standard layouts:

If you would like to have one of your blocks use PHP code, enter the name of the function above. Your function name must start with the prefix "phpblock_" (e.g. phpblock_getweather). If it does not have this prefix, your function will not be called. We do this to keep people who may have hacked your Geeklog installation from putting arbitrary function calls that may be harmful to your system. Be sure not to put empty parenthesis "()" after your function name. Finally, it is recommended that you put all your PHP Block code in /path/to/geeklog/system/lib-custom.php. That will allow the code to stay with you even when you upgrade to a newer version of Geeklog."

These blocks can provide a very large variety of functions, only depending on the function used.

A PHP block will only be displayed if the function actually returned any content to be displayed in the block. This can be used to create blocks that only show up on certain conditions.

Portal Block

The Portal Block is diplaying an RSS/RDF feed. The content can not be changed since it is completely determined by the content of the RSS/RDF file. For a new block, at least the complete URL of the RSS/RDF-file has to be given.

Also see Limit Portal Block Entry.

Normal Block

The Normal Block usually is a simple HTML text, that can contain announcements, links and even advertising. It can be used as a navigation tool and link to static pages as well as external sites.

Geeklog assumes that a normal block contains HTML formatted content when the very first character of the block content is a < character (for an opening tag). If it is any other character, Geeklog assumes the content to be plain text and will translate linebreaks to HTML
tags.