-
Ivijan-Stefan Stipic started the topic Cover image error handling in the forum How-to & Troubleshooting 3 years, 1 month ago
Is there any hook I can use to manage errors during the cover image upload?
It is very important to me that I can throw out some error oruku if the image is too small or too big.
Thanks!
-
Ivijan-Stefan Stipic replied to the topic Upload avatar directly from the folder via PHP in the forum How-to & Troubleshooting 3 years, 2 months ago
Thank you!
Here is complete script for this:
// Setup
$path = 'some/folder/where/is/prepared/image.jpg'; // EXAMPLE
$user_id = 123; // EXAMPLE
$upload_path = bp_core_avatar_upload_path();
$upload_dir = 'avatars';// Define filename and data
$filename = pathinfo($path, PATHINFO_BASENAME);
$data = file_get_contents( $path );// Prepare final…[Read more]
-
Ivijan-Stefan Stipic started the topic Upload avatar directly from the folder via PHP in the forum How-to & Troubleshooting 3 years, 2 months ago
I have over 800 users for whom I have to upload a custom avatar. I have prepared a script that matches the username with the image name and all I have to do is call some BP function to set the avatar according to the user ID. How to do it and what function to use?
@ivijanstefan
Active 4 days, 18 hours ago