Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

CB Gallery question

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 7 months ago - 1 year 7 months ago #333960 by activha
Replied by activha on topic CB Gallery question
I meant the privacy status of the document in CB gallery :-)

So that if the document is set as private by the user I will process it differently.

I also noticed that the trigger gallery_onAfterCreateItem acts once the document is uploaded and not once it's terminated. Is it possible to act when the user clicks on terminate instead ? so that if it does not follow the process we wouldn't have lost items 
Last edit: 1 year 7 months ago by activha.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 7 months ago #333971 by krileon
Replied by krileon on topic CB Gallery question
Privacy is stored in CB Privacy not CB Gallery so no you can't get that from the gallery object. You'll need to build its privacy object to do that or just query against the privacy database table _comprofiler_plugin_privacy to get its privacy rule (private is 99). The asset for CB Gallery privacy entries will be: gallery.MEDIA_TYPE.MEDIA_ID (e.g. gallery.photos.123).

I also noticed that the trigger gallery_onAfterCreateItem acts once the document is uploaded and not once it's terminated. Is it possible to act when the user clicks on terminate instead ? so that if it does not follow the process we wouldn't have lost items

I've no idea what you mean here. That trigger is fired when a new media entry is created. This will always be 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 or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 7 months ago - 1 year 7 months ago #333989 by activha
Replied by activha on topic CB Gallery question

I've no idea what you mean here. That trigger is fired when a new media entry is created. This will always be the case.

Sorry I forgot that the Cancel button is not the one that confirms the loading but only reverts to the profile page...

Are the triggers gallery_OnAfterCreateitem and gallery_OnAfterUpdateItem enough to deal with all the cases where the users edit the item and its privacy ?

Also if I want to send the file, is $document = $variables->path(); to access it and post it ?
Last edit: 1 year 7 months ago by activha.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 7 months ago #333995 by krileon
Replied by krileon on topic CB Gallery question

Are the triggers gallery_OnAfterCreateitem and gallery_OnAfterUpdateItem enough to deal with all the cases where the users edit the item and its privacy ?

Yes, the create trigger is fired when new media is created and the update trigger is fired when media is edited.

Also if I want to send the file, is $document = $variables->path(); to access it and post it ?

Files are protected by htaccess permissions. They cannot be accessed directly. They must be output by PHP, which is done with the output function as follows.
Code:
$variables['var1']->output();


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 or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 7 months ago #334000 by activha
Replied by activha on topic CB Gallery question
Ok thanks a lot ;-)

Last issue, is the privacy rule available at the time where the item is added ?

I tried this but always get null
Code:
$asset = $action->string($user, '[var1_asset]'); $db    = Factory::getDbo(); $query = $db->getQuery(true)     ->select('rule')     ->from($db->quoteName('#__comprofiler_plugin_privacy'))     ->where($db->quoteName('asset') . ' = ' . $db->quote($asset)); $db->setQuery($query); $private= $db->loadResult();

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 7 months ago #334004 by krileon
Replied by krileon on topic CB Gallery question
The privacy rule is handled by the system action. So it won't be available until after that system action stores it.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum