The following Club members have been granted skipper privileges:
-
- [insert_php]
-
- global $wpdb;
$skippers= $wpdb->get_results(“SELECT fields.NAME as name, levels.name as meta_value, FNAME.FIRST_NAME, LNAME.LAST_NAME from {$wpdb->prefix}cimy_uef_fields as fields
JOIN {$wpdb->prefix}cimy_uef_data as data on fields.ID = data.FIELD_ID
JOIN {$wpdb->prefix}users as users on data.user_id = users.id
LEFT OUTER JOIN (SELECT user_id, meta_value as LAST_NAME FROM {$wpdb->prefix}usermeta as usermeta where meta_key = ‘last_name’) AS LNAME on users.id = LNAME.user_id
LEFT OUTER JOIN (SELECT user_id, meta_value as FIRST_NAME FROM {$wpdb->prefix}usermeta as usermeta where meta_key = ‘first_name’) AS FNAME on users.id = FNAME.user_id
JOIN (SELECT DISTINCT pmpro.user_id, levels.name FROM {$wpdb->prefix}pmpro_memberships_users as pmpro
JOIN {$wpdb->prefix}pmpro_membership_levels as levels on pmpro.membership_id = levels.id) AS LEVELS on LEVELS.user_id = users.id
WHERE data.value = ‘YES’
AND fields.NAME = ‘SKIPPER’
order by levels.name, LNAME.LAST_NAME”);
foreach ($skippers as $row) {
echo ”
-
-
” . ucwords(strtolower($row->FIRST_NAME)) .” ” . ucwords(strtolower($row->LAST_NAME)) .”(“. $row->meta_value .”)
-
“;
}
[/insert_php]