Replacer error

1 year 2 months ago - 1 year 2 months ago #332665 by liaskas
Replied by liaskas on topic Replacer error
Enabled in 2 points.

1. In Activity plugin configuration
    Parameters / Activity / Parser
2. Menu that leads to activity page
    Menu Item Type:
    Plugin: CB Activity
    Action: Activity (Activity Tab)

Followed the same steps on your demo site but it does not seem to work there either.

Please Log in to join the conversation.

1 year 2 months ago #332668 by krileon
Replied by krileon on topic Replacer error
Sorry for the confusion. That parser can only apply to system messages and not regular user messages. This is noted in the parameters description and is entirely my mistake recommending it as a solution. Applying it to regular user messages would allow them to do things like insert Joomla modules and utilize other CB content plugins like CB Content Bot to substitute in other users data.

A bad words filter is planned for CB Activity 6.0.0 though. However it is possible to add a bad words filter, but will require CB Auto Actions to do it. I've confirmed the below will work.

Triggers: activity_onParse
Type: Code
User: Self
Access: Everybody
Method: PHP
$variables['var1'] = preg_replace( '#<a href="mailto:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" rel="nofollow noopener" target="_blank">[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}</a>#i', '*Removed*', $variables['var1'] );
References: Variable 1

You can actually use the above to manipulate the resulting message however you like with whatever custom parsing behavior you want. Note the REGEXP was adjusted to account for the final parser result which is a link since you've links enabled.

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.
The following user(s) said Thank You: liaskas

Please Log in to join the conversation.

1 year 2 months ago #332672 by liaskas
Replied by liaskas on topic Replacer error
Thank you for your generous help Krileon!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.214 seconds