Uploader_XH - a CMSimple_XH Plugin

Plugin Icon

Uploader_XH facilitates the upload of files to the images, downloads, userfiles and media folders. Contrary to the internal filemanager it allows queued and chunked upload, so it is an alternative to FTP, if you want to upload many and/or large files. It is not a filemanager, but could easily be used by these.

Please do read this documentation! It's generally a good idea to read the documentation, before you encounter any problems!

Important Notice

Uploader_XH couldn't be tested so far in various environments, and the interface for use by other plugins might change. It is a so called ALPHA version. Use with caution!

Requirements

Uploader_XH is a plugin for CMSimple_XH. It requires a UTF-8 encoded version. Furthermore you need a modern browser that supports the required HTML5 features, or one of the supported browser extensions must be installed.

Installation

The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.

  1. Backup the data on your server.
  2. Unzip the distribution on your computer.
  3. Upload the whole directory uploader/ to your server into the CMSimple_XH plugins directory.
  4. Set write permissions to the subdirectories config/, css/, and languages/.
  5. Switch to Uploader in the back-end to check if all requirements are fulfilled.

Settings

The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select "Uploader" from "Plugins".

You can change the default settings of Uploader_XH in "Plugin Config". Hints for the options will be displayed when hovering over the help icon with your mouse. The most important setting is "runtimes". Not all runtimes are supported on all browsers, and except "html5" all require a browser extension to be installed. And not all runtimes will support every feature, and different runtimes might handle details slightly different. So change the order of the runtimes to work best for your needs and your browser(s). You can check the chosen runtime by hovering over the upload widget.

Localization is done in "Plugin Language". You can translate the character strings to your own language, or customize them according to your needs.

The look of Uploader_XH can be customized in "Plugin Stylesheet".

Usage

Back-End

In the back-end under "Uploader" → "Upload" you'll find the upload form: Screenshot It's usage is pretty much self-explaining. Use the select-boxes to choose the type of upload, the subfolder and the size for JPEG and PNG images.

Front-End

It's possible to use Uploader_XH on a CMSimple page. You are strongly advised to make use of this feature only on pages that are not publicly available (e.g. pages protected by Memberpages_XH or Register_mod_XH). Even if it's possible to restrict the upload widget to particular filetypes and folders, as described in the following, a user can use Uploader_XH's full capabilities, after he's given access to the upload widget, if he calls the appropriate URL directly. So restrict the access to the upload widget to trustworthy users.

To display the upload widget insert in the content:

{{{PLUGIN:uploader(%TYPE%, %SUBDIR%, %RESIZE%, %COLLAPSED%);}}}

The placeholders have the following meaning:

%TYPE%
The upload type, i.e. 'images', 'downloads', 'media' or 'userfiles'. '*' will display a selectbox to the user. Defaults to 'images'.
%SUBDIR%
The subfolder (terminated by /) relative to the type's folder (set in CMSimple's configuration) where the files should be uploaded to. Note that the subfolder has to exist. '*' will display a selectbox to the user. Defaults to ''.
%RESIZE%
The resize mode for uploaded JPEG or PNG images, i.e. '' (no resizing), 'small', 'medium', 'large'. '*' will display a selectbox to the user. Defaults to ''. The exact sizes can be set in Uploader_XH's configuration.
%COLLAPSED%
Whether the uploader widget should initially be collapsed: '1' (yes) or '0' (no). Defaults to '0'.

Some examples:

Developers

It's very simple to use Uploader_XH from other plugins, e.g. filemanagers.

  1. Initialization

    Just include init.php (error checking omitted for brevity):

    include_once $pth['folder']['plugins'].'uploader/init.php';
  2. Usage

    Just browse to /plugins/uploader/uploader.php in an IFrame or new window. The uploader script processes several query parameters:

    uploader_type
    "images", "downloads", "userfiles" or "media".
    uploader_subdir
    The sub-folder of the type's folder terminated by a "/".
    uploader_resize
    "", "small", "medium", "large" or "custom".
    uploader_width, uploader_height and uploader_quality
    Only used when uploader_resize=custom. The width, height and quality (integer values) for the resize operation.

License

Uploader_XH is licensed under GPLv3.

init.php is licensed under MIT License.

© 2011-2012 Christoph M. Becker

Slovak translation © 2012 Dr. Martin Sereday
Czech translation © 2012 Josef Němec
Danish translation © 2012 Jens Maegard

Credits

Uploader_XH uses Plupload. Many thanks to Moxiecode Systems AB for releasing it under GPL.

The plugin icon is designed by schollidesign. Many thanks for publishing this icon under GPL.

This plugin uses free applications icons from Aha-Soft. Many thanks for making these icons freely available.

Many thanks to the community at the CMSimple forum for tips, suggestions and testing. Particularly I want to thank twc, who made me aware of Plupload, and wolfgang_58 and Tata for testing and reporting bugs. And many thanks to Holger, who tested the API and helped improving it.

Last but not least many thanks to Peter Harteg, the "father" of CMSimple, and all developers of CMSimple_XH without whom this amazing CMS wouldn't exist.