-
☆ A M B ☆
- 326 Posts
Thanks for the ideas! Unfortunately, I’m not sure if they’re exactly what I’m looking for. I’ve experimented with FDM, but it seems to have the same issues with front-end file uploading as NewsPublisher. And correct me if I’m wrong, but Quick Manager basically gives access to back-end functionality from the front end, similar to QuickEdit. But what I really need is a simple front-end form that will upload an image along with the blog post. NewsPublisher is exactly what I need, except it doesn’t work well with uploads.
My other thought is that I continue to use NewsPublisher and somehow integrate FileUpload or FancyUpload to handle the image upload process. This actually does work, but since this just dumps the image into a folder on the server with other images, I don’t know how to make it display the correct image with the correct blog page. Does this make sense?
My hope is that someone out there has done something similar and can enlighten me. It seems like there should be a simple solution, but I can’t find one anywhere.
-
☆ A M B ☆
- 326 Posts
I should clarify that this system will be behind a password-protected area, but anyone who has this password will be able to post. This is the main reason why anything that looks or feels like the back end won’t work -- I can’t train everyone, and it needs to appear to be part of the front end of the site.
In the manager you can select to have the resource manager available to web users. This is in the manager under Configuration in the interface & features tab and is labeled ’Web Users?’
-
☆ A M B ☆
- 326 Posts
Thanks -- I see where I can open the resource manager to web users, but I’m still a little confused. How do I tie into this from the NewsPublisher form? If I simply add a "file" input, it will add the file name, but it doesn’t actually do the uploading to the resource manager.
-
☆ A M B ☆
- 326 Posts
That’s the most thorough answer I’ve gotten so far, and it’s exactly what I’m trying to accomplish. The problem is, I’m not sure I’m strong enough in PHP or MySQL to pull this off on my own. If anyone is feeling incredibly generous, I could really use the help. Otherwise, I’ll try to fight through it on my own, and I’ll post my results to the forums if/when I get it working.
Did you ever find a solution? I am in need of something similar. If the fileupload snippets work can you force the name to be the same as the blog post? Document id 58 and image 58_photo.jpg? Then use [+id+]_photo.jpg to reference the photo.
DropboxUploader -- Upload files to a Dropbox account.
DIG -- Dynamic Image Generator
gus -- Google URL Shortener
makeQR -- Uses google chart api to make QR codes.
MODxTweeter -- Update your twitter status on publish.
-
☆ A M B ☆
- 24,524 Posts
That should certainly be doable; if the image is being uploaded by a form field on the blog document, then the move_uploaded_file function would just use $modx->documentIdentifier as part of the filename. Setting the $uploadfile value could also include some fancy parsing of the tmp_name to get the file type; it’s not safe to depend on the $_FILE[’type’] mime-type of the uploaded file.
$type = substr(strrchr($_FILES['userfile']['tmp_name'], "."), 1);
$uploadfile = $modx->documentIdentifier . "_photo." . $type;
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)