Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

Image moderation

4 years 8 months ago #316960 by jeroen aalders
Replied by jeroen aalders on topic Image moderation
and where can I find and replace the images for pending approval for example?

public_html/components/com_comprofiler/images/english/

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
4 years 8 months ago #316968 by krileon
Replied by krileon on topic Image moderation
They're apart of CBs template files. Simply add your new custom images to the below folders.

Avatar/Image Fields:
/components/com_comprofiler/plugin/templates/default/images/avatar

Canvas Field:
/components/com_comprofiler/plugin/templates/default/images/canvas

You need to supply 2 files per image. 1 is the fullsize and 1 is the thumbnail. Thumbnails should be named the same as the fullsize except their name should be prefixed with "tn".


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.

4 years 8 months ago #317254 by jeroen aalders
Replied by jeroen aalders on topic Image moderation
After many hours of setting up different configurations and testing, I have not gotten it working as I wish.

I have created two email auto actions (for two different image fields, in which user can upload an image)
I have added the trigger 'onAfterUserAvatarUpdate' on the global tab
I have added field = fieldname, operator = equal to, and value = 0 on the conditions tab
Result: no mails are being send...

When I change the settings to:
I have added the trigger 'onAfterUserAvatarUpdate' on the global tab
I have added field = fieldname, operator = not equal to, and value = 0 on the conditions tab
Result: I receive both emails, even when I only add one of the two images

What do I do wrong and how can I configure it that for upload imageA, email A is send and for upload imageB, email B is send?

Looking forward to hearing your expertise...

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
4 years 8 months ago - 4 years 8 months ago #317269 by krileon
Replied by krileon on topic Image moderation

I have added field = fieldname, operator = equal to, and value = 0 on the conditions tab
Result: no mails are being send...

Probably because your condition doesn't make any sense. An image field will never have a value of 0. I'm guessing you're trying to condition against the approved column of a field. To do that you need to use a custom value substitution like the following.

Field: Custom > Value
Custom Value: [avatarapproved]
Operator: Not Equal To
Value: 1

This would pass the condition if the avatar image field is not approved. The approved column is always [FIELD_NAMEapproved] format for its substitution.

What do I do wrong and how can I configure it that for upload imageA, email A is send and for upload imageB, email B is send?

You'll likely need to do a field value comparison. That trigger contains the following variables.

Code:
$_PLUGINS->trigger( 'onAfterUserAvatarUpdate', array( &$user, &$user, $isModerator, $newFileName ) );

They count from left to right. So var1 is $user, var2 is $user (doubled due to legacy code), var3 is $isModerator, and var4 is $newFileName. It does not contain the field name of the field being uploaded to. It is properly going to be easier to use the below usage so you can compare new value vs old value to confirm that a field has actually changed values.

Global
Triggers: onAfterUpdateUser, onAfterUserUpdate
User: Automatic
Access: Everybody
Conditions (custom value)
1: [var1_FIELD_NAME] Not Equal To [var3_FIELD_NAME]
2: [var1_FIELD_NAMEapproved] Not Equal To 1

With the above it will check if the supplied FIELD_NAME has changed its value and that its approved column is not equal to 1 (so not approved). This will function for backend and frontend profile updates. So for example if you wanted to do this for the avatar field your conditions would look like the following.

1: [var1_avatar] Not Equal To [var3_avatar]
2: [var1_avatarapproved] Not Equal To 1

You can use this usage (minus the approved column since it only applies to image fields) for any field to perform an action on field value change.


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.
Last edit: 4 years 8 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum