[lang+sectionHeader+]
[lang+go_back_home+]

Jot Comments module

[+search+] [+permission+] [+summary+] [+jotCall+]

[lang+help+]

 

 

[lang+help_joco+]

JoCo : Jot and Comment module.

Version: 0.9

Author: AHHP ~ Boplo@Boplo.ir

Thanks to Aidan Lister for highlight codes

JoCo allow you to manage comments of your site which create by Jot snippet.
The administrators (role=1) can set permissions for other managers except other administrators. they can hide some parts of this module for managers so if you have been limited by permissions, you won't see all parts. JoCo has some parts that you would read descriptions below,

 

 

Main frame

You can see several links below the JoCo logo, these links let you choose that what kind of comments you want to see now.
JoCo uses your last login time and let you see comments that have created from this time. by click on Last comments, you will get this comments and My Comments link gets you all your comments in the site too.

There is a tiny part on the top of frame that allow you to change the theme. if you select Compressed, you will see more comments in the screen. it is good to manage many comments in one page.


after the links you see rows of comments. every row has some detaile:
  • comment title or subject has placed on eash row header or top bar.

  • on another side, you see AJAX button,
    • comment will Publish on click on button.
    • comment will Unpublish on click on button.
    • comment will Delete on click on button.
    • on click on button you will see the Edit form, press Save in this form to save changes.

  • There is link of the document that this comment have placed in it, below AJAX buttons.

  • IP of user is there too.

  • JoCo search comment custom fields and insert them. if the comment has been created by a site members, you will see his/her fullname and email. Time of creating comment is there too.

  • You see the message and probably a colorless word which indicates that comments is published or unpublished

  • in other side, there is checkboxes to do actions on more comments.

  • after all comment rows, there is Submit button that do actions that you choose by checking comment checkboxes.

User will not see the comments which are in documents that he/she can not access to them (documents in docgroups that user has no permissions to access them).

The comments with a little different style are user's own commnets.

 

 

Search

