Moving the rtmedia-activity-text div

Hi I’d like to move the rtmedia-activity-text div to be along side (to the right of) the video or image attachments if there are any. Whats the best way to achieve this. If there are no attachments then the text should be full width

Many thanks
Danny

Hi Danny, Yes, you can do that by some JavaScript and CSS tweaks only.

Hi Ritesh

If you can post me an example of the required and I'll do the rest

Thanks Danny

Hi Danny, If you are familiar with JS/CSS, by inspecting activity element, you can determine what JS/CSS code need to be apply. If not, you can hire a developer to do that for you.

Hi @riteshpatel, I cant seem to move the rtmedia-activity-text div to below the photo (its currently above the photo). I’ve edited app/main/controllers/activity/RTMediaActivity.php line 41-45 and moved it below line 96. It doesn’t work.

Could you point me in the right direction? Thanks

Hi @froster3

First of all, you shouldn’t edit the plugin code directly, all your changes will be vanished once you update the plugin. If you have edit the plugin code, please check it with new activity uploads. BuddyPress stores activity content into database so once activity content generated you can’t change them by just changing plugin code, you have to check it with new uploads.

Other solution I cant think of is to use rtmedia_bp_activity_posted action hook and change activity content using regex and string search/replace to alter the markup of content. You just need to search for div with rtmedia-activity-text class and extract that div from markup and append it at the end of markup. You can check about the hook here: https://github.com/rtCamp/rtMedia/blob/3.8.21/app/main/controllers/activity/RTMediaBuddyPressActivity.php#L141

Thanks.

Thanks @riteshpatel! Works on new uploads. I’ll look into the hook as well.

Hi @riteshpatel, how can I add bp_activity_user_link to rtmedia-activity-text div? I’d like to have the poster’s username and link before the activity text. Thanks!

Hello @froster3,

We can suggest you to try below filter :

bp_activity_new_update_content

I hope this will help you. Thank you.

I would like to add it to rtmediaactivity.php within line 41-45 (I update line by line). I’ve tried to add $html .= $user_id; it doesnt work.

Hello @froster3,

You can check out the example here :

Thank you.

1 Like

Thank you @pranalipatel! How can I make the username a clickable link that goes to that users domain? Also, how can I not display the username if the activity-text is blank?