Skip to Content Skip to Menu

Private Message System

2 years 3 months ago - 2 years 3 months ago #330106 by karloshull
Private Message System was created by karloshull
Hi
Can I limit how many messages the user sends in a day?


Cheers
Karl
Last edit: 2 years 3 months ago by karloshull. Reason: error

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 3 months ago #330109 by krileon
Replied by krileon on topic Private Message System
The PMS has no such functionality. You'd have to implement your own way of tracking the number of messages sent and limiting sending more. The below triggers can help with that as you could possibly work something out using CB Auto Actions.

Before Create Message (e.g. validate if they're allowed to send anymore here and set an error on $this)
Code:
$_PLUGINS->trigger( 'pm_onBeforeCreateMessage', array( &$this ) );
After Create Message (e.g. increment whatever you're using to keep track of how many messages they sent)
Code:
$_PLUGINS->trigger( 'pm_onAfterCreateMessage', array( $this ) );


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.

2 years 2 months ago #330117 by karloshull
Replied by karloshull on topic Private Message System
Ok what tab do I use?

Auto Actions

System Actions

Uses

Batches

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 2 months ago #330127 by krileon
Replied by krileon on topic Private Message System
You configure custom auto actions under the auto actions page. CB > Plugin Management and under CB Auto Actions is a button to Auto Actions. On the CB menu at the top of the page you can also reach it with Plugin Management > Auto Actions > Auto Actions.


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.

2 years 2 months ago #330159 by karloshull
Replied by karloshull on topic Private Message System
I am doing something wrong.

Please can you look at my screen shots.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 2 months ago #330160 by krileon
Replied by krileon on topic Private Message System
This is going to be very complicated with little to no experience with CB Auto Actions and no coding experience as requires SQL and PHP knowledge. You may want to consult with a developer to consider having them implement this for you. The Uses feature is number of uses for the auto action. It has nothing to do with private message limits. The PM field also has nothing to do with number of private messages, it's just a link to send someone a private message.

You will need to implement a custom database table to keep track of how many messages they have sent within a given day. This would require at the very least a user_id | count | date column setup. You'd then need to update that database table using pm_onAfterCreateMessage trigger with a query action. Then on pm_onBeforeCreateMessage you'd need a Code action with a query condition to check if they're past their daily limit and in the code use PHP to set an error on var1.


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