We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33992 ☆ A M B ☆
    • 455 Posts
    You can add your cusom filters by onBeforeSetOutputRow method in customFunctions class (JoCo/includes/customactions.php)
    If you want specify spams by a word of CSS class in each row, you should add a placeholder in tpls/indv.tpl.html and tpls/indv.tpl.compressed.html (like [+spam+]). add Akismet checks to onBeforeSetOutputRow method, it has two parameters, first parameter is comment db-row array and second is each comment tpl. you can add a new element to row array like this:
    $row['spam'] = "This is spam!";

    and JoCo replaces the placeholder. You can also use str_replace function directly for raplacing placeholder.

    You can add a Spam view to JoCo easily by this method. A link that give you list of spams.
    For this, you can add link to tpls/module.tpl.html and tpls/module.tpl/compressed.html like this:
    <a href="index.php?a=112&id=[+mKey+]&spam=1">Spams</a>

    and in onBeforeSetOutputRow method use IF statement like below:
    if( $_GET['spam'] == 1 && Akismet does NOT recognizes it as a spam )
    	$tpl = "";

    JoCo use contents of $tpl as final comment tpl. So if you use $tpl like above, nothing in this row will appear and output only contains spam comments.
    JoCo snippet is same as module, in snippet you must create link like this:
    <a href="[~[+mKey+]~]&spam=1">Spams</a>
    or
    <a href="[+pageUrl+]spam=1">Spams</a>    [+pageUrl+] inserts normal or friendly page url with "?" or "&"
    



    anyway It is possible to add a new method in customactions.php for Akismat and call it in onBeforeSetOutputRow and check comments IF API_KEY exist and add another method such as  onBeforeCheckRow that reject comment in before processes on row to optimize speed.

    What do you think?

    --------------------------------------------
    EDIT: You can use onBeforeCheckRow in >= 0.9.1 version. It runs right before parse comment so in example above:
    if( $_GET['spam'] == 1 )
    {
    	if(Akismet recognizes it as a spam )
    		return false; // This comment is spam and  will reject
    	else
    		return true; // others will print
    }

    It can reverse for just-spams view ...
      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
      • 33337
      • 3,975 Posts
      Hi Amir,

      I get this error when I run the module:

      Fatal error: Call to undefined function: str_ireplace() in ***/public_html/assets/modules/JoCo/includes/joco.class.php on line 244

      Any help? smiley

      edit: I am using latest, v 0.9.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 3749
        • 24,544 Posts
        Quote from: zi at Jan 14, 2009, 11:09 PM

        Hi Amir,

        I get this error when I run the module:

        Fatal error: Call to undefined function: str_ireplace() in ***/public_html/assets/modules/JoCo/includes/joco.class.php on line 244

        Any help? smiley

        edit: I am using latest, v 0.9.

        str_ireplace() is only available in PHP5. You could ask your host to upgrade you to PHP5 or try to find the source code for the str_ireplace() function and plug it into that file.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 33992 ☆ A M B ☆
          • 455 Posts
          Quote from: zi at Jan 14, 2009, 11:09 PM

          Hi Amir,

          I get this error when I run the module:

          Fatal error: Call to undefined function: str_ireplace() in ***/public_html/assets/modules/JoCo/includes/joco.class.php on line 244

          Any help? smiley

          edit: I am using latest, v 0.9.

          Hi Zi,
          Thank you for reporting, upgrade to 0.9.1  wink


          Quote from: smashingred at Jan 01, 2009, 11:28 AM

          Thanks again for all the hard work. I wonder if anyone might want to somehow integrate Akismet w/ JoCo? Here are a few  classes:

          http://miphp.net/blog/view/php4_akismet_class
          http://www.achingbrain.net/stuff/akismet/
          http://vanhegan.net/software/akismet/

          Akismet only requires a Wordpress.com account and an API Key. It is free and you don’t need to host or use a blog there to have an account.

          This may actually be something that needs to be done at the Jot level in which case I could leave it but it seemed to make sense here. Lemme know if this seems wrong in JoCo as a feature/addon.

          Cheers,

          Jay
          I’ve added a new event to JoCo: onBeforeCheckRow. it runs before check comment data and if returns FALSE, JoCo will reject comment so it will optimize speed for akismet which filters comments and probably there is no need to check and parse a comment completely. Read more at JoCo-module HELP part.
            God loves me. 【ツ】


            MODX.ir (Persian Support)

            Boplo.ir/modx/ (Persian)
            • 33337
            • 3,975 Posts
            Thanks Bob and Amir! smiley
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              I have been checking this out today... I have to say it’s a nice piece of work you have done with this. 

              I have 1 question though... on the comments page in JoCo, there’s a list of comments I can delete or unpublish etc.  I can choose to select all documents to delete but there’s no submit button to carry out the multi selected boxes.  I can delete the comments individually but I don’t see the option to carry out the multi selection, hope that makes sense.

              The submit button is available in the module area, just checked that. I don’t see it signed in as a web user though, not sure if it should be available there.
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 33992 ☆ A M B ☆
                • 455 Posts
                Quote from: rossco at Jan 16, 2009, 08:02 AM

                The submit button is available in the module area, just checked that. I don’t see it signed in as a web user though, not sure if it should be available there.
                Display this button and ability to use it can be turned on and off. When a manager use JoCo, JoCo creates a full access permission for him but in snippet, when a webuser use JoCo, he has minimum access. He has to wait for a manager to create permissions such as see and use submit buttons. Managers can use JoCo snippet parameters to create permissions for webusers. please read JoCo-module HELP page and JoCo snippet code which has descriptions about parameters.
                  God loves me. 【ツ】


                  MODX.ir (Persian Support)

                  Boplo.ir/modx/ (Persian)
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  I’m receiving an error when I’m signed in as a web user... I click on the option My comments and it shows the error.

                  « MODx Parse Error »

                  MODx encountered the following error while attempting to parse the requested resource:
                  « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’ORDER BY uparent ASC’ at line 1 »
                  SQL: SELECT * FROM `my_site`.`modx_jot_content` WHERE createdby= ORDER BY uparent ASC
                  [Copy SQL to ClipBoard]

                  Parser timing
                  MySQL: 0.0023 s (7 Requests)
                  PHP: 0.0545 s
                  Total: 0.0568 s

                  The URL is showing the following index.php?a=112&id=315&WHERE=createdby=

                  The other options work fine, any idea what that issue is at all?
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 33992 ☆ A M B ☆
                    • 455 Posts
                    Thank you rossco
                    There was an invalid variable in lang file. It caused that i checked JoCo again and fixed some other tiny bugs in 0.9.1.3 wink
                    Also i found out that JoCo has serous problems in IE7 >:(, Now JoCo has problem with all IE versions grin
                      God loves me. 【ツ】


                      MODX.ir (Persian Support)

                      Boplo.ir/modx/ (Persian)
                      • 13428 ☆ A M B ☆
                      • 1,031 Posts
                      There is a small bug in line 198 in summary.php:
                      <a href="index.php?a=112&id=’.$JoCo->gv[’mKey’].’&WHERE=uparent=’.$uparent.’&reffer=1" title="’.$JoCo->lang[’see_this_comments’].’">