datedfilelist plugin

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
redkevin11
Forum Members
Forum Members
Posts: 29
Joined: Fri May 20, 2005 6:21 pm

datedfilelist plugin

Post by redkevin11 »

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]
Last edited by redkevin11 on Fri Sep 23, 2005 9:32 pm, edited 1 time in total.
westis

Re: datedfilelist plugin

Post by westis »

redkevin11, looks like a very nice module. Couldn't this be integrated with the Uploads module somehow? I love that thing to separate by headers for month or year.

I currently use the Uploads module for a similar purpose, which can sort by upload date. I'd prefer to be able to set a custom date, like for a newsletter that is uploaded at a later date. Right now I write this as YYYY-MM-DD in the summary field and sort by that field. But if this is written in its own field, by year and month, then it would be possible to separate by headers too.

What do you think, would it be possible to integrate with the Uploads module or this module has a different purpose?
redkevin11
Forum Members
Forum Members
Posts: 29
Joined: Fri May 20, 2005 6:21 pm

Re: datedfilelist plugin

Post by redkevin11 »

I like using this instead of the file uploads because you really don't have to configure anything.  You can just create a folder with the file manager and upload documents, everything is automated, and you don't have to chose a category, enter date in summary field, name the file, and chose a document to upload.

However, I could see a user needing additional ability to restrict fileuploading from other users.  Of course the plugin has no permissions.  I'm sure an additional mode  with dynamic headers could be programmed into the uploads module fairly easily.

This plugin fit the specific needs of a client, where they have tons of pdfs in a mmddyyyy format already.  I was able to just ftp all of the files into a directory and it spit everything out nicely, without having to manage each individual entry.

I don't have time to extend the uploads module, but maybe someone would be up to the task.  Any takers?
redkevin11
Forum Members
Forum Members
Posts: 29
Joined: Fri May 20, 2005 6:21 pm

Re: datedfilelist plugin

Post by redkevin11 »

I don't know if anyone is interested, but here is an update to the plugin.
  • September 28, 2005 - 1.1 - Fixed some typo's and added a user ability to change header date formats
  • September 23, 2005 - 1.0 - Initial Release
Of course rename it to function.datedfilelist.php

[attachment deleted by admin]
Post Reply

Return to “Modules/Add-Ons”