• Great plugin!

    1. I am trying to populate a hidden field with the date that a member joined my site. This is in the phpBB3 database as “user_regdate”. I have successfully added their usernames and email addresses by having the default entry in the Participants Database fields as “current_user->user_login” and “current_user->user_email”. But if I mimic this with “current_user->user_regdate” it remains empty. Any thoughts on what I am doing wrong?

    2. As a second part, I want the email that admin gets on each sign up to show this original registration date. Unfortunately this number is in Linux form, meaning that it’s something like the number of seconds or minutes since 1 Jan 1970. Not very helpful! Assuming I can get the [member_since] in Part 1 above sorted, is there any way of doing a simple calculation inside your “Signup Notification Email”? It would just be a little bit of division and rounding, nothing mathematically too complex!

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Roland Barker

    (@xnau)

    The dynamic hidden fields can only access certain global values, it doesn’t have access to your other database, but you can do this in a custom template.

    For this you’ll need to be familiar with php so you can set up a custom template for your signup form. Also, you’ll need to know how to get that value from the other database…I can’t help you with that.

    First, check out this article on setting up a custom template:

    Using Participants Database Custom Templates

    In your template, before the first line of code, you can set the value of your hidden field…first, get the value from your other database, then use it to assign the value of your hidden field.

    Now, to convert the unix timestamp is very easy, php does this for you using the date() function…so you can add that to your code above so the date is stored in a readable format…something like this:

    <?php
    $date_value; // you're getting this from your other database
    $date_format = get_option('date_format') // this is the WP global date format setting
    $this->hidden_fields['member_since'] = date( $date_format, $date_value );
    ?>

    That will populate the hidden field with your membership date.

Viewing 1 replies (of 1 total)

The topic ‘Populating a hidden field from database etc.’ is closed to new replies.