• Please help me how to show photos or images uploaded by users(be it author, admin or subscriber etc)… Showing all the photos uploaded by the current user..

    please help me, I’ve been looking for this solution for a long time.. I’d be very much thankful to whoever guides me in this issue..

    Thanks in advance…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can you please be more specific and explain what you need exactly.

    Thread Starter jbboro3

    (@jbboro3)

    @sidati I want to show all the photos or images uploaded by author or subscriber.. I’m using User submitted post to receive blogs & articles from the users. So they upload plenty of images in the articles that are inserted within the editing content area of tinymce.. Now I want to show the images of each users they submitted through post. For eg., just like all the post of particular users can be displayed..

    Thanks

    Since media are just “posts” you can fetch them using the get_posts with some changes ??

    CHANGE THE ’00’ WITH THE ID OF THE USER.

    $media = get_posts(array(
    	'author' => 00,
    	'post_type' => 'attachment',
    	'post_mime_type' => 'image/jpeg'
    ));
    
    foreach ($media as $image) {
    	list($src) = wp_get_attachment_image_src( $image->ID, 'thumbnail');
    	echo '<img src="'.$src.'" alt="">';
    }
    Thread Starter jbboro3

    (@jbboro3)

    @sidati Thank you so much for your help.. It’s working perfectly even with buddypress.. But here I need little bit of customization.. A list of them are:

    * How can I echo elseif statement to show “custom message” when they don’t have any images uploaded. Like: if blah blah
    {
    echo “Match found” (the actual code to display);
    }
    else
    {
    echo “This user has no photos uploaded”;
    }
    ?>

    * How to limit number of images to be shown? (for example last 10 images upload instead of listing everything);

    * Extra question: Is it possible to set the gallery to private? Like they are visible to only himself or friends connection as in buddypress..

    * Ability to append upload url to post for commenting..

    Hoping to get positive answers. Thanks in advance!

    *

    • This reply was modified 8 years, 6 months ago by jbboro3.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show users photo upload’ is closed to new replies.