Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7510 closed enhancement (invalid)

Organize uploads into userlogin based folders

Reported by: capripot's profile capripot Owned by: capripot's profile capripot
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: upload, uploads, user_login, username, user_name
Focuses: Cc:

Description

Hi, I often would like to organize the upload folder with the user logins. It can be practice to delete all files from just one user, or just to separate them for give them a FTP account for exemple.

I modified just two files, the wp-includes/functions.php and the wp-admin/options-misc.php

You can tick the option on Misc Options

If you tick the "Organize my uploads into user_login based folders", Wordpress take your file in uploads/login/

If you tick the "Organize my uploads into month- and year-based folders" too, wordpress take your file in uploads/login/year/month/

Can I integrate this to a final release of Wordpress ?

Attachments (5)

options-misc.php (4.7 KB) - added by capripot 16 years ago.
options-misc.diff (1.3 KB) - added by capripot 16 years ago.
functions.php (86.6 KB) - added by capripot 16 years ago.
functions.diff (754 bytes) - added by capripot 16 years ago.
userlogin_upload_folders.php (2.5 KB) - added by capripot 16 years ago.
This is the plugin do the same thing

Download all attachments as: .zip

Change History (12)

@capripot
16 years ago

@capripot
16 years ago

#1 @DD32
16 years ago

-1 for core, IMO it'd be better used as a plugin, at least for now. I'm thinking of the Personal blogs, Of course, multi-author blogs would have a different situation of course - but a plugin can take care of that for the short-term.

If you wish to delete all files uploaded by a user, Then you also need to remove the attachments from within WordPress, else the Uploads section will get cluttered with non-existant items, So to me, It makes more sense to have a plugin which allows you to delete attachments from a specific author.

Furthur to that: If you give users a FTP directory, and they upload directly into the uploads folder, The file will NOT be available from within the WordPress media gallery/uploads.

#2 @capripot
16 years ago

Yes, but for the big files, FTP is more practice.
After that, they have just to write the correct URL in the field "URL" of the Upload window.

And you are right, delete the folder is not a good idea because of attachments. But for the FTP agencement, it can be practice.

Yes I can make a plugin, but how can I modify the function wp_upload_dir() ?
Have I to make copy of the entire function to add the three line I want ?

#3 @DD32
16 years ago

I wrote the plugin "Add From Server" to deal with uploading files via FTP btw - http://wordpress.org/extend/plugins/add-from-server/

Yes I can make a plugin, but how can I modify the function wp_upload_dir() ? Have I to make copy of the entire function to add the three line I want ?

It passes through the upload_dir filter at the end, I did a similar thing with another plugin: http://wordpress.org/extend/plugins/dpost-uploads/ to store uploads into a year/month folder of the post rather than the current date.

Dont get me wrong, I *can* see the use of this by some, I just dont see a use for the large majority of people.

#4 @capripot
16 years ago

We can desactivate the option when there is just one author too, no?

#5 @capripot
16 years ago

I've made the plugin ;) All is right ?

@capripot
16 years ago

This is the plugin do the same thing

#6 @caesarsgrunt
16 years ago

  • Milestone 2.7 deleted
  • Priority changed from high to normal

Is this plugin the final decision? (I think it should be, most people won't want it so core is wrong.)

If so, can this ticket be closed?

#7 @capripot
16 years ago

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.