Menu link to display all users media

1 month 2 days ago #316253 by activha
I was thinking at something like :
1) setting a new gallery field with an asset setting as global.marketings.[user_id].field.[field_id]
2) build a new html button allowing any authorized user to "pin" any asset from this gallery
3) keep a list of pinned items by the user on its profile
4) keep a count of viewed pinned items somewhere

Would it be possible to display any pinned item anywhere with a cb substitution ?
Is this scenario doable ?
1 month 2 days ago #316256 by krileon
Media does not have an asset unique to it self. The asset is unique to a gallery. So the only way to pin something is to effectively copy it.

Is this scenario doable ?

CB Gallery wasn't designed for what you're trying to force it to do. It can do it but only by copying media. I believe the Likes usage will be able to fulfill this once CB Activity has list view for likes so users can review everything they've liked, but I've no idea when that will be implemented.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
1 month 2 days ago #316258 by activha

...So the only way to pin something is to effectively copy it..

We would like the owner to be able to change or modify its media and that the result will be dispatched on all users who would have pinned it, so copying is not a solution

We would also like to keep track of the view counts regarding the pinned/liked/copied media for the user who pinned it.

I was thinking that CB plugins had all the tools to do this but I don't really see how to achieve and would like to avoid another component.

Roughly we have business users with marketing stuff (video, images, files) in a new gallery and we would like our other users to be able to pin this stuff on their own page/profile and keep track of the visitors views for each stuff.

Do you have any ideas ?
1 month 2 days ago #316264 by krileon

We would like the owner to be able to change or modify its media and that the result will be dispatched on all users who would have pinned it, so copying is not a solution

I don't have an out of the box solution for you.

We would also like to keep track of the view counts regarding the pinned/liked/copied media for the user who pinned it.

Likes count is already tracked as part of CB Activity. There is no pinned or copy functionality so there's no tracking of that so you'd need to implement that.

I was thinking that CB plugins had all the tools to do this but I don't really see how to achieve and would like to avoid another component.

Likes is the closest it gets to what you're wanting, but currently doesn't have a list view to review everything you've liked. It will need display parsing just like Activity has so people can actually see what they liked (e.g. the page would show the photo they liked), which is a significant amount of work so has not been implemented yet. The other future functionality that could potentially do this is the Share feature planned that'd allow sharing a photo to a users activity stream, but that'd just be an activity entry.

Roughly we have business users with marketing stuff (video, images, files) in a new gallery and we would like our other users to be able to pin this stuff on their own page/profile and keep track of the visitors views for each stuff.

The only thing I can think of is the users gallery asset would have to be dynamic since it does support substitutions, but doing this would be all or nothing approach. You either display all the business users media or none of it. You wouldn't be able to pin a singular item as again singular items do not have assets unique to that singular item. You'd have some sort of endpoint using CB Auto Actions to keep track of what they pinned. Then you'd need a code or query field to turn those pinned profile ids into assets. Then you'd substitute that code or query field into a gallery to display those other profile galleries.

Another approach maybe to modify a media asset after the fact to append its id and make them unique per entry. To do this you'd have to act on gallery_onAfterCreateGalleryItem with a Code action, change the asset of $variables (the media object) then save it. Example as follows.

Global
Triggers: gallery_onAfterCreateGalleryItem
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var3_asset]
Operator: Is REGEXP
Value: /^global\.marketings\.\d+\.field\.\d+$/
Action
Method: PHP
Code:
$variables['var3']->asset = $variables['var3']->asset . '.media.' . $variables['var3']->id;
$variables['var3']->store();

The asset would then go from global.marketings.42.field.3 to global.marketings.42.field.3.media.1. You'd then need to edit your gallery field and be sure its asset is set to a wildcard so these continue to display fine. You'd do that with the following asset.

global.marketings.[user_id].field.[field_id],global.marketings.[user_id].field.[field_id].media.%

Note it is important BOTH be there. The first is used for storage. The second is to let the modified media display. Storage can't have a wildcard so if you didn't have the first asset there the storage would fallback to profile gallery. This then gives you media specific assets for media. From there the pinning behavior would be up to you. You'd likely need a separate database table to keep track of everything a user has pinned and a CB Auto Actions endpoint to handle the pinning. You'd then need a query field to output a list of pinned assets. Next you'd substitute that query field into a galleries asset parameter to output those entries.

I don't have a clue if either of these solutions will completely work or fit your needs, but beyond that I don't have anything more I can suggest.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
1 month 2 days ago #316266 by activha
That's a very detailed and interesting answer, thanks.
I will begin to think about all based on that and let you know how this all works out
1 month 1 day ago - 1 month 1 day ago #316277 by activha

Another approach maybe to modify a media asset after the fact to append its id and make them unique per entry. To do this you'd have to act on gallery_onAfterCreateGalleryItem with a Code action, change the asset of $variables (the media object) then save it. Example as follows.


This approach seems fine but to enhance it I have some questions :

1) can we add a gallery field to a groupjive category only ? and use this approach
2) can we add some fields to a gallery ? to a group ? for instance a counter field and some other ones (text and numbers)

Another idea that I had would be to use the GroupJive Event plugin to control the timing of the marketing campaigns.
For instance we could use a new group per business user and let them add events (ie marketing campaings) which ability to set start and end dates. In this case we would use the event description for adding messages, videos and photos included in the group gallery (or elsewhere)
Then normal users would participate to the event or not, and if participating we would display only the event description somewhere on their profile.

Would this be doable and easier than using Galery ?
If yes, can we change some language strings in a single group category for our needs with auto actions ?
Could we in this case, display the dropdown list of all events a user is participating somewhere ? and display the event description of the chosen event ?

That would be a very good start and would only left the counter to be implemented for counting the number of views of a participating user chosen event.
Moderators: beatnantkrileon
Time to create page: 0.450 seconds

Facebook Twitter LinkedIn