• Hi Larry,

    Great plugin! I am using it and very nice work. Though, I just noticed some better tweaks on the codes for the item_count variable:

    $query = "SELECT count(*) FROM <code>&quot;.$wpdb->prefix.&quot;users</code> u LEFT JOIN <code>&quot;.$wpdb->prefix.&quot;usermeta</code> um ON u.ID=um.user_id ";
    $query .= "WHERE um.meta_key = '".$wpdb->prefix."capabilities' AND (";
    foreach ($this->options['display_roles'] as $key => $value) {
    	if ($value) $query .= " um.meta_value LIKE '%".$key."%' OR";
    	}
    $query = substr($query, 0, strlen($query) - 3).") ";
    $count = $wpdb->get_var($query);
    $item_count = $count.' vendor';
    if ($count !=1) $item_count .= 's';

    Hope this helps.:) and thank you very much for this plugin.

    https://www.ads-software.com/plugins/dmc-user-list/

  • The topic ‘BETTER CODE for $item_count’ is closed to new replies.