Version 5

Tutorial - Liberty Plugins

Created by: Lee LaMont Bell Jr., Last modification: 16 Jul 2005 (06:35 UTC) by Lee LaMont Bell Jr.
In this tutorial, I will try to explain Liberty Plugins, how they work, and what is needed to create or modify them.

So - why should I learn this?

By creating a Liberty Plugin, an administrator or developer is adding functionality to his site. This functionality has a lot of bang for the buck because a Liberty Plugin accesses the Liberty Storage System, which is used by most of the Packages.

Liberty Plugins can be fairly simple or extremely complex. They provide a good place for a beginners to play and learn. At the minimum - all that is required is a little knowledge of HTML / the PHP language / and the ability to look things up.

-=
The Plugin “Comment” will be used in the first part for this Tutorial
=-

What does the Plugin do?

The Comment Plugin is the simplest Plugin imaginable. All it does is - well - nothing. In doing "nothing" - it does allow text to be stored in a page that is not displayed or processed in any way.

How is a Plugin used?

The Comment Plugin (unlike most Plugins) operates on text encased between a pair of Code Blocks. A Code Block is the name of the Plugin within a pair of curly brackets “{“ and “}” like this:
{COMMENT } The Text Inside the Block {COMMENT}
In this case - the Comment Plugin prevents the text from being displayed.

To make Plugins more functional, additional information (parameters) can be passed to it. The parameters are added to the first code block in the form of parameter_name=’value’. Each Plugin defines the names of the parameters and what is expected. Most Plugins accept multiple parameters – which are separated by a space character.
Please Note: The 'Value' does not always have to be encased in quotes. A single number (123456) / single words like TRUE / FALSE / or KeyWords (defined by the plugin) do not require quotation. Strings Do! Any text that contains whitespaces or non-alphanumeric characters is considered to be a String and Has to be quoted. The quote character can be either a single quote or a double quote (characters ' or ").
Note 2: Capitolization is not manditory. {COMMENT } = {comment } / and / PARAMETER_NAME = Prameter_Name = parameter_name.

Where do I find these Plugins?

The best way to become fluent with the Liberty Plugins is to use them. A complete listing of all Active Plugins can be found at the bottom of the page while editing a Page. Look for the Plugin Help tab. Be sure to select “More Details” to see all of the parameters for the Plugin as well as an example or two.
The actual files are stored in the Liberty/Plugins directory. The files use a strict file naming convention that must be adhered to. For our Example Plugin, the filename is “data.example.php”.

A Little History

A lot of the Plugins in bitweaver have been around since the split from TikiWiki. The Bonnie version of TikiPro gave most of them a face-lift and a lot of standardization. When the Liberty Package was introduced - all of the Plugins were re-evaluated and most of them were completely rewritten.

The File Name / Function Name Standard

There are several types of Plugins used in the Liberty Package. This Tutorial only deals with Data Plugins - but there are Format and Storage Plugins as well. A Data Plugin is Always Named "data.name_of_plugin.php. The Liberty Package requires that each Plugin have it's own GUID (more on this later) and every data.x.php file is examined when bitweaver starts so that it's GUID can be extracted. The nice thing about this is that it allows a lot more flexibility in Function Naming.

The Sections in a Plugin

Each Plugin has 4 basic sections. They are:__
  1. Copyright
  2. Initialization
  3. Help Function
  4. Load Function__

The Copyright Sections

[+]

The Initialization Sections

[+]

The Help Function Sections

[+]

The Load Function Sections

[+]
Page History
Date/CommentUserIPVersion
19 Jul 2005 (08:40 UTC)
Lee LaMont Bell Jr.68.95.129.2511
Current • Source
Lee LaMont Bell Jr.68.95.129.259
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.129.258
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.129.257
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.129.256
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.139.2165
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.139.2163
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.139.2161
View • Compare • Difference • Source