Related Photos


#1

Is there a way to display related photos under the photo post being viewed? The post with the links like: http://mywebsite.com/members/johnsmith/media/545/


#2

Hi @rickmcgroovy,

You can try using Attributes Short-Code for what you need, but you need to modify single media template as per your requirement.

Please refer this documentation for more details : http://docs.rtcamp.com/rtmedia/features/shortcodes/gallery-shortcode/.


#3

How would i add it in that php file though?


#4

Hi @rickmcgroovy,

You can manually call shortcode using do_shortcode function.

For example:

echo do_shortcode( ‘[ your shortcode]’ );

Thank you.


#5

I tried it and all I keep getting is "Sorry !! There’s no media found for the request !! " no matter what attribute I put in there. Please help


#6

Hello @rickmcgroovy,

Can you please once explain your exact requirement? Also provide us the current shortcode you are using right now so that we can help you with that.

Thank you.


#7

this is the shortcode I pasted:

“<?php echo do_shortcode('[rtmedia_gallery global="false" context="activity"]') ?>” .

Basically what I’d like to do is under single media, show about 3 random related media(media type, tags, etc), sort of like this:

That example is from blog post but I’d like to do that with activities instead of blog posts. Thank you


#8

Hello @rickmcgroovy,

Unfortunately, there is not any option to display related media to activity feed as activity does not contain any option to add tag/attribute to media while posting. It will be pretty complicated way and will require good customization work too!

Thank you.


#9

doesn’t have to be specifically “related media”, just a gallery of 3 to 4 photos pulling up random media from any the same user will do. Given the rtmedia has a gallery shortcode, I suppose its possible, right?


#10

Hello @rickmcgroovy,

We can point out right direction for this. For fetching random 3 media uploaded by current logged in user per activity post, you need to follow below steps.

  • You need to use BuddyPress’ hook ‘bp_activity_posted_update’ to get activity content. As we have also used this hook in rtMedia to append media to activity content, you need to get updated content from the BuddyPress’ activity table using lower priority value. We have called this hook on priority value 99, so you can use bigger value to call this hook let say 199.

  • Once you get updated content from BuddyPress’ table, fetch random images of current logged in user. You can query to ‘***get()***’ method of ‘RTMediaModel.php’ class.

  • Once you get random media, simply append them to updated content you have got in step 1.

  • Save modified content back to the BuddyPress’ table.

Hope this helps you.

Thank you.


#11

I must admit that this is beyond my comprehension…

My goal was to be able to display more activities/media when a user sees one. But after the last update, it seems like rtmedia got rid of the title bar that lead to a single-media page so I can’t even use that anymore.


#12