File Thingie 2.5.0 and newer support a plugin system where it's possible to add functionality without modifying core File Thingie files. This makes it easier for you to make custom versions of File Thingie for your own personal use. Since the plugins live outside of File Thingie you will still be able to update your copy of File Thingie without having to merge your changes every time.
The plugin settings are placed below the regular settings and color settings in ft2.php. You disable a plugin by enclosing it in comments. For example if you want to disable the search plugin you would change the following:
$ft["plugins"]["search"] = TRUE;
to
/*
$ft["plugins"]["search"] = TRUE;
*/
To enable a previously disabled plugin remove these comments. To enable a new plugin create a new plugin setting. If the new plugin contains no settings to the format is:
$ft["plugins"]["PLUGINNAME"] = TRUE;
Replace PLUGINNAME with the name of the plugin.
If the plugin requires settings the format is:
$ft["plugins"]["PLUGINNAME"] = array(
"settings" => array(
"SETTINGNAME" => SETTINGVALUE,
"SETTINGNAME" => SETTINGVALUE,
)
);
Replace PLUGINNAME with the name of the plugin and SETTINGNAME and SETTINGVALUE with setting names and values. Setting values may require the use of quotes around them.
Each plugin consists of a PHP file. If you are using the expanded version of File Thingie you must place this file inside your PLUGINDIR. The default location is a folder called "ft_plugins". Using the simple version of File Thingie you need to create the PLUGINDIR manually before uploading the plugin file.
The search plugin handles searching of files and folders. It is enabled by default. Disable the plugin if you do not wish to be able to search for files and folders.
The edit plugin handles editing of text based files. It is enabled by default for txt, html, htm and css files. Disable the plugin if you do not want to be able to edit files. It has two settings: editlist (space separated list of file types for editing) and converttabs (TRUE to convert convert tabs to spaces when editing, FALSE to not).
The tinymce plugin handles insertion of the TinyMCE rich text editor when editing files. It is disabled by default. Before enabling this plugin you must download TinyMCE. See detailed installation instructions.
To create a new plugin you must create a new file in the PLUGINDIR. It should be named PLUGINNAME.plugin.php (replaced PLUGINNAME with the name of your plugin). This file should only have functions and no output under any cisumstances. Interaction with File Thingie is done using "hooks". Hooks are special functions that are run when certain events take place. Hooks all follow the naming convention ft_hook_HOOKNAME. To include a hook in your plugin replace "hook" with your plugin name and "HOOKNAME" with the name of the hook. For example in the edit plugin the info hook is called ft_edit_info.
The only required hook is ft_hook_info. It returns basic information about your plugin.
File Thingie currently ships with a limited set of hooks because new hooks are only added on an "as-needed" basis. The expanded version of File Thingie contains the file ft_hooks.php which has documentation for the current set of hooks. If you need a new hook contact me and I will add it.