On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • JoCo (Jot Comments tool)
    Last version : Module: 0.9.2 , Snippet: 0.9.1.4
    On : 2009/01/21


    I re-wrote and upgraded JoCo. In new version

    • You can moderate your comments
    • You can moderate comments from your last login
    • You can moderate comments of documents which you have created or published or edited
    • Search in comments by string and highlighting, by webgroups, users, guests, docgroups, documents, between two dates and etc
    • All important elements need permissions to see and managers can set permission, add or remove a user and etc
    • There is summary part for see list of documents which have comments, subscriptions, last comment date and ...
    • JoCo users do not see comments in documents that they have not enough permissions to access them
    • Another view added for manage more comments in a page
    • Manage and modify all Jot calls in TVs, Chunks and document Content (in module).  NEW in 0.9.2
    • And... .


    By JoCo snippet you have module in a frontend page, you can set trusted webusers to access to this page and moderate comments. There are some parameters to set permissions for each webuser and set a certain permission for all webusers for example no webuser can edit a comment or access to permission part and ....
    To see snippet parameters see snippets codes.
    Put JoCo snippet call in a documents with BLANK template.

    Also you can see logs of webusers actions in JoCo module


    other descriptions,

    Hint :
    - JoCo gets value of jot custom fields ONLY from "jot_fields" table. if it find a custom field, search the language file for a string which it's KEY is the custom field label and prints the value of language variables else prints the label of field. you can see some default custom fields below:
    $JoCo_lang['name'] = "Name";
    $JoCo_lang['email'] = "Email";
    $JoCo_lang['website'] = "Website";
    $JoCo_lang['title'] = "Subject";
    so you can add yours easily; for example if you have set userGender custom field in Jot, you can add variable below and see "Gender" instead "userGender":
    $JoCo_lang['userGender'] = "Gender";
    all found custom fields prints automatically.

    - JoCo codes are clear but there is another way to custimize output without modify modules codes directly:
    There is customactions.php in joco/inculdes folder. you can add your custom codes in this file to modify output. it is useful for set some data that needs to more codes for example insering FULL NAME of comment owner or update another table on delete a comment and etc.
    It contains 5 functions that each one runs in a LOOP:
    * onBeforeSetOutputRow($row,$tpl) : It runs after comments data collected from "jot_content" and "jot_fields" tables. $row is comment data which is an associative array, KEY is column name and VALUE is column value from "jot_content". $row['label] is another associative array, KEY is "label" column and VALUE is "content" column value from "jot_fields". This function MUST return an array with 2 items, first is associative array that is merged to $row (VALUE of $row['customKey'] is replaced with [+customKey+]  in indv.tpl.html) and second is new row tpl which is replaced with current tpl.

    * onBeforeCheckRow($row) : It runs right before parse comment output and decides to accept (and parse) comment or reject comment. If it returns TRUE comment data will parse and if it returns FALSE current comment will reject.

    functions below run right before UPDATE database and return void :
    * onBeforePublish($comment_id)
    * onBeforeUnpublish($comment_id)
    * onBeforeDelete($comment_id)
    * onBeforeEdit($comment_id)




    Download: https://github.com/AmirHossein/JoCo



    Goodluck  wink [ed. note: AHHP last edited this post 7 years, 11 months ago.]
      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
    • Really good work.
      Seems to work perfectly.
      At last, a full manager option for Jot. grin
      • Very nice!

        You can find a german language file in the attachment.
          Bye,
          Mithrandir
        • Great addition to our MODx resource ! smiley

          But I’ve got warning message like this.
          I’m not a coder of PHP so I don’t understand the meaning of this message... embarrassed
          I found this in the eventlog of MODx system.


          date() [function.date]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ’Asia/Tokyo’ for ’JST/9.0/no DST’ instead
          • Christmas is early this year! kiss
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • Thats great AHHP! It was one of much needed addon IMO.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • This should be in the Resource Repository! Thanks grin
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don't know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                • Cool, will test this one soon smiley
                    with regards,

                    Ronald Lokers
                    'Front-end developer' @ h2o Media

                  • Thank you all for testing and reporting errors wink

                    PHP errors in MODx event log solved and date() function replace with strftime(). I tried to solve date_default_timezone_set() error, i have no error now and i hope you have not too.
                      God loves me. 【ツ】


                      MODX.ir (Persian Support)

                      Boplo.ir/modx/ (Persian)
                    • Quote from: AHHP at Nov 17, 2008, 02:21 PM

                      PHP errors in MODx event log solved and date() function replace with strftime(). I tried to solve date_default_timezone_set() error, i have no error now and i hope you have not too.
                      I replaced my JoCo module to version 0.8.1 and errors in the eventlog disappeared !!
                      Thank you for your updating this module. laugh