Forum Replies Created
-
AuthorPosts
-
solMember
Thanks a lot, that solved it. I just added another condition, so the code looks like this now:
<?php
global $wpdb;
$order = ‘company_name’;
$members_table_name = $wpdb->prefix . “wp_eMember_members_tbl”;
$resultsets = $wpdb->get_results(“SELECT * FROM $members_table_name ORDER BY $order”, OBJECT);
foreach ($resultsets as $member):
?>
<?php if($member->membership_level == 2 and $member->account_state == active) { ?>
<tr>
<td align=”left”><?php echo $member->last_name; ?></td>
<td align=”left”><?php echo $member->first_name; ?></td>
<td align=”left”><?php echo $member->company_name; ?></td>
<td align=”left”><?php echo $member->country; ?></td>
</tr>
<?php
}
endforeach; //
?>
solMemberI need to display a member list of only the members which are approved. I realize that both with the shortcode and with my php code – see https://support.tipsandtricks-hq.com/forums/topic/pulling-member-info/page/2 – it displays also unconfirmed members, even applicants who have not even confirmed their email address. As this opens the door to spammers and makes the organisation look little credible, I would like to list only confirmed members.
Any idea on how I could do that?
solMemberCompletely overlooked your answer. I am, but it was not offering the right options.
But still in general, it would be nice to be able to add more fields. Mobile number and Phone, …
solMemberHi,
just to say that this post was great to figure out what I needed. Here is how I used and adapted it – watch out that you change the membership level to be displayed if you want to have a different one then 2. If you put it into a page, you also need to have a wordpress php plugin like php exec installed.
<div align=”center”>
<div>
<table>
<thead>
<tr>
<td align=”center”>
<div>Surname</div></td>
<td align=”center”>
<div>First name</div></td>
<td align=”center”>
<div>Company</div></td>
<td align=”center”>
<div>Country</div></td>
</tr>
</thead>
<tbody>
<?php
global $wpdb;
$order = ‘company_name’;
$members_table_name = $wpdb->prefix . “wp_eMember_members_tbl”;
$resultsets = $wpdb->get_results(“SELECT * FROM $members_table_name ORDER BY $order”, OBJECT);
foreach ($resultsets as $member):
?>
<?php if($member->membership_level == 2) { ?>
<tr>
<td align=”left”><?php echo $member->last_name; ?></td>
<td align=”left”><?php echo $member->first_name; ?></td>
<td align=”left”><?php echo $member->company_name; ?></td>
<td align=”left”><?php echo $member->country; ?></td>
</tr>
<?php
}
endforeach; //
?>
</tbody>
</table>
</div>
</div>
-
AuthorPosts