Installation & configuration

Please note: This page is under construction and has not been finished yet.

Introduction

Folder structure & files

The table below lists the files that can be used in a plugin. Only few of them are mandatory.

Note: Please replace the cursive plugin with the name of the plugin folder. (*menu.php, *_setup.php, *_shortcodes.php, *_sql.php).

TIP: the _blank plugin contains useful examples as reference material.

plugin.xml

Elements & attributes

Examples

Simple

<?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="Newsfeeds" version="2.0" date="2012-08-01" compatibility="2.0" installRequired="true">
	<author name="e107 Inc." url="http://e107.org" email="@" />
	<description>This plugin's description.</description>
	<category>content</category>
	<adminLinks>
		<link url='admin_config.php' description='Configure Newsfeeds' icon='images/icon_32.png' iconSmall='images/icon_16.png' >LAN_CONFIGURE</link>	
	</adminLinks>
	<siteLinks>
		<link url="/e107_plugins/newsfeed/newsfeed.php" >Newsfeeds</link>
	</siteLinks>	
</e107Plugin>

Advanced

<?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="FAQs" version="1.1"  lan="LAN_PLUGIN_XXX_NAME" date="2012-08-01" compatibility="2.0" installRequired="true">
	 <author name="e107 Inc" url="http://www.e107.org" email="@" />
	<summary>Add frequently asked questions to your e107 website.</summary>
	<description  lan="LAN_PLUGIN_XXX_DESCRIPTION">A simple plugin to add Frequently Asked Questions to your website.</description>
	 <copyright>Copyright e107 Inc e107.org, Licensed under GPL</copyright>
	<category>content</category>
	<keywords>
		<word>faq</word>
		<word>question</word>
		<word>answer</word>
	</keywords>
	<adminLinks>
		<link url='admin_config.php' description='Configure FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png' primary='true'>LAN_CONFIGURE</link>		
	</adminLinks>
	<siteLinks>
		<link url='/e107_plugins/faqs/faqs.php' description='FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png' function="faqCategories">LAN_PLUGIN_FAQS_NAME</link>		
	</siteLinks>
	<pluginPrefs>
		<pref name="add_faq">255</pref>
		<pref name="submit_question">255</pref>
		<pref name="classic_look">0</pref>
	</pluginPrefs>
	<dependencies>
		<plugin name='chatbox_menu' />
		<plugin name='calendar_menu' min_version='3.70' />
		<PHP name='core' min_version='5.2.5' />
		<MySQL name='server' min_version='4.9' />
		<extension name='curl' min_version='1.3' />
		<extension name='mb_string' />
	</dependencies>
	<userClasses>
		<class name="faq_moderator" description="FAQ moderator" />		
	</userClasses>
	<extendedFields>
		<field name="viewed" type='EUF_TEXTAREA' default='0' active="true" />
		<field name="posts" type='EUF_INTEGER' default='0' active="true" />
	</extendedFields>	
</e107Plugin>

Commercial plugins

Example

<e107Plugin name="FAQs" .... price="25.00" currency="EUR" url="http://direct-path-to-my-plugin-purchase-page.com" >

plugin_menu.php

....

plugin_setup.php

Do not forget to use your plugin name in the filename, e.g. "myplugin_setup.php"

TODO: Add this section, provide example.

plugin_shortcodes.php

Please refer to the Plugin shortcodes page

plugin_sql.php

Do not forget to use your plugin name in the filename, e.g. "myplugin_sql.php"

This file contains the SQL database structure of the plugin. It will be analyzed on plugin install and missing tables will be installed automatically.

Any differences between the defined structure here and the table structure on the server will be detected and the user will be informed in the Admin Area.

Supported operations

For the moment, the following operations are supported:

  • Create table

  • Change field type, field size, field null or not, field default value

  • Add index

Unsupported operations

Operations that are currently NOT supported are:

  • Rename table: by renaming the tablename, e.g. "blank" > "blank2"). The renamed table will be considered as new!

  • Drop a table: e.g. if you remove the "blank" table definition from this file, the table will NOT be deleted from the database!)

  • Rename or drop a field: a renamed field will be considered new, a missing field definition will NOT be recognized at all!

  • Change an index/key: the change is recognized, but leads to an error message and the change is not applied.

  • Rename or drop an index/key: rename is recognized as a new index and the missing index is not recognized at all!)

  • A field definition containing "NULL DEFAULT NULL". The "Check for updates" method will always detect a change.

  • but fails silently when trying to update. In that case remove the first "NULL" and run the the "Check for updates" again.

Example

CREATE TABLE blank (
  `blank_id` int(10) NOT NULL AUTO_INCREMENT,
  `blank_icon` varchar(255) NOT NULL,
  `blank_type` varchar(10) NOT NULL,
  `blank_name` varchar(50) NOT NULL,
  `blank_folder` varchar(50) DEFAULT NULL,
  `blank_version` varchar(5) NOT NULL,
  `blank_author` varchar(50) NOT NULL,
  `blank_authorURL` varchar(255) NOT NULL,
  `blank_date` int(10) NOT NULL,
  `blank_compatibility` varchar(5) NOT NULL,
  `blank_url` varchar(255) NOT NULL,
  `blank_media` json DEFAULT NULL,
  `blank_class` int(10) NOT NULL,
  PRIMARY KEY (`blank_id`)
) ENGINE=MyISAM;

admin_config.php

Please refer to the Admin-UI (User Interface) page.

Last updated