Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 9 replies, 2 voices, and was last updated 10 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
03/11/2016 at 7:12 am #368596
Jack McLean
ParticipantI am in need of the image Id’s for uploaded images by users of the directory.
Where can I find the image ID’s?
03/11/2016 at 8:49 am #368598Steven Zahm
Keymaster@ Jack
There are no image IDs… the images are uploaded with the name the image was uploaded with. They can be found in the
../wp-content/uploads/connections-images/folder.Hope that helps!
03/11/2016 at 8:51 am #368599Jack McLean
ParticipantThank you. I need to have them in the media library unfortunately, so is it possible to make the page to the uploads the same as the media library (in the hope that this would then add them to the admin area media library)?
03/11/2016 at 9:37 am #368607Steven Zahm
Keymaster@ Jack
Sorry, no, Connections does not integrate with the Media Library. Giving users access to that is a security risk as the media library allows files other than images to be uploaded as well as see images they may not be permitted to have access to. There are now ways around these, but, when Connections was originally developed there were none.
If you need to get images into the Media Library in addition to Connections… you could write an extension which hooks into the
cn_post_process_add-entryandcn_post_process_update-entryactions and side load the images into the media library but those images image would be in no way linked to the entry.03/11/2016 at 9:39 am #368608Jack McLean
ParticipantThanks for the quick response. If you provide services like this, how much would it cost to get this bit of custom development done? Could we talk about it by email perhaps
03/11/2016 at 10:26 am #368612Steven Zahm
Keymaster@ Jack
The devil is in the details as far as costs to have this developed… a service I do provide. Please feel free to contact me using the Contact link at the very bottom of this page to take it to an email conversation.
03/14/2016 at 10:09 am #368942Jack McLean
ParticipantDid you receive my email?
I would like to look at this. I have done the contact form.
I hope to hear from you soon.
03/14/2016 at 11:46 am #368957Steven Zahm
Keymaster@ Jack
Yes, I received it. I will be replying to it very shortly. Working thru my email and support queue from the weekend right now.
03/14/2016 at 11:58 am #368958Jack McLean
ParticipantIts not urgent, Just wanted to check you had received it. Thanks.
03/23/2016 at 10:27 am #370239Steven Zahm
KeymasterFor anyone look to do the same, here’s how:
Install the Code Snippets plugin.
Add a new snippet with the following code:
add_action( 'cn_post_process_add-entry', 'cn_insert_image_into_media_library' ); add_action( 'cn_post_process_update-entry', 'cn_insert_image_into_media_library' ); function cn_insert_image_into_media_library( $entry ) { $image = $entry->getimageMeta(); if ( ! is_wp_error( $image ) ) { /* * Read the contents of the upload directory. We need the * path to copy the file and the URL for uploading the file. */ $uploads = wp_upload_dir(); $uploads_dir = $uploads['path']; $uploads_url = $uploads['url']; // Copy the file from the root directory to the uploads directory copy( $image['path'], trailingslashit( $uploads_dir ) . $image['name'] ); /* * Get the URL to the file and grab the file and load * it into WordPress (and the Media Library) */ $url = trailingslashit( $uploads_url ) . $image['name']; $result = media_sideload_image( $url, 0, $image['name'] ); // If there's an error, then we'll write it to the error log. if ( is_wp_error( $result ) ) { error_log( print_r( $result, true ) ); } } }Save and Activate the new snippet.
Now, anytime a photo is uploaded, whether it is on an entry being added or an entry being updated, it will be duplicated in the Media Library.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
