We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17851
    • 213 Posts
    trying to setup a basic event registration page. so essentially, user will "sign up" by entering their email, contact info, and the data is written to a table so that MODx admin can go in and export a list of people who’ve signed up. i looked into using eForm, but it doesn’t store data, just emails it so i wouldn’t be able to get a list of signups. i also looked into webloginpe, but i don’t want to track "web user" registration b/c it’s not necessary for the person to be recognized next time they sign up for an event.

    has anyone done event registration before? i thought there was a snippet or plugin that would do it but i couldn’t find one. if not, any suggestions on how i might do this without using a 3rd party like constant contact?

    thanks.
      Mark Macatee
      President
      Power 10 Solutions
      http://www.power10solutions.com
      • 5340
      • 1,624 Posts
      I use eForm with the eForm2Db snippet

      For example this is my eForm call:

      [[eForm2db]][!eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eFeedBackFormEn` &report=`eFeedbackReportEn` &thankyou=`eFeedBackThanksEn` &subject=`Registration`  &debug=`0` &eFormOnBeforeMailSent=`eForm2db`!
      ]

      This is my eForm2Db snippet

      <?php
      function eForm2db( &$fields )
      	{
      		global $modx;
      
      		//$table_name = $modx->getFullTableName('participants');
      
      		
      		// Init our array
      		$dbTable = array();
      
      
      		// Insert field/value pairs to insert/update in our table
      		$dbTable['firstname'] = $fields['firstname'];
      		
      		$dbTable['secondname'] = $fields['secondname'];
      		$dbTable['email'] = $fields['email'];
      		$dbTable['birth'] = $fields['birth'];
      		$dbTable['address'] = $fields['address'];
      		$dbTable['city'] = $fields['city'];
      		$dbTable['district'] = $fields['district'];
      		$dbTable['club'] = $fields['club'];
      		$dbTable['category'] = $fields['category'];
      		$dbTable['comments'] = $fields['comments'];
      		$dbTable['date'] = date("F j, Y, g:i a");
      		
      		$dbQuery = $modx->db->insert( $dbTable, 'participants' );		
      
      		return true;
      	}
      	return '';
      ?>


      When the registration is closed you can export the table using a tool like PhpMyAdmin.
        • 12147
        • 182 Posts
        Cipa,

        This is wonderful, and something I can really use, so I created new snippet, and dropped your call on the page, and get this error msg:
        "Fatal error: Cannot redeclare eform2db() (previously declared in..." /...etc etc..../

        Do you have an idea where this comes from, what I can do about it?

        Thanks smiley
          • 5340
          • 1,624 Posts
          I have no idea what the problem is. It is possible that you call eFormDb twice on the same page.

          If you give me a day or 2 I’ll make a short tutorial on my modx blog.
            • 12147
            • 182 Posts
            That sounds terrific! I will try to figure this out, meanwhile, but your tutorial will be great. Thank you for doing that!
            grin
              • 17851
              • 213 Posts
              Did this used to be listed on the MODx site as an extra? I think I saw this snippet name a year ago or more, but I haven’t been able to find it since the new MODx site went live.
                Mark Macatee
                President
                Power 10 Solutions
                http://www.power10solutions.com
                • 5340
                • 1,624 Posts
                Until then try to get familiar with eForm. See the documentation folder inside the eForm snippet
                  • 12147
                  • 182 Posts
                  Yes, I am doing so - have it installed for a Contact form, and overwhelmed by the possibilities wink
                    • 5340
                    • 1,624 Posts
                    As promised, here is the tutorial.

                      • 20413
                      • 2,877 Posts
                      THANK YOU! cool

                      Are you going to make a tutorial of your custom web-user registration? wink
                        @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