Fastpage Help

Category Section - Plugin Module

 <<previous | next>>
  Customised Modules
 


Click here to return



 



The Plugin Structure

  • The module is created off the plugins folder and you name the folder to indentify the plugin module
  • There are three folders you must create off your new folder
    - admin
    - editor
    - engine

Your main plugin root folder or as per the example diagram above 'pluginstructure'
There is one file you must create in this folder called - install.inc.php

class Installer extends FastpagePlugin {

var $PluginVersion; //plugin version number
var $PluginName=""; //Actual Display name of plugin (nospaces)
var $PluginDescription=""; //Plugin Description
var $PluginContainer="";
var $MenuModule=Y; //menu module active Y/N
var $EngineModule=Y; //engine module active Y/N
var $Systype=array("null"); //name of entity for types system
var $SepTable="Y"; //Whether you need seperate database tables for your plugin Y/N
var $NewTables="";
";
var $UpdateTables=""; //The update sql syntax (NB: you must upgrade data step by step. You can't got from version 1.1 to 1.5, you must go 1.1-1.5 else the database will get damaged
}

ALL THE ABOVE VARIABLES ARE REQUIRED

PHP Class VariableExampleDetails
$PluginVersion="xxx";var $PluginVersion="1.0"; Enter a string to identify the version number you want to assign to the module
$PluginName="xxx";$PluginName="securepage";Display string used by the plugin module 'Manage Utility' to identify the module you have created
YOU CAN NOT HAVE SPACES IN THIS NAME
$PluginDescription="xxx";$PluginDescription="Secure page module";Future USE, but a friendly name for the PLUGIN
$PluginContainer="xxx";$PluginContainer="securepage";The actual folder name
$MenuModule=Y;$MenuModule=Y;Boolean Y or N - to include information on the ADMIN menu bar}
$EngineModule=Y;$EngineModule=Y;Boolean Y or N - to include information to be included in the fpengine.php module
var $Systype=array("null");$Systype=array(searchresults=>'Search Engine Results',searchbox=>'Site Search Engine Box');Defines additional entity types - MUST BE UNIQUE NAMES - Prefix with Plugin name

Array Structure

System Type (database use)Description (used by the Drop Down)

var $SepTable=Y;var $SepTable=Y;Boolean Y or N - Tells installer to look for a table to insert
var $NewTables="";var $NewTables="CREATE TABLE searchcache (
cacheid int(15) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
description text NOT NULL,
url varchar(255) NOT NULL default '',
body text NOT NULL,
PRIMARY KEY (cacheid),
FULLTEXT KEY mainindex (title,description,body)
)
";
SQL statement for the table structure (triggered by the variable above)

MUST BE A VALID SQL STATEMENT
var $UpdateTables="";"ALTER TABLE menu ADD previousimg varchar(255) NOT NULL default '',
ADD nextimg varchar(255) NOT NULL default '',
ADD previousinact varchar(255) NOT NULL default '',
ADD nextinact varchar(255) NOT NULL default '',
ADD bulletimg varchar(255) NOT NULL default '',
ADD returntext varchar(64) NOT NULL default ''');

SQL statement for the table structure (triggered by the variable above)

MUST BE A VALID SQL STATEMENT

Note the updates must be in sequence - if you have version 5.0 released but the client is still on an old release you must carry the update out in stages until you get to the right version.

IF YOU DON'T DO THIS YOU WILL CORRUPT YOUR DATABASE