PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Adding custom member profile fields to signup moderation

s2Member Plugin. A Membership plugin for WordPress®.

Adding custom member profile fields to signup moderation

Postby mctwisty » February 23rd, 2011, 3:34 pm

Hi,

Would like to know what I add to the code to add some custom signup fields into signiup moderation plugin v. 0.1.

Example: user's that signup have city, state and zip. How would i include that in this table with the php code below?

<table class="widefat">
<tbody>
<tr class="thead">
<th><?php _e('ID','wp-user-moderation') ?></th>
<th><?php _e('Username','wp-user-moderation') ?></th>
<th><?php _e('First Name','wp-user-moderation') ?></th>
<th><?php _e('Last Name','wp-user-moderation') ?></th>
<th><?php _e('E-mail','wp-user-moderation') ?></th>
<th colspan="2" style="text-align: center"><?php _e('Actions','wp-user-moderation') ?></th>
</tr>
</tbody>
<tbody>
<?php foreach($users as $user_object) : ?>
<tr class="alternate">
<td><?php echo $user_object->ID; ?></td>
<td><?php echo $user_object->user_login; ?></td>
<td><?php echo get_usermeta($user_object->ID,'first_name'); ?></td>
<td><?php echo get_usermeta($user_object->ID,'last_name'); ?></td>
<td><?php echo $user_object->user_email; ?></td>
<td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=discard" class="edit"><?php _e('Discard','wp-user-moderation') ?></a></td>
<td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=approve" class="edit"><?php _e('Approve','wp-user-moderation') ?></a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
User avatar
mctwisty
Registered User
Registered User
 
Posts: 9
Joined: February 23, 2011

Re: Adding custom member profile fields to signup moderation

Postby Cristián Lávaque » February 23rd, 2011, 10:08 pm

I'm not sure about that code, but I thought I'd ask if you already checked out the Custom Registration Fields with s2Member.

WP Admin -> s2Member -> General Options -> Custom Registration Fields
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Adding custom member profile fields to signup moderation

Postby mctwisty » February 26th, 2011, 1:35 am

I tried the code - see below:

Code: Select all

<div class="wrap">
      <h2><?php _e('Registration Requests Pending Approval','wp-user-moderation'); ?></h2>

      <?php if(!$users = $this->getPendingUsers()) : ?>
         <div class="error">
            <ul>
               <li><?php _e('No Pending Requests at this time for Approval...','wp-user-moderation'); ?></li>
            </ul>
         </div>
      <?php else : ?>
         <table class="widefat">
             <tbody>
               <tr class="thead">
                  <th><?php _e('ID','wp-user-moderation') ?></th>
                  <th><?php _e('Username','wp-user-moderation') ?></th>
   <th>City</th>
                  <th><?php _e('First Name','wp-user-moderation') ?></th>
                  <th><?php _e('Last Name','wp-user-moderation') ?></th>
                  <th><?php _e('E-mail','wp-user-moderation') ?></th>
                  <th colspan="2" style="text-align: center"><?php _e('Actions','wp-user-moderation') ?></th>
               </tr>
             </tbody>
             <tbody>
             <?php foreach($users as $user_object) : ?>
                <tr class="alternate">
                   <td><?php echo $user_object->ID; ?></td>
                  <td><?php echo $user_object->user_login; ?></td>
        <td><?php echo get_user_field("city"); ?></td>
                  <td><?php echo get_usermeta($user_object->ID,'first_name'); ?></td>
                  <td><?php echo get_usermeta($user_object->ID,'last_name'); ?></td>
                  <td><?php echo $user_object->user_email; ?></td>

                  <td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=discard" class="edit"><?php _e('Discard','wp-user-moderation') ?></a></td>
                  <td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=approve" class="edit"><?php _e('Approve','wp-user-moderation') ?></a></td>
               </tr>
            <?php endforeach; ?>
             </tbody>
         </table>
      <?php endif; ?>
   </div>





What i added:

Code: Select all
<th>City</th>

<td><?php echo get_user_field("city"); ?></td>





It doesn't pull any data from the database. I am really green, so I know its probably elementary, but I must be missing some statement to get it from a different table than what this plugin is pulling data from? Sorry if I sound really unclear.

Thanks!
User avatar
mctwisty
Registered User
Registered User
 
Posts: 9
Joined: February 23, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 10 guests

cron