I'm doing a workaround to filter results using Cimy User Extra fields (I'm not able to do queries and so). So I created a dropdown form and I'm using the selected fields/values to filter the users to be shown.
Here is the function of the Wordpress Users plugin used to display de users "list"
function get_user_listing($curauth) {
global $post;
$concat = wpu_concat_single();
$homeuni=get_cimyFieldValue($curauth->ID,'homeuni');
$selectedhomeuni = $_GET['homeunis']; // Key that gets one dropdown value
$selectedhostuni = $_GET['hostunis']; // Key that gets the other dropdown value
if($selectedhomeuni == "all" && $selectedhostuni == "all") {
// Here goes the bunch of repeated code
}
elseif($selectedhomeuni != "all" && $selectedhostuni == "all") {
// Here goes the bunch of repeated code again
}
elseif($selectedhomeuni == "all" && $selectedhostuni != "all") {
// Here goes the bunch of repeated code again
}
elseif($selectedhomeuni != "all" && $selectedhostuni != "all") {
// Here goes the bunch of repeated code again
}
return $html;
}
And here (Pastebin) is the long code to be repeated. with ", ', \" and $.
I've tried functions, keys and include to call that code, but none of them worked properly. I'm not even sure it can be done this "easy" as I'm trying. I'm no expert at all.
Thank you very much.