Skip to Content Skip to Menu

Moderator notes

  • cpm73
  • cpm73
  • OFFLINE
  • Posts: 11
  • Thanks: 0
  • Karma: 0
7 years 5 months ago #294290 by cpm73
Moderator notes was created by cpm73
I am referencing the lessons on CB 2.0 Tutorials 37 Text area fields...moderator tab configuration

Is it possible to set this up so mods can enter the notes in a text field, then it posts this note to a separate text area field? The goal is to keep mods from deleting old notes or notes left by other mods. The way the demo shows they could just wipe it clear then update and it would be blank. Sure is okay for admin to do this, but I would prefer mods to just be able to add notes not edit/remove prior ones.

I have been trying to accomplish this with auto actions, but I am just too new to this to get it right. I made 2 fields one the text field and one the text area. Set the text entry for profile edit only, and the text area for profile view only (under moderators tab so only mods can see them depending on whether they come via profile view or profile edit - the display is good just need to figure out how to accomplish the action of taking the text field entry and posting it to the text area.)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 5 months ago - 7 years 5 months ago #294292 by krileon
Replied by krileon on topic Moderator notes
You'd need to use CB Auto Actions to act on the after profile update trigger then use a Field action then use the prefix or suffix operator to add more to the second field.

Global
Triggers: onAfterUserUpdate
Type: Field
User: Automatic
Access: Everybody
Conditions
1: [FIELD_1_NAME_HERE] Not Empty
Action
Action 1
Field: SELECT_FIELD_2_HERE
Operator: Prefix
Value: [FIELD_1_NAME_HERE]
Action 2
Field: SELECT_FIELD_1_HERE
Operator: Set
Value: (leave empty)

That should prefix the value of field 1 to field 2 then empty field 1.


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: 7 years 5 months ago by krileon.
The following user(s) said Thank You: cpm73

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

  • cpm73
  • cpm73
  • OFFLINE
  • Posts: 11
  • Thanks: 0
  • Karma: 0
7 years 5 months ago - 7 years 5 months ago #294300 by cpm73
Replied by cpm73 on topic Moderator notes
Awesome. I had a few things right in my attempts, but the trigger was the key one i had wrong...

Small followup, as it is it jams everything together, how would I put in a carriage return in there to keep each entry a separate line on the 2nd field? I tried making a field titled carriage return set as custom html with a simple <br> in it and adding it to the action, but that just prints the <br> as text...

Also, what would I use to have it display the username of the mod who entered the text, as [username] puts in the name of the user whos profile is being noted in.. (I added a date and time stamp to the action already. the goal is to show: (date) (time) (moderator noting) (note), then skip a line so the next entry isnt right on top of the prior)
Last edit: 7 years 5 months ago by cpm73.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 5 months ago #294310 by krileon
Replied by krileon on topic Moderator notes

Small followup, as it is it jams everything together, how would I put in a carriage return in there to keep each entry a separate line on the 2nd field? I tried making a field titled carriage return set as custom html with a simple <br> in it and adding it to the action, but that just prints the <br> as text...

As it's a textarea field it doesn't allow HTML so you'd have to do a linebreak of \n\r or you can change the second field to a editor field and use a <br>.

Also, what would I use to have it display the username of the mod who entered the text, as [username] puts in the name of the user whos profile is being noted in.. (I added a date and time stamp to the action already. the goal is to show: (date) (time) (moderator noting) (note), then skip a line so the next entry isnt right on top of the prior)

You'd need to include the user parameter in your substitution. So for example [cb:userdata field="username" user="#me" /]. See the below substitution tutorial for details.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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: cpm73

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

  • cpm73
  • cpm73
  • OFFLINE
  • Posts: 11
  • Thanks: 0
  • Karma: 0
7 years 4 months ago - 7 years 4 months ago #294568 by cpm73
Replied by cpm73 on topic Moderator notes
Im trying to add a way for me, as super user, to reset the notes field now. Not moderators, just me.

I setup a reset field, same way as the notes field.

I made the appropriate auto action (just copied the mod note one and altered accordingly)

It works as wanted.

The problem I am having is getting this option to display only to me without having to create a superusers tab.

I set the reset field with a conditional:

Display: self
Field: usergroups
Usergroup: mods
mode: hide
default rest

When I login with my test moderator account, it keeps them from seeing this field as wanted - not theirs, not anyones.
however, when I login with my superuser account, I only see it when editing my profile. When I go in to edit another users profile it is not there.

I tried adding a second conditional setting usergroup superuser to show. did not work.
I switched them about (moved mod hide to slow 2, superuser show to slot 1) still did not work.

If I have to do another tab I will, would just be easier to consolidate this function into the mod tab.
Last edit: 7 years 4 months ago by cpm73.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 4 months ago - 7 years 4 months ago #294587 by krileon
Replied by krileon on topic Moderator notes
CB Conditional is always against the user being edited or displayed. You can use the below usage to condition against the viewing user.

Display: Field conditional self
Field: Custom > Value
Value: [cb:if user="#me" usergroup includes "USERGROUP_ID_HERE"]display[/cb:if]
Translate Value: false
Operator: Equal To
Value: display
Translate Value: false
Mode: Show

That should cause it to condition against the viewing user and if they've the supplied usergroup it'll output display then it'll condition against if the value is equal to display it'll display the field otherwise it'll hide it.

Another option is instead of making another field you can edit the layout for your notes field and add a checkbox to it that you condition against. Example as follows. Note you'd add this to "Profile Edit Value Layout" of your notes field.

Code:
[value] [cb:if user="#me" usergroup includes "USERGROUP_ID_HERE"]<div><span class="cbSnglCtrlLbl"><label class="checkbox-inline"><input type="checkbox" name="reset_admin_notes" value="1" /> Reset Notes </label></span></div>[/cb:if]

Now in your auto action just check for [post_reset_admin_notes] being equal to 1.


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: 7 years 4 months ago by krileon.
The following user(s) said Thank You: cpm73

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

Moderators: beatnantkrileon
Powered by Kunena Forum