Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-08 16:54:09

marye
New Member
Registered: 2005-10-16
Posts: 3

Lots of images, one image upload folder?

Greetings,

On a topic (100’s of photos) from other threads I’ve seen in this forum:

Has anyone produced a plugin to “scatter” the images across subfolders? I’ve used lots gallery sw, but I’m still wanting an integrated solution for categories, sections, keywords, users, etc, as well a way to manage the images at a basic level. I don’t need all the extra gallery features most have, and TXP comes very close to what I need. Except that I’m nervous about one folder for thumbs and original images I have an historical archive of hundreds of images – maybe thousands if I’m ambitous.

I did a hack on my protoype txp instance last night to do such a thing, but I’m afraid it changed things in such a way that the plugin would just be repackaging (overriding) some txp files. The basic design does not affect the db table, just the image files.

The files affected are txp_image.php, txp_tag.php, taghandlers.php and class.thumb.php . I might be able to spare class.thumb.php but it would basically override some of the TXP subclass logic in that file.

I might be able to write a plugin(s) for this that does not affect the base code – need to investigate – but is there a plugin already that I haven’t seen? Also, what other scalability issues will I need to consider (caching has been mentioned) and/or what’s coming with 4.1? Should I be looking at the SVN?

Thanks for any help!

M.

<hr />

Here’s some details:

  • I took the “id” generated by TXP for the photo name and sort to a subfolder in the parent image directory. The sort folders are names numerically (0, 1, 2, etc). I tried both “fixed file total” and “variable file total” sortings -
  • For the fixed case I sorted by order, for example (floor($id / 100)) . This case means you will grow the parent image directory folders as the collection expands (fixed number of files in each subdirectory). This case would require the code or the administrator to deal with new subdirectories.
  • For the variable case I sorted by modulus, for example ($id%10) . This case means you will grow the subfolder file sets themselves, keeping a fixed set of subfolders under the parent image directory. In this case you could set up the subdirectories and forget about it.

So, for example in a case were there are 200-300 files,

in the “$id/100” case would yield directory/file structure something like:
/image/0/ – contains all files form 1.jpg and 1t.jpg through 99.jpg and 99t.jpg
/image/1/ – contains all files form 100.jpg and 100t.jpg through 199.jpg and 199t.jpg
/image/2/ – contains all files form 200.jpg and 200t.jpg through 299.jpg and 299t.jpg

in the “$id%10” case would yield a directory/file structure something like:
/image/0/ – contains all files ending in “0” or “0t”
/image/1/ – contains all files ending in “1” or “1t”
/image/2/ – contains all files ending in “2” or “2t”
/image/3/ – contains all files ending in “3” or “3t”
/image/4/ – contains all files ending in “4” or “4t”
/image/5/ – contains all files ending in “5” or “5t”
/image/6/ – contains all files ending in “6” or “6t”
/image/7/ – contains all files ending in “7” or “7t”
/image/8/ – contains all files ending in “8” or “8t”
/image/9/ – contains all files ending in “9” or “9t”

Offline

Board footer

Powered by FluxBB