Download & Extend

Organize the images in a monthly, weekly, or daily archive.

Project:Image Picker
Version:6.x-2.13
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

This is a good module. Thanks.

Can you add the option to automatically put the images into folders organized by time, say monthly, weekly or daily? Now all the images are in the base folder. I'm afraid that folder will become too large.

Comments

#1

Modern filesystems can easily cope with 10,000+ nodes and some eg reiserfs are effectively unlimited, but I will put archiving on the TODO list ;-)

#2

Thank you for being so responsive. :)

Even if performance is perhaps not an issue, archiving also helps keeping the folders neat and organized. :)

I really like this module. It's light-weighted, easy to use, and meets almost all my needs nicely. Apart from this archiving feature, there is only one thing I can think of: compatibility with Views. If it can works with Views, it is perfect in my opinion. :)

#3

As I said earlier, I will think about it, but bear in mind that it will add quite a lot of extra complexity:

  • The user will have to have a choice, none, daily, weekly or monthly
  • A cron will have to be set up to do the work
  • The new path will have to be stored somewhere, per image
  • additional code for browser, list, quota and stats functions
  • validation functions rewritten
  • maintain backward compatibility and new update functions

As far as Views is concerned, it does not support 3-way joins or many-to-many relationships so there is no way of using Imagepicker Groups within Views, I have tried ;-( If anyone knows better then post an export.
Without groups you could only select on name, title, description or date, not very exciting really and there are already other image handling modules that do Views.

#4

Oh, what I ask is not putting the images first in the base folder and then moving them into some archive folders. So there is no need for cron job. Ideally, the process is like this:

The user will have a choice, none, daily, weekly or monthly. Let's say we set it to monthly.

A folder is created when a images is uploaded for the first time in the month. If that folder already exists, images are directly put into that folder. The HTML generated for insertion reflects the new path (and the URL is stored in database).

Images uploaded prior to the change are not affected. (Their location in the file system is not changed. the HTML that had been inserted is not changed. No need to change. But for future ease of use, we may want to generate and store URLs for the old images.)

Another useful thing to record is which image is used in which node(s). This one might be difficult, but is very useful, especially combined with Views.

I don't use quota and groups for my site (where I'm the only one who uploads images), so I don't know the possible effects to them.

I've tried other image modules but they all seem to be inclined to make simple things complicated. You have to install four or five modules (because A is dependent on B, B is dependent on C, etc.) and do a lot of configurations before you can get anything to work if you can get it to work at all! On the contrary, this ImagePicker module is so smooth to use. Just enable it and you're ready to go. I love this module and thank you so much!

#5

I've just been looking at the demo for SEO Toaster and I think BettyJJ has something in mind like what they're using.

One difference, and I think what they do is much better. They simply let users create a new dir at upload time if they want to, and put the image in there. So images can be arranged thematically by subject, by date or not organized at all.

I don't think there's any facility for moving images and I don't think there's a facility for moving images, because I think they are just dopping in straight html. So if you wanted to move an image, you would have to move it on the server and then do a search and replace on the DB. I'm fine with that.

For me, the issue with Image Assist or Image Picker or any of the Drupal solutions is that if you have thousands of images, it is beyond difficult to page through and find on.

The exception is Gallery integration with the G2 module which allows you to browse the directory tree for images. I use that for a site where I add all the content, but for sites where you'll have many users, the process of creating an album, then uploading to it, then choosing from it is complex (if I could create the album at upload time, the G2 module would be the grail).

Anyway, they have a video here

http://www.seotoaster.com/working-with-media.html

and a demo here
http://www.seotoaster.com/demo-seotoaster-cms-free-seo-software.html

I'd love to see something clean and simple like that in Drupal.

#6

Status:active» closed (fixed)

#7

Version:6.x-2.5» 6.x-2.13
Status:closed (fixed)» active

Is it possible to integrate it with Token or FileField Paths?

#8

Please don't hijack the issue queue, open another issue, stating clearly what you want with links to the relevant projects and how you would want the integration to work. Please remember that Imagepicker does not work with nodes, it supplies images to be used in nodes as is stated on the project page.

TIA

#9

I just wanted to avoid duplication :) And I think it's related anyway, may be I didn't explain correctly.

I mean if it was possible to use tokens in file path, like other modules do, i.e create subfolders for uploaded files based on date or user name. Just to keep files more organised.
I personally need to create subfolders for each user, I think it's a good idea.
So if you insist, I can open a new issue.

#10

imagepicker already stores uploaded files by uid, and in list view they can be sorted by date.

If you or anyone else can provide code to support the tokens module without breaking existing methods and retaining backward compatibility I'll be happy to consider reviewing the code.

#11

I just started Drupal 6 months ago, but I can give it a try. If you can give me a clue where to start.

#12

Well, you will need git and a good text editor or better still a programmers IDE, Eclipse is popular among drupallers. Git will allow you to pull down the latest copy of imagepicker and maintain your own local repository. Smartgit is a useful gui for this or you can install git in Eclipse.

Most of the upload functionality is in imagepicker.upload.inc and most of the functions are in imagepicker.functions.inc. You can figure out which paths lead to which functions in imagepicker_menu() which is in imagepicker.module.

You will want to be familiar with http://api.drupal.org and http://drupal.org/documentation, this is where all the help is.

The Firefox browser has some good plugins, Web Developer toolbar, Firebug and Colorzilla are useful.

If you haven't got a LAMP stack already, have a look at http://www.apachefriends.org/en/xampp.html, this will give you a complete working environment, even on Windows. Alternately use a separate computer or install Virtualbox and install Ubuntu or Debian in there for a complete server environment without the need for a separate box.

That should be enough information to get you started. ;-)

#13

Status:active» closed (works as designed)
nobody click here