User Details Report

Current User Stats

get_var( “SELECT count(user_id) from wp_usermeta where meta_value like ‘%subscriber%’ or meta_value like ‘%s2member%’ ” );
$user_count = $user_count;
echo “

Total Members: {$user_count}   details

“;

$user_count = $wpdb->get_var( “SELECT count(user_id) from wp_usermeta where meta_value like ‘%subscriber%'” );
echo “

Standard Members: {$user_count}   details

“;

$user_count = $wpdb->get_var( “SELECT count(user_id) from wp_usermeta where meta_value like ‘%s2member_level1%'” );
echo “

CYP Membership users: {$user_count}   details

“;

$user_count = $wpdb->get_var( “SELECT count(user_id) from wp_usermeta where meta_value like ‘%access_s2member_ccap_frisbee%'” );
echo “

Frisbee users: {$user_count}   details

“;

$user_count = $wpdb->get_var( “SELECT count(user_id) from wp_usermeta where meta_value like ‘%s2member_level2%'” );
echo “

Staff users: {$user_count}   details

“;

?>


Current Users

get_results( “SELECT * from wp_users” );

if($_GET[‘filter’]==”1″)
{
$myrows = $wpdb->get_results( “SELECT * from wp_users INNER JOIN wp_usermeta ON wp_users.id=wp_usermeta.user_id where wp_usermeta.meta_value like ‘%s2member_level1%'” );
}
if($_GET[‘filter’]==”2″)
{
$myrows = $wpdb->get_results( “SELECT * from wp_users INNER JOIN wp_usermeta ON wp_users.id=wp_usermeta.user_id where wp_usermeta.meta_value like ‘%s2member_level2%'” );
}
if($_GET[‘filter’]==”3″)
{
$myrows = $wpdb->get_results( “SELECT * from wp_users INNER JOIN wp_usermeta ON wp_users.id=wp_usermeta.user_id where wp_usermeta.meta_value like ‘%access_s2member_ccap_frisbee%'” );
}

$s2 = array(“a:1:{“,”a:10:{“,”a:13:{“,”;s:0:”,”;s:1:”,”;s:2:”,”;s:3:”,”;s:4:”,”;s:5:”,”s:6:”,”;s:7:”,”;s:8:”,”;s:9:”,”;s:10:”,”;s:11:”,”;s:12:”,”;s:13:”,”;s:14:”,”;s:15:”,”;s:16:”,”;s:17:”,”;s:18:”,”;s:19:”,”;s:20:”,”;s:21:”,”s:22:”,”;s:30:”,”;s:35:”,”;s:32:”);

foreach ($myrows as $row) {

echo “

“.$row->display_name.”

“;
echo “joined on:”.$row->user_registered;
echo “
user_email.”‘>”.$row->user_email.”“;

$sql = “SELECT meta_value from wp_usermeta where user_id='”.$row->user_id.”‘ and meta_key=’wp_s2member_custom_fields'” ;
$myrows2 = $wpdb->get_results( $sql );

foreach ($myrows2 as $row2) {
$prin = str_replace( $s2, “
“, $row2->meta_value );
//echo $prin;
}

echo “

“;
}

/*
echo ‘

‘ . “\n”;
echo ‘

‘ . “\n”;
echo ‘

‘ . “\n”;
echo ‘

‘;
echo ‘‘ . “\n”;
echo ‘
‘ . “\n”;
echo ‘You can export up to 1000 database rows in each file; starting from a particular row that you specify.
‘ . “\n”;
echo ‘Export, starting with row#: ‘ . “\n”;
echo ‘

‘ . “\n”;
echo ‘Please note. Export files do NOT contain Passwords. Passwords are stored by WordPress® with one-way encryption. ‘ . “\n”;
echo ‘

‘;
*/

?>

Email this to someoneShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn