• 37

    (@mikegandy)


    I love this plugin! Absolutely love it! Two questions. I installed the e-Newsletter plugin from WPMU, and wanted to incorporate it with people in my participants database. I know that I can set my newsletter plugin to automatically add new site users to my newsletter, so I’m wondering if there’s a way to set my participants database new registrations to automatically become users of my site? Any suggestions?

    Also I would like to create more than one database. I have it currently set for volunteers, and now I want a second one for our partnered organizations. I haven’t figured out a way to install the plugin twice. Lol.

    https://www.ads-software.com/plugins/participants-database/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Yeah, the plugin only does one database. You can dual-purpose the database by generating two different forms with a different set of fields.

    Thread Starter 37

    (@mikegandy)

    Thank you. As for adding users as site users, do you have any suggestions? I was thinking maybe adding a hidden input tag or something to my current form? Here is the form I’m using:

    <script language="Javascript" type="text/javascript">
        var fieldstocheck = new Array();
        fieldnames = new Array();
        function checkform() {
        for (i=0;i<fieldstocheck.length;i++) {
        if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
        alert("Please enter your "+fieldnames[i]);
        eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
        return false;
        }
        }
        return true;
        }
        function addFieldToCheck(value,name) {
        fieldstocheck[fieldstocheck.length] = value;
        fieldnames[fieldnames.length] = name;
        }
        </script>
    
        <form enctype="multipart/form-data" method="post"><input type="hidden" value="signup" name="action"></input><input type="hidden" value="participants-database" name="subsource"></input><input type="hidden" value="?page_id=70" name="shortcode_page"></input><input type="hidden" value="https://nmvolunteer.org/?page_id=78" name="thanks_page"></input>
        <input size="10" id="volformleft" type="text" name="first_name" value="first name" onfocus="if (this.value=='first name') this.value='';" onblur="if(this.value == ''){this.value='first name';}"><script language="Javascript" type="text/javascript">addFieldToCheck("first_name","first name");</script><input size="10" id="volform" type="text" name="last_name" value="last name" onfocus="if (this.value=='last name') this.value='';" onblur="if(this.value == ''){this.value='last name';}"><script language="Javascript" type="text/javascript">addFieldToCheck("last_name","last name");</script><input size="23" id="volform" type="text" name="email" value="email" onfocus="if (this.value=='email') this.value='';" onblur="if(this.value == ''){this.value='email';}"><script language="Javascript" type="text/javascript">addFieldToCheck("email","email address");</script><input size="12" id="volform" type="text" name="phone" value="phone" onfocus="if (this.value=='phone') this.value='';" onblur="if(this.value == ''){this.value='phone';}"><script language="Javascript" type="text/javascript">addFieldToCheck("phone","phone number");</script><input size="12" id="volformright" type="text" name="city" value="city" onfocus="if (this.value=='city') this.value='';" onblur="if(this.value == ''){this.value='city';}"><script language="Javascript" type="text/javascript">addFieldToCheck("city","city");</script> <input type="hidden" name="submit" value="VOLUNTEER" />
        <input id="volformsubmit" type="submit" name="submit" value="VOLUNTEER" onClick="return checkform();">
        </form>
    Plugin Author xnau webdesign

    (@xnau)

    You can use javascript to register the user when they submit their form. You’ll need to set up an AJAX callback, then that callback takes the needed user data and registers the user. On your form page, the AJAX interrupts the submission so it can grab it’s data and perform the callback, then the submission is allowed to go on as usual, which registers the user with the plugin database. All pretty simple using jQuery.

    Thread Starter 37

    (@mikegandy)

    Hey, I really appreciate your help and timely response! Though, I’m not very familiar with jQuery and all that. Do you have any resources you can point me to to help guide me through the process?

    Plugin Author xnau webdesign

    (@xnau)

    Well,

    OK, well it’s perhaps a little steep for an initial foray into AJAX, but this page I have found invaluable in getting the basics going:

    https://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/

    and then a very clear code example:

    https://gist.github.com/Jackreichert/5233481

    On the PHP side of things, your function needs to grab the values from the submission and use them to register the user using wp_insert_user()

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Automatically Add as Site Users and 2 Databases?’ is closed to new replies.