Universal Plugin ToolKit

From GeeklogWiki
Revision as of 20:19, 10 May 2008 by Dirk (talk | contribs) (Changed category)

Jump to: navigation, search

The Universal Plugin Toolkit provides the files to quickly get past the requirements of the plugin API in Geeklog and get down to the business of writing your plugin application. It consists of all the necessary files you will need to interface your code with Geeklog. It includes:

  • A debugged reusable Install page and routine
  • A fleshed out functions.inc that includes the uninstall routine
  • Skeletal admin and index files
  • Template Based and all templates included
  • Sample english language file containing language for Install/Admin/Index pages
  • Instructions on how to use it
  • Sample Slogan Plugin made with the toolkit

Included Files:

  • install.php
  • install.thtml
  • english.php
  • admin/index.php
  • admin.thtml
  • index.php
  • index.thtml
  • functions.inc
  • plugin.gif
  • universalplugin_1.0_1.3.7.tar.gz


How to use the Universal Plugin Toolkit

After copying the files to their proper locations, the first thing you should do is decide on a name for your plugin and using your file editor change all instances of {plugin}, in functions.inc, public_html/index.php, admin/index.php, and admin/install.php, to the name of you plugin. Note: due to the use of the gl_vars table your plugin name should not be over 15 characters.

Second open up config.php and insert the names of any tables you want to create. This allows them to be included in the $_FILES array. See example in file. The $_FILES as well as all the install/deinstall arrays contains sample data to give you an idea of what goes here. You can expand or contract these arrays as you need.

Next open up the admin/install.php file and fill in three arrays. The first array holds the name of your tables and the sql required to create them. The second array holds the sql commands required to insert any sample or default data in your tables. The third array contains your security features. You should also update the variables at the top of the file containing your plugin name, version, and url.

Open up english.php and change the name of the $LANG_PL00 array to whatever name you have chosen for your plugins language array.

Finally open up functions.inc and insert in the uninstall_plugin function the names of your tables and security features, so that the plugin can be uninstalled.

Now change all instances of {plugin} with the name of your plugin in admin/index.php and public_html/index.php, if you have not done so already.

At this point you should have a skeletal functioning plugin -- run the install page and it will show up in Geeklog. Now write your code and share it with the rest of the Geeklog community.

If any of this is confusing (how could that be?), you can also examine the enclosed sample Slogan Plugin that was constructed with the Universal Plugin Toolkit in about 20 minutes. Or for a more advanced example, examine Blaine's Chatterblock 3.0 plugin.