Wdir_XH facilitates displaying directory listings on your website, so you can easily make available a bunch of files for download.
Wdir_XH is meant to be a successor to the popular Wdir, which is out of development since a long time. Unfortunately, the license of Wdir does not allow for modifications, so Wdir_XH was rewritten from scratch.
Please do read this documentation before you encounter any problems!
Wdir_XH couldn't be tested so far in various environments. It is a so called beta version. Use with caution!
Wdir_XH is a plugin for CMSimple_XH. It requires CMSimple_XH ≥ 1.6 and PHP ≥ 5.2.0.
The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.
The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select "Wdir" from "Plugins".
You can change the default settings of Wdir_XH under "Config". Hints for the options will be displayed when hovering over the help icon with your mouse.
Localization is done under "Language". You can translate the character strings to your own language (if there is no appropriate language file available), or customize them according to your needs.
The look of Wdir_XH can be customized under "Stylesheet".
Wdir_XH allows to display files in the userfiles folder (userfiles/ by default).
To display a directory listing on a page, use:
{{{PLUGIN:wdir('PATH');}}}
where PATH is a subfolder of the userfiles folder. If you want to display the contents of userfiles/downloads/, for instance, you write:
{{{PLUGIN:wdir('downloads');}}}
To display the contents of the userfiles folder, use:
{{{PLUGIN:wdir('');}}}
The filenames in the list are linked to the files, so visitors are able to browse to the files; depending on the server and the browser settings some file types can be viewed in the browser, while others are offered to download.
Wdir_XH does not display any subfolders of the folder given as argument to the function, so visitors cannot traverse the directories. If you want visitors to be able to access some of the subfolders, you have to place multiple calls to wdir() on a page (or different pages).
You can pass a second argument to wdir() to filter the files; i.e. only filenames matching the filter will be displayed.
In the default mode the filter expressions are simple wildcard patterns, where an asterisk (*) is a wildcard for any number of characters and a question mark (?) is a wildcard for a single character.
So if you want to display only PDF files in the userfiles folder, use:
{{{PLUGIN:wdir('', '*.pdf');}}}
If you want to display all files in the userfiles folder which start with "Contract_", write:
{{{PLUGIN:wdir('', 'Contract_*');}}}
A much more powerful way of filtering can be enabled by activating the configuration option Filter → Regexp. Then the second argument to wdir() is treated as a PERL compatible regular expression. This mode should only be used by advanced webmasters, who can look up the syntax in the PHP manual.
Wdir_XH does not yet have all the options offered by Wdir 03beta, and a few will probably never be implemented (such as the display of the file owner and permissions).
On some architectures (e.g. Windows with PHP < 5.3) the simple wildcard patterns for filtering may not work. In this case you have to enable the regular expression patterns, if you need filtering (consider to distribute the files to different folders instead).
Wdir_XH is licensed under GPLv3.
© 2012-2015 Christoph M. Becker
Slovak translation © 2015 Dr. Martin Sereday
Russian translation © 2015 Васильев Леонид Валерьевич
The plugin icon is designed by Alexander Moore. Many thanks for publishing the icon under GPL.
The file icons are designed by 19eighty7. Many thanks for releasing them under a liberal license.
The sort icons are taken from MediaWiki. Many thanks for publishing these icons.
And 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.