Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

2nd Image upload in admin?

Quote Reply
2nd Image upload in admin?
Hi, I have found various image/upload related threads, but none that fit what I'd like to do.

I'd like to have a 2nd image upload section in the admin area, which is placed into a seperate directory than the first. ie. - upload 1 goes in folder 1, upload 2 goes in folder 2. Plus whatever it needs to get the 2nd image fields in the validation table etc if I do move it over to the user side as well.

Can anyone help with some advice on what to do?

Thanks.


Quote Reply
Re: 2nd Image upload in admin? In reply to
I'm not sure what you are asking. I often need a concrete example.

The mod I'm still hoping to have finished later today, will allow one upload, but should be easily modified to allow an unlimited number.

The problem is what is the layout scheme. Let me explain.

Everyone is going to want to lay out the physical files differently. For each specific purpose, it might make sense to have a custom layout scheme. The problem is, in developing a utility (especially the first few releases of it) this sort of flexibility makes debugging impossible, and adds layers of complexity that may only affect a few people.

In working with this over the years (since 1984) I have distilled the physical file layout problem down to 2 or perhaps 3 different systems, which should suffice for over 90% of all the installations. There may only be 1% that need (or have a good need for) a different system.

The first system:
1) One upload directory for images, accessed via LinkID.ext, with the ability to break it down into sequences to allow for faster directory searches (transparent to the webmaster). Good for smaller systems, or where there are few graphics in the larger scheme of things.

2) One upload directory for "users" where images are stored according to user name, in nested subdirectories the way mail and Unix home pages are done. The files are found <%upload_dir%>/a/<%Username%>/LinkID.ext. Good for systems with lots of activity, where some users may upload many images, and want to have reasonable access to their stuff -- and some sort of easy webmaster organization for copyright or archival reasons.

3) Multiple directories where images are stored _in_ the category layout itself, where an image uploaded to /category/x/y/z is stored in the folder /category/x/y/z. Great for a postcards site, where the link _IS_ an image. (This also allows for "unlinked" directories where large file bases external to the server can be read in as well....)


But, those are the three main systems. If you have another one, I'm always interested, _BUT_ before going into it, think about if the image-management is an application specific thing, or site-wide thing. What that means, is a banner system would want to group images completely differently, and would therefore have to hook into the upload system, and move the files around itself.

The systems I'm looking at are for standard installs, site-wide. Not "application specific" storage.

Make sense??


It makes sense for each link to have one associated file (a graphic) that can be in one group directory.

It makes sense for each link to have several associated files that can be stored in one group directory or a subdirectory for those files.

It makes sense for each user to have an upload directory where their links grab their files, such that each file is associated with a userID or name.

It makes sense for a large gallery, image management system to flexibly allow arbitrary storage on a disk, and let the interface link to them.

It does not make sense to allow each link to have two files attached, one that goes to sub-folder A and one that goes to sub-folder B. That is an "application" or custom modification of the basic system.

The upload system I've got can do that based on file type -- ie Ascii files go to one upload directory and binary go to another, but that is probably the limit of this that will be "standard."

Any "tighter" modifications will inevitably disable some code, which makes such mods site-specific.





PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: 2nd Image upload in admin? In reply to
Thanks for that - yes it all made sense to me. I may have complicated what is probably a farily simple task - and one which someone may already be doing.

What I want to do is have 2 images associated with a link, (which you can currently do by using the upload feature), but I want to be able to access each individually. For example, the first image I upload I'd like to be able to call with something like '<%ID%>1.fil', and the second with <%ID%>2.fil - or anything else that works.

I've tested it in the admin section and the images do keep the sequential order they're added, even after modifying the link - so hopefully there may be an easier fix or mod than what I was first asking for?

Hope that makes sense?

Quote Reply
Re: 2nd Image upload in admin? In reply to
Again, I'm not working with the 1.1x versions any more (much).

With NG, I'm working on making the mod work the same as the CatLinks. Such that, images can be uploaded to the links in an arbitrary number. But, I also want to give each link a positional placement. The system will try to default to the next number in sequence, (but there is overhead for that, fortunately only on an insert, and only once) and then each image can be placed on the page using a <%if image1%><%image1%><%endif%> type construct.

Also, a construct <%all_images%> and <%extra_images%> such that all_images does what it says, creates a tag with all images formatted to the image.html file, and inserted, and extra_images formats all the "extra" images -- ie" not image #1 which is considered to be the "logo" by default.

I think I posted some explanations of this awhile back, in the discussions about the shopping cart and catalog program.

The upload mod I'm working on for NG is an integral part of these programs, and I had to take the time to develop this key mod before going on. Also, this mod will allow others to build on it, etc. Hopefully, it will add full file and image functionality to links.

But, unfortunately, the more it develops, the less likely it will work with Links 1.1x.

Honestly, upgrading _IS_ worth the effort! Really!

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