Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Please note: This page is under construction and has not been finished yet.
Welcome to the new Developer Guide for e107.
The Developer Guide is still under construction but more and more information is added over time.
You can use the menu on the left to navigate to the underlying pages.
Please note: This page is under construction and has not been finished yet.
Do not modify the core database structure
Do not (ab)use database tables and fields for other purposes
The default database table prefix is e107_
and can be customized by the user during the installation of e107. The prefix that is used on an installation can always be found in the e107_config.php
file.
There are several ways the database prefix is used:
In rare cases, you may reference the MPREFIX
constant. Its use is deprecated and not encouraged.
The following table provides an overview of all database tables in a clean e107 installation, with their respective purposes.
admin_log
audit_log
banlist
comments
core
core_media
core_media_cat
cron
dblog
generic
Table for generic purposes. Generally used to store temporary date. Currently also used by welcome message. Developers are discouraged to use this table!
links
mail_recipients
mail_content
menus
news
news_category
online
page
page_chapters
plugin
rate
submitnews
tmp
upload
user
userclass_classes
user_extended
Use your own tables (for example by ) if you want to work with additional data in the database.
Stick to purposes overview, or create your own database tables
Recommended: It is strongly recommend to make use of the . Using these methods, the database table prefix is processed automatically.
By using the #
sign, one can automatically refer to the database prefix. This is generally used when using the method, to manually construct an SQL query.
Your code should not produce any PHP warnings or notices during normal usage. This primarily implies that all variables must be defined before being used. It also implies that a corrupted installation may produce errors, although as far as practicable the code should accommodate this.
By default, all PHP errors, warnings and notices are suppressed and not visible to the public. You can use debugging to show them.
Example: yourwebsite.com/news.php?[debug=basic!]
[debug=basic!]
Display basic error information
[debug=traffic!]
Display traffic information
[debug=showsql!]
Display basic SQL queries
[debug=time!]
Display load/processing times
[debug=notice!]
Display PHP Notices
[debug=warn!]
Display PHP Warnings
[debug=backtrace!]
Display PHP Backtraces
[debug=deprecated!]
Display deprecated method or function calls
[debug=inc!]
Display included files
[debug=paths!]
Display paths and variables
[debug=bbsc!]
Display BBCodes and Shortcodes
[debug=sc!]
Display Shortcode placement
[debug=sql!]
Display detailed SQL analysis
[debug=everything!]
Display all debugging details
[debug=off!]
Disable debugging
We recommend this collection of . The most important being the e107 Debugger
. If you don't wish to use the debugger, you can still activate various manually, by changing the query string of the URL and adding the debug mode. For example: directly after .php
add ?[debug=xxxx]
Please note: This page is under construction and has not been finished yet.
online_menu_totals
wmessage
news
'newsarchive'
_caption,_title,_diz,_rows
"nq_othernews"
news_php_extend_'.$id.'_'
'nq_news_latest_menu_'.md5(serialize($parm).USERCLASS_LIST.e_LANGUAGE);
'nq_news_categories_menu_'.md5(serialize($parm).USERCLASS_LIST.e_LANGUAGE);
'nq_news_months_menu_'.md5(serialize($parm).USERCLASS_LIST.e_LANGUAGE);
'news.php_default_'
'news.php_'.e_QUERY
comment.php?{$table}.{$id}
nq_chatbox
nomd5_linkwords
nomd5_user_ranks
'menus_'.USERCLASS_LIST.'_'.md5(e_LANGUAGE.$menu_layout_field)
Please note: This page is under construction and has not been finished yet.
...
Including css in your plugin or theme may be achieved by using the following function:
theme
path relative to the theme's folder
Include a theme css file in the header of the site
url
full url to css file
Include a remote css file in the header of the site
inline
css code
Include raw css code in the header of every page of the site
The table below provides an overview of the default folder structure of an e107 installation:
e107_admin
No
Contains main files used for the admin area.
e107_core
No
Contains core assets. You should not make changes within this folder.
e107_handlers
No
Contains core functions and classes. You should not make changes within this folder.
e107_images
Not usually
Contains core images. You should not normally need to make changes within this folder.
e107_languages
Not the English folder.
Contains core language files.
Themes and plugins have their own language folder
e107_media
Not usually
Contains Media such as downloadable images or files which are specific to your installation.
e107_plugins
Yes
Contains all plugins, installed and uninstalled. You may manually add plugins to this folder if need be.
e107_system
Not usually
Contains private files such as logs, plugin and theme downloads which are specific to your installation.
e107_theme
Yes
Contains all themes, installed and uninstalled. You may manually add themes to this folder if need be.
e107_web
No
Contains core js and css packages.
Please note: This page is under construction and has not been finished yet.
name
Yes
function
Your function or class/method to trigger when this event occurs. string for function, or for classes use an array (class, method).
Yes
include
include (optional) path: a file to include if required.
No
myFunction()
on user login.myFunction()
on user login. Function in external file.Triggers an event. This can be used by plugin authors to create their own plugin events that other developers can hook into.
eventname
The name of the event you wish to trigger (new event name). Format: plugindir_eventname (see example above).
Yes
data
The data that you wish to send alongside the event
No
login
User login/signin
Array of user data
logout
User logout/signout
Notice event
user_file_upload
User uploads a file
Array of file information
user_signup_submitted
User submits signup form
Array of user data
user_signup_activated
User activates newly created account. (email link)
Array of user data
user_xup_login
User signs in via a social media account. eg. Facebook, Twitter etc.
Array of user data
user_xup_signup
User creates an account using their social media login. Facebook, Twitter etc.
Array of user data
user_profile_display
User has viewed a profile
Array of data
user_profile_edit
User has edited their profile
Array of data of user who changed the settings
user_comment_posted
User has posted a new comment
Array of data
preuserset
Before usersettings are updated
Array of new user settings ($_POST)
postuserset
After usersettings are updated
Array of new user settings ($_POST)
userdatachanged
After usersettings are updated (same time and data as user_profile_edit)
Array of data of user who changed the settings
user_page_item_viewed
User has viewed a custom page
Array of data
user_news_item_viewed
User viewed a news item
Array of data
user_news_submit
User submitted a news item
Array of data
user_pm_sent
User has sent a private message
Array of data
user_pm_read
User has read a private message
Array of data
user_forum_topic_created
User creates a forum topic
Array of data
user_forum_topic_created_probationary
New user creates a forum topic
Array of data
user_forum_topic_updated
User updates a forum topic
Array of data
user_forum_topic_deleted
User deletes a forum topic
Array of data
user_forum_topic_moved
User has moved forum topic to a different forum
Array of data
user_forum_topic_split
User has split the forum topic
Array of data
user_forum_post_created
User creates a forum post/reply
Array of data
user_forum_post_updated
User updates a forum post/reply
Array of data
user_forum_post_deleted
User deletes a forum post/reply
Array of data
user_forum_post_report
User has reported a forum post/reply
Array of data
user_chatbox_post_created
User has posted a chatbox message
Array of data (ip and message)
admin_password_update
Admin updates their password
Array containing user_id and time of change.
admin_comment_update
Admin updates a comment
Array of comment data
admin_comment_delete
Admin deletes a comment
Array of comment data
admin_download_create
Admin creates a download item
Array of download data
admin_download_update
Admin updates a download item
Array of download data
admin_download_delete
Admin deletes a download item
Array of download data
admin_news_create
Admin creates a news item
Array of news data
admin_news_update
Admin updates a news item
Array of news data
admin_news_delete
Admin deletes a news item
Array of news data
admin_news_category_create
Admin creates a news category
Array of news data
admin_news_category_update
Admin updates a news category
Array of news data
admin_news_category_delete
Admin deletes a news category
Array of news data
admin_page_create
Admin creates a page/menu item
Array of page data
admin_page_update
Admin updates a page/menu item
Array of page data (new and old)
admin_page_delete
Admin deletes a page/menu item
Array of page data
admin_user_create
Admin creates a new user
Array of user data
admin_user_update
Admin modifies user data
Array of user data (new and old)
admin_user_delete
Admin deletes a user
Array of user data
admin_user_activate
Admin activates an unverified user
Array of user data
admin_user_loginas
Admin logs in as another user
Array of user data
admin_user_logoutas
Admin logs out as another user
Array of user data
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the alerts class object.
None of the above methods will output anything, until you use this method to render them.
To create a simple test script, create a new file called helloworld.php
in your root folder with the following PHP code:
Then point your browser to www.yoursite.com/helloworld.php
and you're ready!
Plugin developers can hook into various e107 core events and . Typically, an file is used to store this information since it is loaded with every page.
From e107 version 2.1.2 onwards you can use addon to catch the events instead of using
The event you wish to hook into. ()
Messages assigned here will only be displayed when is active.
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the render class object.
Send HTML to the browser for output.
Parameter
Type
Description
Mandatory
caption
string
Text for header/caption
Yes
text
string
Actual text/content
Yes
mode
string
Unique name for what is being rendered. eg contact-menu Used in themes and plugins.
Default: default
No
return
boolean
When set to true the content is returned instead of being echoed
Default: false
No
All methods related to interaction with a database
.
Please note: This page is under construction and has not been finished yet.
Calculate difference between two dates for display in terms of years/months/weeks....
older_date
integer
UNIX timestamp
Yes
newer_date
integer
UNIX timestamp
Default: current time
No
mode
boolean
if true return value is an array. Otherwise return value is a string
Default: false
No
show_secs
boolean
Default: true
No
format
string
Format of the human readable date. Options:
long
short (omits the year)
Default: long
No
Convert datestamp to human readable date. System time offset is considered.
datestamp
integer
UNIX timestamp
Yes
mask
string
Format of the human readable date. Options:
long
short
forum
relative
Default: long
No
Return an array of language terms representing months
type
string
Options:
month (August)
month-short (Aug)
day (Tuesday)
day-short (Tue)
day-shortest (Tu)
Default: month
Yes
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the parser class object.
Parse HTML in various ways. eg. replace constants, convert bbcode etc.
text
string
text or HTML to be parsed
Yes
bparseBB
boolean
set to true to parse BBcodes into HTML
No
modifiers
string
No
postID
No
wrap
boolean
Default: false
No
Convert a UNIX timestamp into a readable format.
datestamp
unix timestamp
Yes
format
string
short - Short date format as defined in admin preferences long - Long date format as defined in admin preferences relative - relative time format. eg. "2 days ago" Default: short
Convert html to plain text.
Convert e_xxxxx
paths to their equivalent shortcodes. eg. e_PLUGIN
becomes {e_PLUGIN}
Convert {e_XXXX}
shortcode paths to their equivalent constants. eg. {e_PLUGIN}
becomes e_PLUGIN
Parse an e107 template using core and/or custom shortcodes. ie. replaces all instances of {XXXXX_XXXX}
etc.
template
string
...
user core shortcodes
boolean
...
custom shortcodes
object
...
Use to convert {e_MEDIA_IMAGE}
and other image paths to an auto-sized image path for use inside an <img>
tag.
Set the width, height and crop of the thumbUrl function.
Render an icon. If a .glyph extension is found, it will automatically use the toGlyph() function above.
Render a user avatar. If empty, the current user's avatar will be displayed if found or a generic avatar image.
Render an image.
Please note: This page is under construction and has not been finished yet.
....
Including Javascript in your plugin or theme may be achieved by using the following function:
type
Yes
data
Yes
parm
jquery | array
Specifies dependencies or other parameters
No
zone
Specifies the zone in which the javascript is loaded
No
pre
No
post
No
core
path relative to the core folder
Include a core js file
url
full URL to javascript file
Include a remote js file
inline
javascript code
Include raw javascript code
theme
path to js file, relative to the current theme's folder
Include a theme js file
(any plugin folder name)
path to js file, relative to the plugin's folder
Include a plugin js file
array
Adds settings to e107's global storage of JavaScript settings.
Load a script in the 'faqs' plugin directory and auto-load jQuery if not already loaded.
Load a theme script in the footer
Load a theme script in the header
An associative array with configuration options.
The array is merged directly into e107.settings
.
All plugins should wrap their actual configuration settings in another variable to prevent conflicts in the e107.settings namespace.
Items added with a string key will replace existing settings with that key; items with numeric array keys will be added to the existing settings array.
Behaviors are event-triggered actions that attach to page elements, enhancing default non-JavaScript UI's.
Behaviors are registered in the e107.behaviors
object using the method 'attach' and optionally also 'detach' as follows:
e107.attachBehaviors
is added to the jQuery ready event and so runs on initial page load. Developers implementing Ajax in their solutions should also call this function after new page content has been loaded, feeding in an element to be processed, in order to attach all behaviors to the new content.
See the e107_web/js/core/all.jquery.js
file for more information.
jQuery is now namespaced to avoid conflicts with other Javascript libraries such as Prototype. All your code that expects to use jQuery as $ should be wrapped in an outer context like so.
If you don't, you may see the following error:Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function or similar
e107.behaviors
will often be called multiple times on a page. For example, core/custom plugin performs some Ajax operation, all e107 behaviors will be executed again after page load, in order to attach any relevant JavaScript to the newly loaded elements.
This can have the undesired affect of applying JavaScript to elements each time e107 behaviors are executed, resulting in the same code being applied multiple times. To ensure that the JavaScript is applied only once, we can use the jQuery $.once()
function. This function will ensure that the code inside the function is not executed if it has already been executed for the given element.
Using jQuery $.once()
(integrated into e107 core), the developer experience of applying these effects is improved. Note that there is also the $.removeOnce() method that will only take effect on elements that have already applied the behaviors.
If you want to override a bit of core (or third party) e107 JavaScript Behavior, just copy the behavior to your Javascript file (e.g in your plugin or theme), then load it after the original code using "zones".
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the database class object
Selecting data from a database table
table
string
Name of the database table
Yes
fields
string
Comma separated list of fields or "*
" or a single field name (get one);
arg
string|array
....
noWhere
boolean
debug
boolean
log type
log_remark
Selecting, looping through and displaying selected data with the fetch() method:
Inserting data into a database table:
Updating information in a database:
table
string
Name of the database table to retrieve data from.
If empty, enters fetch only mode
fields
string
Comma separated list of fields or "*
" or a single field name (get one);
If $fields
is of type boolean and $where
is not found, $fields
overrides $multi
where
string
WHERE/ORDER/LIMIT etc. clause.
multi
string
If set to true, fetch all (multi mode)
Default: false
indexField
boolean
Field name to be used for indexing when in multi mode
Default: null
debug
boolean
....
Default: false
Delete a record from a database table.
Generic query function to use various SQL commands.
mySQLserver
string
IP or hostname of the SQL server
mySQLuser
string
SQL username
mySQLpassword
string
SQL password
newLink
boolean
force a new link connection if set to true Default: false
database
string
Database name
prefix
string
multiple
boolean
Set to true to maintain connection to a secondary database
newLink
boolean
force a new link connection if set to true Default: false
Please note: This page is under construction and has not been finished yet.
Please note: This page is under construction and has not been finished yet.
Parameter
Description
name
Title or name for the log event.
details
Details for the log event - can be either a string of text or an array.
type
code
Custom reference code for your type of event. It should be short, ALL CAPITALS and not contain spaces.
Type
Description
E_LOG_INFORMATIVE
Informational event
E_LOG_NOTICE
Notice event
E_LOG_WARNING
Warning event
E_LOG_FATAL
Fatal event
Please note: This page is under construction and has not been finished yet.
You can generate a Search Engine Friendly (SEF) URLs using the following method:
In this example we will generate search-engine-friendly URLs for a forum topic with the following code: .
The code above loads the following file: e107_plugins/forum/e_url.php
and generates a URL from the following array data with the unique key topic
:
Only the value of 'sef' is used in this array. it substitutes the values {forum_sef},
{thread_id}
and {thread_sef}
with the variables in the $data
array.
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the form class object
Returns a form opening tag.
Returns a form closing tag
Returns a text field form element
Render a Bootstrap carousel
Render Bootstrap tabs
Date field with popup calendar. Returns UNIX timestamp or string value on submit.
(any valid string)
The configuration of the mask formats are specified in Admin Area > Preferences > .
Choose from pre-defined .
Convert a glyph name into Html. Just choose an icon from and remove the first 'fa' Templates may also use the following shortcode: which calls the same function.
Used for of variables, in for example.
See
See
Combined and method.
Prefix of the database tables (e.g. "e107_"). Defaults to .
Parameter
Type
Description
Mandatory?
plugindir
string
Plugin name.
Could also be
Yes
You can log events to the admin by using the built in log class. Use the following to retrieve the alerts class object.
The type of event. ()
The end result would look something like this:
Parameter
Type
Description
Mandatory
name
string
Name of the form
Yes
mode
string
post | get 'post' by default
No
target
string
The request URL
e_REQUEST_URI
by default
No
options
array
Specify options such as class or autocomplete
autocomplete - on/off (boolean)
class - (any string)
...
No
Parameter
Type
Description
Mandatory
name
string
Name of the text field
value
string
Value of the text field
maxlength
integer
Specifies the maxlength element of the text field
options
array
Specify options such as class, size or selectize
class: (any string)
size: mini, small, medium, large, xlarge, xxlarge
selectize: array with selectize.js options
Parameter
Type
Description
Mandatory
name
string
Name of the field
Yes
value
string
Contents of the field
Yes
template
string
A string defining the button template to use with bbarea. Included in the core are the following: news, submitnews, extended, admin, mailout, page, comment, signature But you can also use the name of the plugin (e.g. forum) if the plugin provides a bbcode_template.php
No
mediaCat
string
Name of the media catalog to use (default: _common)
Is only used by TinyMCE plugin (if installed and used)
No
size
string
Size of the bbarea/editor. Use one of the following values: tiny, small, medium, large (default: large)
No
options
array
Array with options to use with the editor: id: string - In case the bbarea/editor id should be different to the name class: string - the css classes to use counter: boolean - Show a character counter wysiwyg: boolean/string -
False in case you want disable the wysiwyg editor for this field and use the default bbcode editor.
True to enable the current installed (and enabled) wysiwyg editor
Name of the editor (e.g. tinymce4 or simplemde) to use, in case wysiwyg is generally enabled and the supplied editor is installed.
No
Please note: This page is under construction and has not been finished yet.
You can redirect to a URL using the following static method:
To redirect to the homepage, simply leave the URL blank.
To redirect to the Admin Area, use the value 'admin'.
Please note: This page is under construction and has not been finished yet.
Returns an array of user data for a specific user. Input can be either a specific ID ($user_id
) or use USERID
for the currently logged in user.
Please note: This page is under construction and has not been finished yet.
Use the following to retrieve the render class object.
Developers may retrieve admin preferences for their theme or plugin, or a core preference using the following method:
Example: Load a stored value that was saved in the preferences admin area of the 'faqs' plugin
Or load a single preference value.
core
all core preference values.
theme
preferences of the currently selected front-end theme.
(any plugin folder name)
preferences of a particular plugin
Please note: This page is under construction and has not been finished yet.
plugin
string
Yes
key
string
Unique key
Yes
row
array
Array of variable data such as id, title etc. eg. user_id, user_name
No
options
array
An associative array of additional options, with the following elements:
mode: abs | full (returning the absolute path or full URL)
query: an array of query key/value-pairs (without any URL-encoding) to append to the URL.
fragment: a fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.
(optional)
No
Parameter
Type
Description
Mandatory?
name
string
The name of the field
Yes
datestamp
integer|boolean
UNIX timestamp. Set the default value of the field.
Default: false
No
options
array|string
mode - 'date' or 'datetime'
format -
timezone
size
required (true/false)
firstDay
disabled
placeholder
Default: null
No
Please note: This page is under construction and has not been finished yet.
The Plugin Builder can be found in Admin Area > Manage > Plugin Manager > Plugin Builder.
Create an empty plugin folder in e107_plugins (eg. "myplugin")
Create a new text file with the *_sql.php extension. (eg. "myplugin_sql.php")
Using a tool such as phpMyAdmin, create your database table structure, and then export it in SQL format.
Copy and paste the database structure ("CREATE TABLE") to your your *_sql.php file. (see other plugins for examples)
Thoroughly check the details of each Table Tab (and Preferences Tab if you need them) before proceeding with the creation process.
field
caption
type
data
width
batch
filter
inline
validate
display
R/O
Helptip
ReadParms
WriteParms
Please note: This page is under construction and has not been finished yet.
Plugins extended the functionality of e107 and allow for endless possibilities.
CORE/THIRD PARTY - LINK TO USER GUIDE
The plugin architecture is developed to be as simple as possible. Often you can copy a file from an existing plugin and simply modify a few parameters in order to get similar functionality in your own plugin
Example: blank plugin
images
sizes?
languages
English
...
templates
addon files
Required files
plugin.xml
Optional files
admin_config.php
*_setup.php
*_sql.php
e_*.php addons
*_shortcodes.php
Please note: This page is under construction and has not been finished yet.
The Admin-UI (Admin User Interface) is .....
No need to code in the HTML or the process of reading or writing to your database.
Consistent interface with the rest of Admin Area
Users can select which fields from your database table they wish to view - based on your predefined list.
The Media-Manager is integrated into the system.
Easily add drag and drop sorting/re-ordering to your plugin.
Easily add batch functionality such as deleting, copying, featurebox creation, sitelink creation, userclass modification, etc.
Easily add inline editing to your data.
Easily add tabs to keep your plugin's admin-area well organized.
Below you can find the basic file structure of of the admin_config.php file. This file serves the Admin-UI to the administrators.
It is strongly recommended to use admin_config.php as the filename!
This section will summarize the various options which may be used while utilizing the Admin-UI class.
Please note that the documentation for this section is a work-in-progress. Thank you for your patience!
extends e_admin_dispatcher
...
extends e_admin_ui
Database fields are defined by the $fields
value in the Admin-UI class.
Example:
The Admin-UI allows to automatically create a tree structure based on parent/child relationship tables. In order to add a tree structure, add the following code:
In this case:
field1
represents the field which determines the order (for example an ID field).
field2
represents the field which is the parent
field3
represents the field which is the child
Please note: This page is under construction and has not been finished yet.
There are several ways to extend the core functionality of e107. One of those ways is by using so-called "addons". These addons are files which reside in each plugin's folder and allow a plugin to embed itself inside e107's core pages and functions.
The addons can be recognised by their e_xxxxx.php
naming format. By simply placing them inside your plugin's folder, they will be auto-detected during installation and integrated into the system.
This addon adds custom plugin information to the dashboard of e107's admin area. The 'latest', 'status' and 'website stats' areas may all contain information from your plugin.
This addon allows a plugin to easily hook into system events and trigger their own methods and functions using data provided by those events.
This addon allows a plugin to include code in the footer of every page of the site.
Warning: Output should never be echoed or printed from this file!
This addon allows a plugin to use e107's mailout feature for bulk mailing.
This addon provides configuration options for each instance of the plugin's menus.
This addon is loaded every time the core of e107 is included. ie. Wherever you see require_once("class2.php")
in a script.
It allows a developer to modify or define constants, parameters etc. which should be loaded prior to the header or anything that is sent to the browser as output. It may also be included in Ajax calls.
The notification can then be triggered by using:
This addon allows a plugin developer to specify content that is displayed in printer-friendly format
This addon adds the plugin to the RSS plugin, and generates RSS feeds for the plugin.
This addon adds the plugin to the search which generates 'related' links in news items and pages of e107.
This addon adds the plugin to the 'search page' of e107.
This addon allows a plugin to make their shortcodes available to core templates and templates of other plugins.
It's content is identical to that of a regular shortcode class except that all the methods must follow the following naming convention: sc_plugindir_name()
The $override
property can be used to override existing core/plugin shortcodes. When set to true existing core/plugin shortcodes matching methods below will be overridden.
This addon adds a sitelink sublink-generating function for your plugin. An example is auto-generated navigation drop-down menus for 'latest articles'.
This addon allows to:
add information about a specific user to the user's profile page
add and save fields to the user configuration page (/usersettings.php
)
specify a routine that is run upon user deletion
Please note: This page is under construction and has not been finished yet.
......
These shortcodes may be used in your theme.html and layout/xxx _layout.html files which reside inside your theme's folder. eg. Using the example below: {MY_SHORTCODE}
and {MY_OTHER_SHORTCODE}
will be substituted with "Something" and "Something else".
Your website can be used in different languages. In order for your plugin or theme areas to be displayed in a specific language, it needs to be translated.
There are three types of language files that can be used in your plugin.
Language Terms are more commonly known as LAN's. You can define LAN's by using PHP constants:
Examples are words such as 'and', 'to' and so on. There aren't always equivalents in other languages.
To load a language file from a plugin folder, use e107::lan()
:
This will include the following paths:
Folder name of the plugin. (will use data from )
Available options (see below):
By far, the quickest and easiest way to develop a plugin for e107 is to use the , because:
It allows you to select the database file () file from the plugin folder, or directly from the database table list, and it will generate most of the new code for the of your plugin.
It will generate the new meta-file, which is used during installation of your plugin and also when sharing plugins via this site.
Go to Admin Area > Manage > > Plugin Builder and choose "myplugin" from the dropdown menu and then follow the prompts.
The advantages of using the new are numerous - including, but not limited to:
TIP: The is very useful tool to use for the Admin-UI as it will generate most of the new code for the Admin-UI of your plugin.
Please note: If addons are added after plugin installation, you may need to run the "" option in Admin Area > Tools > .
Be sure to replace plugindir
with your plugin's directory name in all examples below.
This addon allows a plugin to add additional scheduled task options to e107. (see Admin Area > Tools > ).
Deprecated! This addon has been deprecated. Use instead.
You can make use of the and .
This addon allows a plugin developer to add their plugin as a option.
This addon allows a plugin developer to add data to the <head>
of every page. This file is loaded in the header of each page of your site. ie. Wherever you see require_once(HEADERF)
in a script.
Typically you would use one or all of the following functions within this file: , or
Deprecated!
This addon allowed plugin developers to add information to the plugin configuration page sidebar.
This has now been integrated within the through the renderHelp()
method.
Deprecated! This addon has been deprecated. Use instead.
Deprecated! This addon has been deprecated. Use instead.
Deprecated! This addon has been deprecated. Use instead.
This addon adds the plugin to the section in the Admin Area and allows a plugin to send notifications.
This addon allows to hook into all pages at the very end (after the closing </html>
). This is useful for example when capturing .
This addon allows to hook into e107's
Deprecated! This addon has been deprecated. Use instead.
Deprecated! This addon has been deprecated. Use instead.
This addon provides a simple way to add mod-rewrite redirects to the plugin's pages, without having to edit the .htaccess
file. This addon is used to create Search-Engine-Friendly (SEF) URLs through the method.
TODO: e_ROUTE -
Please refer the the section
TIP: As of e107 v2.x, you no longer need separate xxxxxx.sc
files inside your theme's folder. You can now include all your theme-specific shortcodes in a single file called .
You should always include the English language files in your plugin!
Always use the format LAN_PLUGIN_{FOLDER}_{TYPE} to prevent conflicts.
If defining terms for admin, always search lan_admin.php
for existing LANs which may match what you require.
Use double quotes within the defines and use str_replace()
or for where needed.
If embedding values into a phrase, use .
Use brackets [..]
and values such as x, y, z. See below.
title
string
Field Title
type
string
Type of Field
data
string
Data Type
width
string
width of the column (List View)
inline
boolean | string
Enable or disable inline editing.
help
string
Popup helper text (tooltip)
readParms
array
Parameters specific to the 'list' mode.
writeParms
array
Parameters specific to the 'edit' and 'create' modes.
text
text box
number
text box (number)
checkbox
checkbox (0 or 1 is returned)
icon
icon (from media manager)
textarea
text area (text only)
boolean
radio buttons with enable/disable
bbarea
right text area (html)
dropdown
dropdown list (ie. <select></select>
)
userclass
drop-down list of userclasses
userclasses
checkboxes for multiple userclasses
datestamp
date / time text box
user
user selection text box. (type 3 letters to find/search)
hidden
hidden field
ip
text field with ip decoding
text field for email addresses
url
text field for urls (becomes clickable in list mode)
password
password field (with optional generator)
image
Media-manager image selection tool for a single image
images
Media-manager image selection tool for multiple images
file
Media-manager file selection tool for a single file
files
Media-manager file selection tool for multiple files
media
Media-Manager selection tool for images, mp4, youtube and gylphs. (requires type=json)
method
custom method
lanlist
drop-down list of installed languages
language
drop-down list of all languages
templates
Dropdown list of templates (from a template file)
null (without quotes)
Ignore this field and do not save it's data
false (without quotes)
Hide this field but save it's data if a posted key value is found.
str
Posted data is converted to string before saving to the database
safestr
Posted data is run through a filter (using filter_var(FILTER_SANITIZE_STRING)
) and thus strips HTML.
int
Posted data is converted to integer before saving to the database
array
Posted data is converted to an e107 array format. (use e107::unserialize()
to decode)
json
Posted data is converted to json format before saving to the database
false (no quotes)
Posted data from this field is not saved to the database
thumb
(integer)
image
Set the thumbnail width
url
(string) e_url.php key value or a field key.
number, text, tags, null
Wrap value in a link
target
(string) blank | dialog
number, text, tags, null
Target for 'url' above.
pre
(html)
(all)
Render html just before the field
post
(html)
(all)
Render html just after the field
media
(string)
bbarea
Sets the media-owner category to be used by the media-manager
video
0 or 1
image
Show video selector tab in media-manager
path
'plugin' or null
image
When set to 'plugin', images will be stored in the 'plugin' folder within e107_media
glyphs
0 or 1
icon
Show glyph selector tab in media-manager
size
large, xlarge, xxlarge, block-level
text, url, email, textarea, dropdown
Set the size (width) of input field
optArray
(array of key=>value pairs)
dropdown, checkboxes
Set the keys/values to be used in the dropdown or checkboxes.
placeholder
(string)
text, url, email, textarea
Placeholder text
pattern
(regexp)
text, url, email
Regular expression validation
type
date or datetime
datestamp
Choose between date or date and time
readonly
0 or 1
datestamp
Make element read-only
auto
0 or 1
datestamp
Insert current date/time automatically
label
yesno
boolean
Change "Enabled" and "Disabled" to "Yes" and "No".
inverse
0 or 1
boolean
Invert the values of 0 and 1. ie. "Disabled" = 1 and "Enabled" = 0.
enabled
(string)
boolean
Alternate text to replace "Enabled"
disabled
(string)
boolean
Alternate text to replace "Disabled"
classlist
public, guest, nobody, member, admin, main, classes (comma separated)
userclass
Set which userclasses should be displayed.
tdClassLeft
(string)
(all)
Set the css class for the left-side table cell.
tdClassRight
(string)
(all)
Set the css class for the right-side table cell.
trClass
(string)
(all)
Set the css class for the table row.
nolabel
0 or 1
(all)
Hide the left table cell
Please note: This page is under construction and has not been finished yet.
Theme shortcodes
Plugin shortcodes
Please note: This page is under construction and has not been finished yet.
Please note: This page is under construction and has not been finished yet.
Templates and shortcodes function together to allow a developer to place dynamic content into their code.
Templates are portions of HTML which contain markers that are replaced by dynamic content when parsed e107's parseTemplate()
function.
These markers are called 'shortcodes'.
A shortcode is always CAPITALIZED and is surrounded by curly brackets and it may contain letters and underscores. For example: {MY_SHORTCODE}
Each shortcode has a corresponding function/method which is run during the parsing of the template. These functions are always lowercase and begin with the prefix sc_
. eg. sc_my_shortcode()
. This means that {MY_SHORTCODE}
is replaced by what is returned by sc_my_shortcode()
.
Shortcodes may also contain parameters which are sent to the corresponding method. For example: {MY_SHORTCODE: x=foo&y=bar}
Create a folder called templates
inside your plugin directory, and inside create an empty file using the name of your plugin folder, followed by _template.php
. eg. myplugin_template.php
Inside this file add an array by the same name, but in UPPERCASE: eg. $MYPLUGIN_TEMPLATE['xxxx']
xxxx
can be anything you want, but we suggest using start
, item
, end
etc. when applicable. This value should always be lowercase. Here's a simple example of the contents of myplugin_template.php
:
If your plugin will use several different types of templates, eg. a listing page and an input form. You can do something like this:
You may load a template file in the following way:
You can now use the $template
code array for parsing:
All templates that are used in e107 can be overridden by copying them into specific folders within your current theme folder.
Core themes (located in e107_core/templates/
) should be copied into e107_themes/YOURTHEME/templates/
Plugin templates should be copied into e107_themes/YOURTHEME/templates/PLUGIN-FOLDER
Note: Older plugins may look for templates in the root folder of your theme. ie. e107_theme/YOURTHEME/
1) The comment template is a core template, as it is located in e107_core/templates/. To override this template, copy the file to e107_themes/your_theme_folder/templates/. 2) The news template is located in e107_plugins/news/. To override this template, copy the file over to e107_themes/your_theme_folder/templates/news/. 3) The same for, for example, the chatbox menu template. The chatbox_menu template is located in e107_plugins/chatbox_menu. Copy the template over to e107_themes/your_theme_folder/templates/chatbox_menu/
Important: For overriding plugin templates, the folder name within your_theme_folder/templates/ directory must match the exact plugin folder name.
Please note: This page is under construction and has not been finished yet.
Name
Description
Allows a plugin to add customized BBCodes.
Adds custom plugin information to the dashboard of e107's admin area.
Allows a plugin to easily hook into system events and trigger their own methods/functions.
Allows a plugin to include code in the footer of every page of the site
Allows a plugin developer to add data to <head>
of every page.
Deprecated!
Allows a plugin to include a third-party library.
Deprecated!
Allows a plugin to use e107's mailout feature for bulk mailing.
Provide configuration options for each instance of the plugin's menus.
Deprecated!
Is loaded every time the core of e107 is included and allows a developer to modify or define code which should be loaded prior to the header or anything that is sent to the browser as output.
Allows a plugin to hook into all pages at the end (after closing </html>
)
Allows a plugin developer to specify content that is displayed in printer-friendly format.
Adds a plugin to the RSS plugin, and generates RSS feeds.
Adds a plugin to the search which generates 'related' links in news items and pages.
Allows a plugin to make their shortcodes available to core templates and templates of other plugins.
Adds information about a specific user to the user's profile page, allows to add fields to the user settings page and allows to specify a routine that is run upon user deletion.
Language File
Usage
English_front.php
Used only for the frontend of your plugin
English_admin.php
Used only for the Admin Area of your plugin
English_global.php
Please note: This page is under construction and has not been finished yet.
The table below lists the files that can be used in a plugin. Only few of them are mandatory.
TIP: the _blank plugin contains useful examples as reference material.
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
<e107Plugin>
Yes
name
Yes
version
Yes
date
Yes
lan
No
compatibility
Yes
installRequired
Yes
<author>
name
Yes
url
Yes
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
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.
....
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.
For the moment, the following operations are supported:
Create table
Change field type, field size, field null or not, field default value
Add index
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.
Plugins and themes developed for e107 v1.x will continue to work on v2.x. However, to get the most out of v2.x, it is strongly recommended for developers to make changes to their code and bring the code up to the new v2.x standards.
This way, developers can:
Ensure continued functionality of their plugins and themes in future versions of e107
Benefit from major performance and security enhancements.
Benefit from all new features and functionalities that are being developed in v2.x.
The functionality of plugins also depends on the PHP and MySQL versions that are being used.
Plugins that are not regularly updated may make use of deprecated and/or removed PHP/MySQL functionality. In this case, plugins can cause a website to malfunction, or plugins appear to be broken.
TIP: When updating plugins, take into consideration the latest PHP/MySQL developments to ensure continued functionality.
In e107 v2.x, numerous classes and methods were introduced in order to standardize functionality across installations, ensure continued functionality and to minimize performance issues and security risks.
<input class='button'
should become <input class='btn button'
<table class='fborder'
should become <table class='table fborder'
<table>
which use the class 'fcaption'
on <td>
should change the <td>
to <th>
.
Using the forumheader3
class in the Admin Area is obsolete and can be removed.
e107 v2.x uses a new template loading system.
..and then you can parse it the same way:
eg. If your file is called myplugin_template.php , within this file you might see something like this:
In v2.x there are two methods to add wrappers around your shortcodes. The way to declare them differs slightly from v1 in that we use a kind of 'shortcode-wildcard' {---}
.
A global shortcode wrapper. ie for shortcodes which are available site-wide. (for example those registered globally for use in menus or found in e107_core/shortcodes/single/)
Example:
v2.x introduces a template-specific shortcode wrapper. ie. as used on a single page of your site. Example:
To easily migrate from one to the other, one can use the method called migrateData()
.
Please note: This page is under construction and has not been finished yet.
Themes developed for v1.x of e107 will continue to work using v2.x. However, to get the most out of v2.x, it is recommended to make the following changes to bring your theme up to date with the new v2.x standards.
Replace $HEADER and $FOOTER with $HEADER['default'] and $FOOTER['default']
Replace any occurrences of $CUSTOMHEADER and $CUSTOMFOOTER with $HEADER['custom'] and $FOOTER['custom']
If your theme contains links to external social media pages such as Facebook, Twitter or YouTube, use the core definitions for them. ie. XURL_FACEBOOK, XURL_TWITTER, XURL_YOUTUBE.
If you have used index.php in your $CUSTOMPAGES list, use FRONTPAGE instead (see above)
Read more on theme shortcodes here:
Please note: This page is under construction and has not been finished yet.
e107 v2.x is designed for Bootstrap styling. It is therefore encouraged for developers to use bootstrap as their guide for their HTML markup.
If you find markup in the core templates of e107 which does not work well with bootstrap, please let us know in the Github issue tracker, so that we may correct it.
Please note: This page is under construction and has not been finished yet.
This file contains information about the theme. and is used during installation and also during configuration of the theme.
The below example uses the theme.xml from the Bootstrap3 theme included in e107 by default. Each section of the XML file is elaborated upon below.
This is the namespace the configuration lives in. All theme.xml files must begin and end with this tag.
The following attributes of the theme are defined here:
name
The name of your theme. This can be text or a constant defined from your themes's language file.
Bootstrap3
Yes
version
The version of the theme
(semantic versioning)
3.0
Yes
date
The date when the theme was released (latest version). (yyyy-mm-dd)
2020-30-12
Yes
compatibility
The minimum version of e107 required to use the theme.
(semantic versioning)
2.1.0
Yes
price
In case of a commercial theme: the sales price of the theme.
(xx.xx format)
25
No
currency
In case of a commercial theme: the abbreviation of the currency in which the theme is sold for (see price).
EUR
No
url
In case of a commercial theme: the direct URL to the specific theme.
When the user clicks to download your theme, the URL you have provided will be loaded.
No
Identifies the theme author and highlights some information.
The following attributes of the author are defined here:
name
The author's name, e107 user name or nickname.
e107 Inc.
Yes
e107inc@something.com
Yes
url
https://www.e107.org
Yes
description
Example description of your choice.
No
A text that shortly summarises the theme.
A text that provides a more elaborate description of the theme.
The category that a theme belongs to. Possible values are:
Generic
Adult
Blog
Corporate
Gaming
News
name
Refers to the plugin folder name of the recommended plugin.
featurebox
Yes
url
For plugins that are included in e107 by default, use "core".
For third-party plugins ....
core
Yes
Refers to the location of the image file, relative to the root of the theme folder
Attribute
Description
Example
Mandatory?
name
Name of the library
bootstrap.editable
Yes
version
Version of the library. (semantic versioning)
3
No
scope
The area in which the library is included. Possible values:
front
admin
wysiwyg
Can be multiple if separated by comma
admin
Yes
Attribute
Description
Example
Mandatory?
file
css/modern-light.css
Yes
name
Modern Light
Yes
description
A high-contrast light skin
No
thumbnail
images/admin_modern-light.webp
No
scope
admin
Yes
exclude
bootstrap
No
name
Shortname of the layout
(use underscores)
jumbotron_home
Yes
title
Descriptive title of the layout
Home page carousel with fixed custom-menus
Yes
default
Indicates whether a layout is the default layout to be used. There can only be one default layout.
Boolean - defaults to 'false'
true
No
preview
A preview image (thumbnail) of the layout.
(recommended dimensions?)
preview.png
No
previewFull
A preview image of the layout (full size)
(recommended dimensions?)
preview_full.png
No
Theme authors can create buttons for menus that can be activated by the user from "Menu Manager" or "Theme Manager". These are placed between and and should be enclosed in the and tags with the opening area tag naming the menu area it corresponds to; the example below would be for a layout with two (2) menu areas ({MENU=1} = and {MENU=2} = ). The tag "menu name" must contain the name of a valid and installed menu.
Set default theme preferences?
name, (value)
This file can be used to add information and user-selectable options to the theme's configuration page.
Automatically, e107 is looking for the favicon.ico file in the following locatons in this specific order:
inside the root of the theme folder (e107_themes/yourtheme
)
inside the root of the e107 installation (/
)
This way, theme authors can override the default favicon, and users can upload their own favicon to the theme folder.
Please note: This page is under construction and has not been finished yet.
Shortcode
Description
{---}
Renders the main content of the current page.
{CMENU=xxxxxx}
Renders a specific custom menu item as defined in admin -> Pages/Menus. xxxxxx = menu name.
{LOGO}
The site's logo as defined in the admin preferences.
{MENU=1}
Menu Area as allocated using the media-manager in admin. Add multiple areas by incrementing the numeric value.
{MENU: type=xxxxxx}
When xxxxxx
is NOT a number, it will attempt to render a specific menu with the name xxxxxx
. eg. {MENU=contact}
will render e107_plugins/contact/contact_menu.php
{NAVIGATION=xxxxx}
Bootstrap-style navigation. Where xxxxx
is one of: main, side, footer, alt, alt5, alt6 eg. {NAVIGATION=footer}
{SETSTYLE=xxxxxx}
{SETIMAGE: w=x}
A special shortcode which is used to dynamically change the size of avatars and other images. x= numerical value. eg. {SETIMAGE: w=100&h=200&crop=1}
{SITEDESCRIPTION}
The description of the website as defined in the admin preferences.
{SITEDISCLAIMER}
The site disclaimer as defined in the admin preferences. Typically used in the footer of the site.
{SITENAME}
The name of the website as defined in the admin preferences.
{WMESSAGE}
Renders the welcome message as defined in admin-> Welcome Message.
Shortcode
Description
Optional Parameters
{CPAGEANCHOR}
{CPAGETITLE}
Title of the page
{CPAGEBODY}
Main text body of the page
{CPAGEAUTHOR}
Author of the page
{CPAGEDATE}
Creation date of the page
{CPAGEDATE=x}
default: long. 'short' and 'relative'
{CPAGEMETADIZ}
Meta description of the page.
{CPAGEBUTTON}
{BOOK_ANCHOR}
{BOOK_DESCRIPTION}
{BOOK_ICON}
{BOOK_ID}
{BOOK_NAME}
{BOOK_URL}
{CHAPTER_ANCHOR}
{CHAPTER_BREADCRUMB}
{CHAPTER_BUTTON}
{CHAPTER_DESCRIPTION}
{CHAPTER_ICON}
{CHAPTER_ID}
{CHAPTER_NAME}
{CHAPTER_URL}
Shortcode
Description
Optional Parameters
{NEWS_ID}
Unique ID for the current news item (news_id)
{NEWS_TITLE}
News Title
{NEWS_SUMMARY}
News item summary
{NEWS_DATE}
News Date
{NEWS_BODY}
News Body (main content)
{NEWS_TAGS}
New Keywords/Meta-Keywords
{NEWS_URL}
News URL (current URL)
{NEWS_AUTHOR}
Name of the Author of the news item
{NEWS_AUTHOR_AVATAR}
Avatar of the Author of the news item
{NEWS_AUTHOR_SIGNATURE}
Signature text of the Author of the news item. eg. a short bio about the user.
{NEWS_AUTHOR_ITEMS_URL}
Link to a News page listing all items by the same author.
{NEWS_CATEGORY_NAME}
News Category Name
{NEWS_CATEGORY_DESCRIPTION}
News Category Description
{NEWS_CATEGORY_ICON}
News Category Icon
{NEWS_RELATED}
Related news items based on keyword matches
types: news | page limit: (integer) (default is 5)
Shortcode
Description
Default value
{e_MEDIA_FILE}
{e_MEDIA_VIDEO}
{e_MEDIA_IMAGE}
Allows to extend areas of the
Allows a plugin to override the default
Allows a plugin to add additional (or 'cronjobs') to e107.
Deprecated! Use instead.
Allows a plugin to generate content for the .
Allows a plugin developer to add their plugin as a option.
Allows a plugin to create automated entries for the .
Allowed plugin developers to add information to the plugin configuration page sidebar. This has now been integrated within the through the renderHelp()
method.
Deprecated! Use instead.
Use instead.
Allows a plugin to hook into the
Use instead.
Adds a plugin to the section in e107's admin area.
Allows a plugin to hook into e107's
Adds a plugin to the .
Allows a plugin to automatically generate links
Deprecated! Use instead.
Deprecated! Use instead.
Allows a plugin to set categories for
Provides a simple way to add mod-rewrite redirects to a plugin's page. Used to create search-engine-friendly URLs through the method.
Used site-wide, for example in , files such asxxxx_menu.php
or .
Contains the
Contains the configuration.
.
Commercial plugins can make use of a few extra attributes to the <e107Plugin> element, so that this information will be displayed correctly in the admin area under "".
Note: do not add the URL to the generic homepage of your website, but only the URL to the specific page for that specific plugin.
Please refer to the page
TIP: To check if the table structure is still valid, run "Admin Area > Tools > Database > "
TIP: Check the blank_setup.php file or the forum_setup.php file for examples on renaming/dropping/modifying tables, fields and indexes.
Please refer to the
Back in September 2015, . Currently, any older version of e107 (such as version 1.0.4) is considered to be Legacy, and is also referred to as e107 v1.x.
Even though a lot of effort has been put in retaining backwards compatibility with older versions of e107, developers are strongly encouraged to update their code to new standards.
Check the for more information on the minimal and recommended requirements for an e107 installation.
Include a file
Include a file
Use e107's class for all form elements.
Use in your templates and/or HTML markup
Upgrade to v2.x standards
Upgrade to new standards
Developers are strongly encouraged to make use of e107's standard
e107 v2.x follows the for . Some examples:
TIP: Read more about
Plugin templates should be stored in /yourplugin/templates/ by default. The template file should contain a variable with the same name as your template file. Instead of including the template, below is the difference:
TIP: Read more about the
TIP: Read more about
In e107 v2.x, the Admin Area uses a special admin "handler", the .
In the Plugin Manager you will find something called "". It allows you to select your e107 file from your plugin folder and will generate most of the new code for the Admin Area of your plugin. It will also generate the new meta-file, which is used during of your plugin.
It is strongly recommended for plugin developers to upgrade their Admin Area using the .
In e107 v.2x, it is strongly recommended for plugins to save their preferences in their own table row. Older plugins may still store plugin preferences in the preference table.
Adding $CUSTOMPAGES
to in e107 v2.x is deprecated and should be avoided!
Remove any reference to $CUSTOMPAGES and place them inside in the section.
The function theme_head() has been deprecated. Instead, use either or to include what you require in the header. (see bootstrap or other new core theme for examples)
Shortcodes need to be set to UPPERCASE in all occurrences in your file. ($register[]
and everywhere else in )
TIP: As of e107 v2.x, you no longer need separate xxxxxx.sc
files inside your theme's folder. You can now include all your theme-specific shortcodes in a single file called.
A default Bootstrap 3 is provided with e107. For html markup and examples, please refer to the and for snippets: .
TIP: To create a new theme.xml
file or derive one from an existing v1.x theme.php
file use the in the Admin Area > Theme Manager > Tools
(/e107_admin/theme.php?mode=convert
)
Please note: Unlike , the theme.xml file is not intended to replace the file. Instead, theme.xml works alongside to provide (meta)data about the theme itself.
Note: do not add the URL to the generic homepage of your website, but only the URL to the specific page for that specific theme.
Tip: If you are developing a commercial theme, you'll want to add a few extra attributes so that it displays correctly in the admin area under "". Just package the theme's zip file with only the and any images (including screenshots), excluding .php, .css files etc. before sharing it in the . When the user clicks to download the theme, it will display the URL you have provided.
Note the /
to close the tag at the end.
E-mail address. Useful to get feedback and bug reports on the theme. A mailto link to it is displayed on the Admin Area > page.
A link to the author's website. A link to it is displayed on the Admin Area > page.
A brief description of your theme. Displayed on the Admin Area > page.
In this section, theme designers can include plugins that they intend to be used with the theme. In the "" > > "" section with buttons for those plugins that the user can click on to install them.
The keywords associated with the theme. They are used when searching for plugins either through the Admin Area or on .
Each theme can contain one or more screenshots. These screenshots are displayed in the Admin Area and on .
Each theme can contain various layouts. Additionally, each layout can be used for specific and each layout can have specific .
Each layout can assign specific pages which then, by default, make use of this specific layout. The user can modify the pages used by each layout in the "" > > >
You can use the constant FRONTPAGE
to refer to the currently set setting.
constant
Adding $CUSTOMPAGES
to in e107 v2.x is deprecated and should be avoided!
TODO: also refer to
If you want users to b e able to set specific theme preferences, use the theme_config.php file.
TIP: To insert more favicons, you can use the
A special shortcode which is used to dynamically change the value of $style
as used inside to the value of xxxxxx
.
In the table below (hash)
refers to the generated upon installation of e107.
// define('eDEBUG', true); // Enable debug mode to allow displaying of errors // define('e_HTTP_STATIC', ''); // Use a static subdomain for js/css/images etc. // define('e_MOD_REWRITE_STATIC', true); // Rewrite static image urls. // define('e_LOG_CRITICAL', true); // log critical errors but do not display them to user. // define('e_GIT', 'path-to-git'); // Path to GIT for developers // define('X-FRAME-SAMEORIGIN', false); // Option to override X-Frame-Options // define('e_PDO, true); // Enable PDO mode (used in PHP > 7 and when mysql* methods are not available)
Constant
Description
Example value
e_ADMIN
/e107_admin/
e_ADMIN_ABS
/e107_admin/
e_AVATAR
./e107_media/(hash)/avatars/
e_AVATAR_ABS
/e107_media/(hash)/avatars/
e_AVATAR_DEFAULT
./e107_media/(hash)/avatars/default/
e_AVATAR_DEFAULT_ABS
/e107_media/(hash)/avatars/default/
e_AVATAR_UPLOAD
./e107_media/(hash)/avatars/upload/
e_AVATAR_UPLOAD_ABS
/e107_media/(hash)/avatars/upload/
e_BACKUP
./e107_system/(hash)/backup/
e_BOOTSTRAP
./e107_web/bootstrap/
e_CACHE
./e107_system/(hash)/cache/
e_CACHE_CONTENT
./e107_system/(hash)/cache/content/
e_CACHE_DB
./e107_system/(hash)/cache/db/
e_CACHE_IMAGE
./e107_system/(hash)/cache/images/
e_CACHE_IMAGE_ABS
/e107_system/(hash)/cache/images/
e_CACHE_URL
./e107_system/(hash)/cache/url/
e_CORE
./e107_core/
e_CSS
/e107_web/css/
e_CSS_ABS
/e107_web/css/
e_DOCROOT
C:/webdev/www/
e_DOCS
./e107_docs/help/
e_DOCS_ABS
/e107_docs/
e_DOWNLOAD
./e107_media/(hash)/files/
e_FILE
./e107_files/
e_FILE_ABS
/e107_files/
e_HANDLER
./e107_handlers/
e_HELP
./e107_docs/help/
e_HELP_ABS
/e107_docs/help/
e_IMAGE
./e107_images/
e_IMAGE_ABS
/e107_images/
e_IMPORT
./e107_system/(hash)/import/
e_IMPORT_ABS
e_JS
/e107_web/js/
e_JS_ABS
/e107_web/js/
e_LANGUAGEDIR
./e107_languages/
e_LOG
./e107_system/(hash)/logs/
e_MEDIA
./e107_media/(hash)/
e_MEDIA_ABS
/e107_media/(hash)/
e_MEDIA_BASE
./e107_media/
e_MEDIA_FILE
./e107_media/(hash)/files/
e_MEDIA_FILE_ABS
/e107_media/(hash)/files/
e_MEDIA_ICON
./e107_media/(hash)/icons/
e_MEDIA_ICON_ABS
/e107_media/(hash)/icons/
e_MEDIA_IMAGE
./e107_media/(hash)/images/
e_MEDIA_IMAGE_ABS
/e107_media/(hash)/images/
e_MEDIA_VIDEO
./e107_media/(hash)/videos/
e_MEDIA_VIDEO_ABS
/e107_media/(hash)/videos/
e_PLUGIN
./e107_plugins/
e_PLUGIN_ABS
/e107_plugins/
e_ROOT
C:\webdev\www\
e_SYSTEM
./e107_system/(hash)/
e_SYSTEM_BASE
./e107_system/
e_TEMP
./e107_system/(hash)/temp/
e_THEME
./e107_themes/
e_THEME_ABS
/e107_themes/
e_UPLOAD
./e107_system/(hash)/temp/
e_WEB
./e107_web/
e_WEB_ABS
/e107_web/
e_WEB_CSS
./e107_web/css/
e_WEB_IMAGE
./e107_web/images/
e_WEB_IMAGE_ABS
/e107_web/images/
e_WEB_JS
./e107_web/js/
Constant
Description
Example value
e_HTTP
SITEURLBASE
SITEURL
e_BASE
e_BASE_SELF
e_SELF
THEME
THEME_ABS
e_ROOT
e_ROUTE
e_PAGE
e_LOGIN
Constant
Description
Example value
USER
Shows if a user is logged in (boolean)
1
USERCLASS
USERCLASS_LIST
Userclasses the user belongs to
253,254,250,251,0
USERCURRENTVISIT
UNIX timestamp....
1615651180
USEREMAIL
admin@mywebsite.com
USERID
1
USERIMAGE
zaqRWcP-_400x400.jpg
USERIP
0000:0000:0000:0000:0000:ffff:7f00:0001
USERJOINED
1588259340
USERLAN
English
USERLV
1615499410
USERNAME
Administrator
USERPHOTO
USERSIGNATURE
USERTHEME
USERTIMEZONE
UTC
USERURL
USERVISITS
82
Constant
Description
Example value
SITEADMIN
Administrator
SITEADMINEMAIL
admin@mywebsite.com
SITEBUTTON
/e107_images/button.png
SITECONTACTINFO
<strong class='bbcode bold bbcode-b'>My Company</strong><br />13 My Address St.<br />City, State, Country<br /><strong class='bbcode bold bbcode-b'>Phone:</strong> 555-555-5555<br /><strong class='bbcode bold bbcode-b'>Email:</strong> sales@mydomain.com
SITEDESCRIPTION
SITEDISCLAIMER
SITEEMAIL
admin@mywebsite.com
SITENAME
MyWebsite
SITETAG
e107 Website System
SITEURL
http://clean3004.test/
SITEURLBASE
http://clean3004.test
Constant
ID
Description
e_UC_PUBLIC
0
e_UC_MAINADMIN
250
e_UC_READONLY
251
e_UC_GUEST
252
e_UC_MEMBER
253
e_UC_ADMIN
254
e_UC_NOBODY
255
e_UC_ADMINMOD
249
Admins (includes main admins)
e_UC_MODS
248
Moderators (who aren't admins)
e_UC_NEWUSER
247
Users in 'probationary' period
e_UC_BOTS
246
Reserved to identify search bots
e_UC_SPECIAL_BASE
243
Assign class IDs 243 and above for fixed/special purposes
e_UC_SPECIAL_END
255
Highest 'special' class
Constant
Description
Example value
e_LAN
e_LANCODE
e_LANGUAGE
e_LANLIST
e_LANQRY
Constant
Description
Example value
e_DEBUG
1
e_DEBUG_CANONICAL
e_DEBUG_JS_FOOTER
e_DEVELOPER
1
e_MENU
e_MOD_REWRITE
1
e_MOD_REWRITE_MEDIA
1
e_MOD_REWRITE_STATIC
1
e_NOCACHE
e_SECURITY_LEVEL
5
e_SINGLE_ENTRY
e_TOKEN
Constant
Description
Example value
THEME
./e107_themes/bootstrap3/
THEME_ABS
/e107_themes/bootstrap3/
THEME_LAYOUT
jumbotron_home
THEME_LEGACY
THEME_STYLE
style.css
THEME_VERSION
2.3
Constant
Description
Example value
e_PLUGIN_DIR_ABS
Constant
Description
Example value
XURL_FACEBOOK
XURL_TWITTER
XURL_YOUTUBE
XURL_GOOGLE
XURL_LINKEDIN
XURL_GITHUB
XURL_FLICKR
XURL_INSTAGRAM
XURL_PINTEREST
XURL_STEAM
XURL_VIMEO