Wow! My timing is amazing - I just came in to plead with you to create a system for uploading through the front end and found that you had posted this just a few hours ago.
I've created a similar system for uploading through the front end, without benefit of knowing PHP or how to code a UDT, which would no doubt make the whole thing work better. But it does work. It's a bit complicated, so I hope you can follow along. I figured this out by scouring the forum and I appreciate all the suggestions that others have posted in how to get the modules talking to each other.
- I have a site where many different front end users will upload images and I need to be able to keep each user's images separate from the rest.
- I've set up individual folders within Gallery and use their FEU login usernames to name the folders. I use the AE-Gallery to display the images on the users listing.
- I'm using CompanyDirectory to store and display each person's information and use a front end editing form so that they can update their listings. The form includes a custom field called Gallery where I enter the name of their folder. I call the Gallery module using that custom field, like this:
Code: Select all
{if $entry->customfieldsbyname.Gallery ne ''}
<h3>Image Gallery</h3>
{Gallery dir=$entry->customfieldsbyname.Gallery}
{/if}
- In Uploads, I have set up a category for each user and used the value from the companyid field from the CompanyDirectory module as the category name. The server path then directs the images into the Gallery folder set up for the corresponding user, i.e. images/Gallery/username. (For consistency, I would have loved to have used the username for the Uploads category name instead of the companyid but I couldn't figure out how to do that in the time I had.) The code I use in the CD template to handle the upload is :
Code: Select all
{cms_module module="Uploads" category="$companyid" mode="upload" nocaptcha="1"}
Here's the site:
http://www.artsquintewest.ca
Hopefully you're not rolling on the floor laughing by now at how primitive this system is, because it works. Really well.
...except for 3 things...
1. I have set all this up without benefit of a UDT, so it's pretty labour-intensive to add a new user. I'm intending to have a developer write a UDT to automate the process of creating new records in the various modules so that someone else can add new users without all the work it takes now.
2. Without a UDT, I can't get the info in the summary field of the Uploads module into the title file of the Gallery module. I don't want to show the image filenames and my quick and dirty solution was to remove the code that populates the alt tag in AE-Gallery, which of course means that the images don't have any alt information. Not my preferred way of doing things.
3. Regardless of the fact that the users have been asked to resize their images before uploading, they're sending 2 MB images. I was really hoping to find a way to resize the images while they are being uploaded, the way the Gallery module does so beautifully when uploading through the admin. This is why I came on here today to plead with you to create a way to do that.
Any thoughts on whether it's possible to get these images resized as they're being uploaded? I've used Jeremy Bass's SuperSizer module on another site and it works well but I haven't looked into whether it might work in this situation. However, with that module, the images are still uploaded in their huge size and then resized, and saved with a lot of extra numbers in the filenames. So the original images are still there and the filenames are confusing. I really love the way Gallery does the resizing during the upload so that the server space doesn't get filled up with huge, unused files. I've taken a quick look at Calguy's new SmartImage toolkit but as far as I can tell, it also affects only the output and I haven't yet figured out whether I can incorporate it into this system.
So - does the process of adding the file using your UploadToGallery UDT do any resizing or does it simply place the file in the Gallery folder? Is it even possible to do this kind of resizing? Does anyone else have any thoughts on how I might accomplish this? Or am I doomed to spending hours teaching people how to resize their images before uploading?
Grateful for any assistance and/or guidance,
Penny