We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30223
    • 1,010 Posts
    Quite some time ago I gobbled together a module for editing records in custom database tables. Since there seems to be recurring interest in doing just that I’m sharing it with you all.

    What it doesn’t do: It does not create, delete or otherwise manage table structures.
    What it does.

    • Easily add & edit ’table configurations’. Simply select the table form a dropdown list and fill in some custom properties.
    • Allows adding, editing, deleting and importing of records (The implementation of importing is rather simple and a bit limited still)
    • Date entry uses javascript date selector
    • Image & file entry uses mcpuck file manager with image preview.
    • If your table is capable it will simulate a trash bin for deleted records, allowing the restore of unintentional deletes
    • Uses module permissions to (dis)allow some functions (eg importing, editing configuration etcetera)

    Edit: A rather important oversight... When installing the module you need to add this line into the module configuration (and adjust values as needed)
    &mod_path=Module path;string;assets/modules/dbedit/ &dbedit_date_format=Date Format (use d,D,m,M,F,n,y,Y as in php date() with simple separator);string;d F Y


    I’ve not had time to bring it to an official release so the code is a bit messy in places but I’m using it on virtually every site I’m building with hardly any hiccups. Documentation is rather sparse still as well but I’m sure you’ll figure it out pretty quickly.
    Use it, abuse it and let me know what you think.

    Edit 6 Feb 09: Changed php short open tags with full equivalent.
      • 3749
      • 24,544 Posts
      Sweet! grin
        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
        • 20413
        • 2,877 Posts
        Sweet is the word!! cool
          @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
          • 7231
          • 4,205 Posts
          cool indeed 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]
            • 20289
            • 958 Posts
            Thanks! :d
              [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
              [td][Wiki] [Persian support forum]
              [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
              [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
              • 4310
              • 2,310 Posts
              Few teething problems on a MAMP setup with my root folder being	/Applications/MAMP/htdocs/dev/
              Having to remove [b]$base_path[/b] from a few places.
              I can create the table etc. but the context menu won't appear when clicking the icon.
              If I try and save a new table with more than one field selected for listing I get a [quote]. Save Configuration
              Unable to save configuration. Reason is: [/quote]
              Also I had to add &mod_path=Path;text;../assets/modules/dbedit/
              in the module configuration field to get it up and running, can’t find that in the readme.txt!<br />Looks really promising, hope the feedback is not to negative  :)<br /><br />[b]EDIT[/b]<br />Removing the $base_path from index.php here (line 156) :<br />

                      include($basePath.$mod_path.'/header.inc.php');
              include('module.list.tables.inc.php');
              include($basePath.$mod_path.'/footer.inc.php');
              <br />has cured both the listing problem and context menu issue, looking good :)
                • 30223
                • 1,010 Posts
                No, not at all. Pointing out my stupid mistakes as well a genuine bugs are essential to improvement smiley

                I’ve added a line about the omitted configuration setting in my original post and as for the $base_path issue, that isn’t needed there anyway as nearly all files are served out of the same directory. Here’s a replacement index.php (just rename and drop in) which shoudl work just as well.
                  • 4310
                  • 2,310 Posts
                  Works a treat grin
                  Thanks for all the work on this and eForm.
                    • 4749
                    • 623 Posts
                    I get the "MODx is not currently installed or the configuration file cannot be found. Do you want to install now?" message. What did I do wrong? Pretty sure I installed as directed.

                    EDIT: "Doh. Forgot to add the updated files. All is well!"
                      The MODx has you...
                      Utah Web Design
                      • 33988
                      • 110 Posts
                      hey guys, when i try to install this on my website, upon running the module, i receive this error
                      "Parse error: syntax error, unexpected ’&’ in /home/guide/public_html/manager/processors/execute_module.processor.php(114) : eval()’d code on line 2"
                      I am hoping that someone knows how to fix it since this tool sounds great to have.
                      Thanks
                        Sal Sodano
                        President & Co-Founder of SkyToaster
                        My Website Salscode.