datedfilelist plugin
Posted: Fri Sep 23, 2005 9:27 pm
I just created a new plugin that I'd love to have a few people test before I attempt to add it to the wiki.
Of course remove .txt from the attached file.
Here's my explanation of what it does from the function. See the actual function documentation for a cleaner printing of the instructions:
What does this do?
Creates an ordered list of dated files in a given directory.
How do I use it?
Requires that documents in gived folder have the syntax MMDDYYYY. The format MMDDYY also works for years between 1990-2090. Otherwise, files are at the end of the list with their given filename.
Basic syntax is {datedfilelist folder="/path/from/url/root"}. Note the beginning slash and no ending slash.
Example: your target folder is at http://your.site.com/uploads/newsletters : {datedfilelist folder="/uploads/newsletters"}
Also allows content to be separated by headers for Month or Year.
With the following files in http://your.site.com/uploads/bulletins :
070305.pdf
071005.pdf
072405.pdf
081405.pdf
082105.pdf
082805.pdf
090405.pdf
121104.pdf
incorrectformat.pdf
{datedfilelist folder="/uploads/bulletins" header="month"} gives you :
incorrectformat.pdf
September 2005
Sun, Sep 4th, 2005
August 2005
Sun, Aug 28th, 2005
Sun, Aug 21st, 2005
Sun, Aug 14th, 2005
July 2005
Sun, Jul 24th, 2005
Sun, Jul 10th, 2005
Sun, Jul 3rd, 2005
December 2004
Sat, Dec 11th, 2004
What parameters does it take?
* (required) folder - An absolute folder path containing properly named files.
* (optional) header - Split the results by month or date. Options : month or date. Default shows no headers.
* (optional) limit - Maximum number of files printed. Default is 100.
* (optional) target - The link target. Default is _self
* (optional) dateFormat - The date format. See http://php.net/date. Default is D, M jS, Y.
* (optional) class - Class for the tag. Default is datedfilelist
* Error Messages (to override default messages)
* (optional) errorMsgFolderUndefined - Error message for a folder not defined.
* (optional) errorMsgFolder - Error message for a defined folder not found
* (optional) errorMsgheader - Error message for an incorrect header parameter
[attachment deleted by admin]
Of course remove .txt from the attached file.
Here's my explanation of what it does from the function. See the actual function documentation for a cleaner printing of the instructions:
What does this do?
Creates an ordered list of dated files in a given directory.
How do I use it?
Requires that documents in gived folder have the syntax MMDDYYYY. The format MMDDYY also works for years between 1990-2090. Otherwise, files are at the end of the list with their given filename.
Basic syntax is {datedfilelist folder="/path/from/url/root"}. Note the beginning slash and no ending slash.
Example: your target folder is at http://your.site.com/uploads/newsletters : {datedfilelist folder="/uploads/newsletters"}
Also allows content to be separated by headers for Month or Year.
With the following files in http://your.site.com/uploads/bulletins :
070305.pdf
071005.pdf
072405.pdf
081405.pdf
082105.pdf
082805.pdf
090405.pdf
121104.pdf
incorrectformat.pdf
{datedfilelist folder="/uploads/bulletins" header="month"} gives you :
incorrectformat.pdf
September 2005
Sun, Sep 4th, 2005
August 2005
Sun, Aug 28th, 2005
Sun, Aug 21st, 2005
Sun, Aug 14th, 2005
July 2005
Sun, Jul 24th, 2005
Sun, Jul 10th, 2005
Sun, Jul 3rd, 2005
December 2004
Sat, Dec 11th, 2004
What parameters does it take?
* (required) folder - An absolute folder path containing properly named files.
* (optional) header - Split the results by month or date. Options : month or date. Default shows no headers.
* (optional) limit - Maximum number of files printed. Default is 100.
* (optional) target - The link target. Default is _self
* (optional) dateFormat - The date format. See http://php.net/date. Default is D, M jS, Y.
* (optional) class - Class for the tag. Default is datedfilelist
* Error Messages (to override default messages)
* (optional) errorMsgFolderUndefined - Error message for a folder not defined.
* (optional) errorMsgFolder - Error message for a defined folder not found
* (optional) errorMsgheader - Error message for an incorrect header parameter
[attachment deleted by admin]