CB Gallery link building

2 weeks 1 day ago #337977 by activha
CB Gallery link building was created by activha
Hello

I have a query autoaction which retrieves all photos of a user with a token.

Is it possible to build the CB Gallery link in the output instead of returning the result of the query and how could I do this ?

My query is 
SELECT id, value
FROM `#__comprofiler_plugin_gallery_items`
WHERE `type` = 'photos'
  AND `asset` LIKE 'monia.imgs.%'
  AND `user_id` = '[user_id]'
  AND (
    `description` LIKE CONCAT('%', '[post_keyword_1]', '%') 
    OR `title` LIKE CONCAT('%', '[post_keyword_1]', '%') 
    OR `file` LIKE CONCAT('%', '[post_keyword_1]', '%')
    OR `description` LIKE CONCAT('%', '[post_keyword_2]', '%') 
    OR `title` LIKE CONCAT('%', '[post_keyword_2]', '%') 
    OR `file` LIKE CONCAT('%', '[post_keyword_2]', '%')
  );

I am thinking at substitutions but cannot really see how ?

Thanks
 

Please Log in to join the conversation.

2 weeks 20 hours ago #337982 by krileon
Replied by krileon on topic CB Gallery link building
A link to what exactly? The image itself, the gallery with the image displayed, the modal window contents? There's a few links available for media. Example as follows.

Inline Modal Window
index.php?option=com_comprofiler&view=pluginclass&plugin=cbgallery&action=item&func=display&id=MEDIA_ID_HERE

Embedded Media
index.php?option=com_comprofiler&view=pluginclass&plugin=cbgallery&action=item&func=embed&id=MEDIA_ID_HERE

Media Preview Image
index.php?option=com_comprofiler&view=pluginclass&plugin=cbgallery&action=item&func=preview&id=MEDIA_ID_HERE

Media
index.php?option=com_comprofiler&view=pluginclass&plugin=cbgallery&action=item&func=show&id=MEDIA_ID_HERE

How you build this is entirely up to you. For example you could just CONCAT it together. It won't be in SEO format though. The other option is to use PHP and process your query results to add whatever additional data you need.

Note if the media belongs to a custom gallery it won't be able to rebuild it from the URL. The above mainly works really well with profile galleries. All other galleries you'll need to utilize gallery_onGalleryAccess and rebuild them from the URL. This will eventually be solved like it was with CB Activity by moving galleries to storage, but currently that's not the case.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.193 seconds

Facebook Twitter LinkedIn