You can search or specify something to see special comments among many many commnets here.

  • Set the type of result in Display section.

  • You can search a specified word in comment or get comments that do not contain the word and do same by Regular Experssions too. the fields are content(message content), title(title or subject of comment), tagid(tagid of Jot call to get special result), flags(the flag image path to get comment by user's country). the string will be highlight in result page.

  • It is possible to search only in Documents that you want. you see fields below:
    • Parents gives you the parant chidren and pranet itself, value is comma delimated parent IDs that are integer.
    • Docgroup field allow you to search in documents that are members of comma delimated document groups names that are string
    • In Documents field you can give comma delimated document IDs that are integer
    • NOT Documents field is comma delimated document IDs that are integer to remove from results.
    • at last the link at the other side of these fields gives you the list of documents that you choose by fields. the striked document title exist but have no comment and striked numbers does not exist in site.

  • Next section allow you to get comments by their authors. here is like section above but for users. the Webgroups field gets comma delimated list of webgroup name that are string. user and NOT user fields get comma delimated user IDs that are integer. the checkbox let you add Geust authors to your results.

  • You can get comments between two dates from fisrt date to second date in Date limitation section.
    dates must be in YYYY-mm-dd format e.g. 1987-10-15

  • Limit section set the maximum numebr if results.

  • Sort section let you sort the result by comments data

  • and last section limits search in new comment from your last action in JoCo.

 

JoCo indicates the refrence of search for each result row. for example if you search in id=4 document and id=10 user's comments, in results there is a part that show you the result is from user fields or documents fields.

 

 

Permission

JoCo save each manager data by one using this module in database. if the new user isn't an administrator, he/she has minimum permissions else has full access.

In Permission part you see list of all site managers and list of managers who JoCo registers them.

You can add a manager to JoCo list by select the user from All user list and click on arrow button. also you can remove a exited user from JoCo table by press another arrow button.

When you select a existed user, the action button in center column turns on. click on it gives you this user permissions:

  • Publish comments allows user to see publish buttons and publish comments.
  • Unublish comments allows user to see unpublish buttons and unpublish comments.
  • Edit comments allows user to see edit buttons and edit comments.
  • Delete comments allows user to see delete buttons and delete comments.
  • Log actions logges an event in MODx log_manager table on publish, unpublish, edit and delete comments by this user. The ID of comments loggs too.
  • View all comments allows user to see the All comments link and results.
  • View published comments allows user to see the Published comments link and results.
  • View unpublished comments allows user to see the Unpublished comments link and results.
  • View IP allows user to see IP of each comment.
  • Manage Web user's permissions allows user to see and manage webuser part.
  • View search allows user to use JoCo search part.
  • View permissions allows user to access to this part to see and probably change the permissions.
  • View summary allows user to use JoCo summary part.
  • View Jot Calls allows user to use JoCo Jot Calls part.
  • Change theme allows user to change the default JoCo theme.
  • Default theme shows the default JoCo theme for this user.
  • Default view shows type of default view in main frame.
  • Comments of docs user has created the action for comments that are in documents that this users has created. if you select no permission, it will remove all another selected checkboxes.
  • Comments of docs user has published the action for comments that are in documents that this users has published. if you select no permission, it will remove all another selected checkboxes.
  • Comments of docs user has edited the action for comments that are in documents that this users has edited. selecting no permission will remove all another selected checkboxes.
  • Number of results in summary displays the number of results in each page of Summary part.
  • Number of results in main frame displays the number of results in each page of Main frame.
  • Number of results in Jot Calls displays the number of results in each page of Jot Calls.


Administrators can change other users except other administrators. This is not possible to remove an administrator too.
each user who access to this part can edit his/her permissions. it used for set default variables such as numeber of result in main frame of default theme and etc.

Do NOT select multiple user at same time, JoCo will do action on one of them.

 

 

Summary

In this part you can see a overall view of documents which has Jot call and comments.
you see the number comments in each document and go to manage only comments of this document on click on buttom. number of subsciptions in here too and you can full name and email address of subscriptors on click on button.

 

 

Jot Calls

It is possible to review and modify all Jot calls in your site. Calls in Document Content, Template Variables and Chunks.
You need "see document" manager role to see documents calls, "edit document" to modify them and "edit chunk" to modify chunk calls and you can't see documents that you have not enough manager permissions to see them.

 

 

JoCo Events

There are 5 PHP function that run at some events. This functions exist as class methods in includes/customActions.php. you should add your codes to this file.

  • onBeforeSetOutputRow($comment_row_array, $comment_tpl)
    JoCo runs a method to create each comment output, this method runs in that method. so it has been placed in a loop. You can find it in includes/joco.class.php at line 197

    Parameters:
    • $comment_row_array : this parameter is an associative array contains a row from "jot_content" table. JoCo sets DB data after this method from it's array output.
    • $comment_tpl : this is a string var conatins template for each comment row in output. you can use name of all "jot_content" table columns as placeholder in your template e.g. [+tagid+] that prints content of tagid column for this comment. please note that some values need permissions to see in output.

    It returns: an array,
    • first element is extended row data. JoCo merges this array with current row data. so for example if you add "gender" key to this array, you can get it's value by using [+gender+] in comment tpl.
    • second element is extended comment tpl that will be replaced with current tpl. you can add your proccess, change the tpl by your values and gets new tpl to JoCo to add other data.

  • onBeforeCheckRow($comment_row_array)
    JoCo runs this method right before parse a comment and will parse comment if this method return TRUE and will reject comment if this method return FALSE.It is useful to optimze speed of checking comments with some filters and reject unwanted comments before parsing them. You can find it in includes/joco.class.php at line 164

    Parameters:
    • $comment_row_array : this parameter is an associative array contains a row from "jot_content" table. JoCo sets DB data after this method from it's array output.

    It returns: boolean,
    • TRUE: will accept and parse comment.
    • FALSE: will reject comment.

Methods below are used to change some another tables or do something you want on actions such as logging or etc.

  • onBeforePublish($comment_id)
    This method runs right before updating "jot_content" table to publish a comment. You can find it in includes/joco.class.php at line 122

    Parameter:
    • $comment_id : Unique ID of comment. Content of id column in "jot_content" table.

    It returns: void.

  • onBeforeUnpublish($comment_id)
    This method runs right before updating "jot_content" table to unpublish a comment. You can find it in includes/joco.class.php at line 127

    Parameter:
    • $comment_id : Unique ID of comment. Content of id column in "jot_content" table.

    It returns: void.

  • onBeforeEdit($comment_id)
    This method runs right before updating "jot_content" table with new content of a comment. You can find it in includes/joco.class.php at line 132

    Parameter:
    • $comment_id : Unique ID of comment. Content of id column in "jot_content" table.

    It returns: void.

  • onBeforeDelete($comment_id)
    This method runs right before deleting a row from "jot_content" table. You can find it in includes/joco.class.php at line 137

    Parameter:
    • $comment_id : Unique ID of comment. Content of id column in "jot_content" table.

    It returns: void.

Good luck
   AHHP
2009/03/29