This question has been answered by BobRay. See the first response.
Have you looked at the Peoples package? I think that would be better for what you're trying to do.
RowBoat is mainly for non-MODX tables and it doesn't handle extended fields.
<?php
/* ShowUsers snippet */
$output = '';
/* get all User Profiles */
$profiles = $modx->getCollection('modUserProfile');
foreach ($profiles as $profile) {
$extended = $profile->get('extended');
if ($extended['directoryinclude'] == 'Yes') {
/* found one -- add to output */
$fields = $profile->toArray();
$output .= $modx->getChunk('MembershipDirectory', $fields);
}
}
return $output;$fields = array_merge($fields, $extended);
There's no easy way that I know of to create a query that will select by extended fields. What I usually do in cases like yours is re-purpose an unused field of the User Profile like 'comment' or 'fax'. That method has less of an advantage for you because you don't really need the User object, just the User Profile.
I think you want something like this (untested):
<!--?php /* ShowUsers snippet */ $output = ''; /* get all User Profiles */ $profiles = $modx--->getCollection('modUserProfile'); foreach ($profile as $profile) { $extended = $profile->get('extended'); if ($extended['directoryinclude'] == 'Yes') { /* found one -- add to output */ $fields = $profile->toArray(); $output .= $modx->getChunk('MembershipDirectory', $fields); } } return $output;

Should be the other way around -- change just the one in the foreach(). I corrected it in my post above.
Glad it works for you.