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.

Filename / Foldername
Description
Mandatory?

languages (folder)

English language files

templates (folder)

Contains all the meta data needed for the plugin to be installed and configured on a basic level.

Yes

No

Allow to run code before or after (un)installing the plugin, or to set checks for newer plugin versions.

No

...

No

Contains the database structure.

No

No

e_*.php addons

No

plugin.xml

Elements & attributes

Element
Sub
Attributes
Text / Value
Mandatory?

<e107Plugin>

Yes

name

Yes

version

Yes

date

Yes

lan

No

compatibility

Yes

installRequired

Yes

<author>

name

Yes

url

Yes

email

Yes

<description>

Textual description of the plugin

Yes

lan

LAN reference to the description

No

<copyright>

Copyright text

?

<category>

Plugin category. Choose from: - settings - users - content - tools - manage - misc - menu - about

Yes

<keywords>

No

<word>

Keyword

No

<adminLinks>

No

<link>

Yes

url

URL of the link

Yes

description

Description of the link

Yes

icons

icon path

Yes

<sitelinks>

No

<link>

Link name

Yes

url

URL of the link

Yes

<pluginPrefs>

No

<pref>

Value of the pref

Yes

name

Name of the pref

Yes

<dependencies>

No

<plugin>

No

name

Yes

min_version

No

<PHP>

No

name

Yes (= core)

min_version

Yes

<MySQL>

No

name

Yes (= server)

min_version

Yes

<extension>

No

name

Yes

min version

No

<userClasses>

No

<class>

Yes

name

class_name (lowercase)

Yes

description

Description of the userclass

Yes

<extendedFields>

No

<field>

Yes

name

Name of the EUF

Yes

type

Type of the EUF. Choose from:

  • EUF_TEXT

  • EUF_RADIO

  • EUF_DROPDOWN

  • EUF_DB_FIELD

  • EUF_TEXTAREA

  • EUF_INTEGER

  • EUF_DATE

  • EUF_LANGUAGE

  • EUF_PREDEFINED

  • EUF_CHECKBOX

  • EUF_PREFIELD

  • EUF_ADDON

  • EUF_COUNTRY

  • EUF_RICHTEXTAREA

Yes

default

Yes

active

true/false

Yes

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

Attribute
Description

Price

Purchasing price of the plugin (in xx.xx format). Example: 25.00

Currency

Currency codes (ISO 4217) Example: EUR

URL

Direct path to the website page where the plugin can be purchased. When the user clicks to download your plugin, the URL will be displayed.

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