We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39053
    • 34 Posts
    Hello!
    I've created a custom table with custom fields. If I delete a WebUser in WebloginPE, then it will delete only the line in the WebUser table. The custom table remains the line. How can I delete the corresponding row in the custom table automatically?
      • 4041
      • 788 Posts
      You should be able to create a new plugin that fires on the "OnWebDeleteUser" event.

      You'll have access to the following variables in your plugin:
      $internalKey == users id
      $username == users username
      $timestamp


      plugin code:

      $table ='YOUR_TABLE_NAME';
      $delete = $modx->db->delete($tablename, 'username="'.$username.'"');
      


      modify the WHERE section above ('username="username"') to fit your custom table.
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 39053
        • 34 Posts
        Thank you!
        i have found another thread:
        http://www.modxcms.de/forum/comments.php?DiscussionID=860
        I will test both!
          • 33238
          • 388 Posts
          Hello, witch one works? i have the same problem?
          Thank you!
            --
            ysanmiguel.com