Using nodes for galleries and adding images to node/node_images instead of linking directly to files?
| Project: | IMCE_Gallery |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Jason,
First, this module adds functionality that many TinyMCE/IMCE users are looking for. This is great!
I'm curious if you looked at creating IMCE galleries as a nodes with a type of imcegallery before you went the direction of adding additional tables. Creating content outside of nodes limits interaction with other modules. I'm specifically interested in tagging images and galleries, but I'm sure there are a dozen modules built on node_images that could be reused if IMCE Gallery was changed.
The only column that would is not available by default to you in nodes that you've added in imce_gallery is g_pub_priv, but that functionality can be achieved with status (not published). You'd instantly add hundreds of features that are available to all nodes by making this change.
Likewise, if IMCE Gallery added images as nodes (and to node_image) when they are added to a gallery, imce_gallery_items could become imce_gallery_nid. Basically images can exists in a user IMCE folder, but don't show up as a database record until they are added to a gallery.
I think your IMCE Gallery is going to be an extremely popular module regardless, but this change will allow you to play better with others without sacrificing any of functionality you've already added.
If you looked into this and have reasons for going with these new tables (like new features having content in nodes wouldn't support?), that's fine. But if the new tables are there because you didn't consider working within the nodes table, I'd like to try to convince you to change this now. I'd be willing to help you do this (or just do it for you). This is your module and the long term direction is up to you, but this will be much more useful to me (and I'm guessing many other users) if it works with the image modules that already exist. I haven't found any reason why it can't.
If you're interested in seeing how this would work, I'll patch the latest version you've committed to CVS.
___
Kevin Reynen
Integrated Media Coordinator
Reynolds School of Journalism and
Advanced Media Research
University of Nevada, Reno

#1
Kevin,
So to understand you correctly, you are thinking about instead of adding the images to the table I created, instead it will go to the node_images and node tables and the table I create will have the nid that associates that image to the node. Right?
If I am correct, wouldn't it make the image be public for all to use on their gallery, that perhaps others may not want other users to use and/or add to their gallery? I understand that they can just save/copy it when they view others' gallery, but at least it will provide a bit of an obscurity to the gallery images of a specific user.
I have thought about it using the node_images, but I thought that the reason I mentioned above was viable and perhaps the route I have taken may be the best way. In any case, please don't hesitate to email me back with a retort. I am open to all ideas, if you have a good enough reason, I think I can be swayed to doing what you are suggesting. But, right now, I am not convinced enough.
By the way, thank you for the compliment. And, I love IMCE, I think it provides a better user interface than the regular image.module. Also, have you considered about using AJAX and also multiple file uploadsfor IMCE in the future? I would be willing to help out on developing that.
Regards,
Jason K
#2
IMCE is all ufku, though I did hack it to automagically create _icon, _thumb, _small, _medium, and _large versions of images. You'll be glad to know that TinyMCE is going to start using JQuery with 5.2.
We are really coming at this from two different directions since we want users to see each other's images. The project we'd like to use this for is ironically named "Share". I think there is a way we can have both...
At the gallery level, wouldn't setting the gallery status to unpublished accomplish the same thing as setting the gallery to private? Only the user who created the gallery and admin level users would be able to "see" it.
As for image level permissions, the images are only as private/secure as a user's ignorance of the file path. Not putting the images into the node table doesn't stop other users from getting to them. Even at this level, can't users create a gallery of unpublished images?
Adding the "add to gallery" button to the user's IMCE interface already limits the user to adding images from their IMCE user directory. What if images added to unpublished galleries were added to node/node_images as unpublished and only when a user published a gallery did the images in the gallery become published?
This would become problematic if users used the same image in multiple galleries that were set to both published and unpublished, but that could be solved with a check/alert if the image is used in multiple galleries.
The published images and galleries would then show up in searches, taxonomy lists, and user's track tab. Both the published and unpublished images and galleries would show up in the admin content interface where the sites admin could quickly change the status (or delete) several images/galleries at once.
#3
I am torn. I see what you are saying and it makes sense.
I am leaning towards your idea. I am still not completely convinced though.
I actually would not mind adding it to node_images. I am not sure about having it be of imcegallery node type. I think it can be of itself as a node of type images. I am a bit hesitant of making the galleries itself be of a node type.
Jason K
#4
hi,
it's good to see an effort for such a module.
I agree with kreynen on creating the images and galleries as nodes. I cant think of a non-node image gallery having non-node images.
If i were to create such a module and use IMCE for image upload and selection, i would probably make use of IMCE API to get the required information for images.
You simply call imce/browse from your custom javascript function and get the image information when the user selects one.
Thumbnail creation, resizing etc will be handled by IMCE and it will send the processed image information to your custom function.
For example a gallery creation interface supporting multiple image addition at once;
image-1
Title:
Description:
Image:(use IMCE to get the image, show image and write image path etc. to hidden form fields)
Thumb:(use IMCE to get the image, ...)
image-2
...
...
PREVIEW GALLERY (since i know everthing about the images in the gallery, i could provide an on-the-fly preview or slide-show without submitting the form)
SAVE GALLERY(form submission that creates image-nodes and then the gallery.)
this is what i can imagine as an efficient way to create galleries using IMCE.
#5
The Image module uses the term_data for creating galleries as tagged groupings, but there's no status setting on terms and no uid associated to them unless you require a dependency on a module like Taxonomy Access Control Lite.
#6
Okay, I'm convinced
I will make this happen.
Jason K