Uploader doesn't give user credit


#1

I noticed that when a user uploads a file with the uploader that they aren’t given credit on their media page. For example a user has 0 images and they use an uploader on a particular page. The photo uploads fine and display without a problem and when you click on the image it even takes you to that users media but their albums and photo counts remain at 0 and show nothing when you click on either.


#2

Hi Jason,

It is known behavior because those media were uploaded from some other page and are not profile media. If you try uploading from activity update or from media tab than you notice the media counts are working fine.


#3

That makes sense except I use all “default albums” so what happens when a person uses the widget uploader on a page and selects privacy as “private”? How would they ever see their pic again since they couldn’t see it in their profile media or any of the gallery displays since it’s marked as private.


#4

Hi jason,

Admin can set that option from widget settings. User can also select the album if admin allows that.


#5

Could you clarify what you mean by the user can select the album if the admin allows it? What setting are you referring to?


#6

Hi jason,
I am talking about the settings when admin add widgets to sidebar or footer section from WordPress admin > appearance > widget section.


#7

I was under the assumption that you cannot display a gallery that is set to anything other than “public” without a “oops” error. What shortcode setting do you use to display a “private” or “logged in users” only gallery?


#8

Yes, if you provide “global=true” in gallery shortcode than it will only show public media.

Well you can also remove that by just placing this code in your theme’s functions.php file.

add_action( 'rtmedia_pre_template', 'rtmedia_pre_template_remove_public_media_check', 99);  

function rtmedia_pre_template_remove_public_media_check(){  
	remove_filter('rtmedia-model-where-query', array( 'RTMediaGalleryShortcode' , 'rtmedia_query_where_filter'), 10 ,3 );  
}

Just not use global=true, set context and context_id value and it will show media according to privacy.


#9

Awesome. That is very helpful. Is there a way to add this code so that particular albums do a “memebership” validation query with this function:

<?php  
	if(pmpro_hasMembershipLevel('12'))  
	{  
	?>  
	//Place your HTML or PHP code here if the user is in the required membership level  
	...  
	<?php  
	}  
?>

#10

Hi Jaosn,
Can you give me some more details, what exactly you want to achieve?


#11

Say i have album called VIP that I only want users that are a part of the “vip” group to view. In the example the album i created has an Id of 117. I use the above code to validate my group memberships how would I implement that to apply when showing album 117?


#12

So, you want to show gallery if user is member of VIP group, right?
You can manually call gallery shortcode using do_shortcode function in this if condition block.
Ex,
echo do_shortcode("[rtmedia_gallery global=true album_id=‘117’]");

Let me know if I interpreted your requirement in wrong direction.


#13