Title: [Plugin: Cimy User Extra Fields] User List loop
Last modified: August 19, 2016

---

# [Plugin: Cimy User Extra Fields] User List loop

 *  [jlmno](https://wordpress.org/support/users/jlmno/)
 * (@jlmno)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/)
 * I would really appreciate some help in getting Cimy User Extra Fields to show
   up in the user list through the Alkivia Open Community plugin.
 * I’ve read through the Read Me but I’m not very proficient in PHP. I tried adding
   the Cimy code from example 5 to the Alkivia userlist.php file and it’s not working
   quite right.
    **Cimy**
 *     ```
       $values = get_cimyFieldValue(false, false);
       	$old_name = "";
   
       	foreach ($values as $value) {
       		$user_id = $value['user_id'];
       		$new_name = $value['user_login'];
   
       		if ($old_name != $new_name)
       			echo "<br /><br />".$new_name."<br /><br />";
   
       		echo $value['LABEL'].": ";
       		echo cimy_uef_sanitize_content($value['VALUE'])."<br />";
   
       		$old_name = $new_name;
       	}
       ```
   
 * **Alkivia**
 *     ```
       <?php foreach ( $users as $user ) : ?>
       	<h1 class="user-name"><?php echo $user['display_name']; ?></h1>
       	<div class="short-profile">
       		<?php
           	/* Sample to get the thumbnail instead the avatar.
               	if ( ak_get_object('akucom')->activeComponent('gallery') ) {
           	    	echo aoc_get_user_image($user['ID'], 'alignleft', true);  // Get thumnail.
       	        }
           	*/
               ?>
       		<div class="image"><a href="<?php echo $baselink . urlencode($user['user_login']); ?>"><?php echo get_avatar($user['ID'], $avatar_size) ?></a></div>
       	<p><?php echo $roles[ak_get_user_role($user['ID'])];
           if ( empty($user['user_url']) || 'http://' == $user['user_url'] ) {
               echo '</p>';
           } else { ?>
               <br /><?php _e('My site:', $i18n); ?>
       	    <a href="<?php echo $user['user_url']; ?>" target="_blank"><?php echo substr($user['user_url'], 7); ?></a></p>
       	<?php }
       	$userData = get_userdata($user['ID']);
           if ( ! empty($userData->description) ) {
               echo wpautop('<p class="title">' . __('About Me', $i18n) . '</p>' . $userData->description);
           }
       	?>
       ```
   
 * it’s repeating all of the users’ Cimy extra fields on every user. so for example
   with 5 total users, user 1 has all 5 users extra fields, user 2 has all 5 users
   extra fields, etc.
 * It’s the foreach function that’s doing it right?…but everything I’ve tried won’t
   just show the single user’s info.
 * Any help is appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Marco Cimmino](https://wordpress.org/support/users/cimmo/)
 * (@cimmo)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/#post-1407634)
 * have you tried putting inside the foreach:
 *     ```
       $values = get_cimyFieldValue($user->ID, false);
   
       	foreach ($values as $value) {
       		echo $value['LABEL'].": ";
       		echo cimy_uef_sanitize_content($value['VALUE'])."<br />";
       	}
       ```
   
 *  Thread Starter [jlmno](https://wordpress.org/support/users/jlmno/)
 * (@jlmno)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/#post-1407649)
 * here is what I have in the whole file. I get an error on line 68, which is the
   line with the second foreach.
 *     ```
       $roles = ak_get_roles(true);                                                // Available roles (translated)
       $dt_format = get_option('date_format') . ' | ' . get_option('time_format');  // Date-Time format
   
       ?>
       <div id="mini-profiles">
       <?php foreach ( $users as $user ) : ?>
       	<h1 class="user-name"><?php echo $user['display_name']; ?></h1>
       	<div class="short-profile">
       		<?php
           	/* Sample to get the thumbnail instead the avatar.
               	if ( ak_get_object('akucom')->activeComponent('gallery') ) {
           	    	echo aoc_get_user_image($user['ID'], 'alignleft', true);  // Get thumnail.
       	        }
           	*/
               ?>
       		<div class="image"><a href="<?php echo $baselink . urlencode($user['user_login']); ?>"><?php echo get_avatar($user['ID'], $avatar_size) ?></a></div>
       	<p><?php echo $roles[ak_get_user_role($user['ID'])];
           if ( empty($user['user_url']) || 'http://' == $user['user_url'] ) {
               echo '</p>';
           } else { ?>
               <br /><?php _e('My site:', $i18n); ?>
       	    <a href="<?php echo $user['user_url']; ?>" target="_blank"><?php echo substr($user['user_url'], 7); ?></a></p>
       	<?php }
       	$userData = get_userdata($user['ID']);
           if ( ! empty($userData->description) ) {
               echo wpautop('<p class="title">' . __('About Me', $i18n) . '</p>' . $userData->description);
           }
       	?>
       <?php
       	$values = get_cimyFieldValue($user->ID, false);
   
       	foreach ($values as $value) {
       		echo $value['LABEL'].": ";
       		echo cimy_uef_sanitize_content($value['VALUE'])."<br />";
       	}
       	?>
   
       	</div>
       <?php endforeach; ?>
       </div>
       <?php echo $pager; ?>
       ```
   
 * thanks for your response!
 *  [Marco Cimmino](https://wordpress.org/support/users/cimmo/)
 * (@cimmo)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/#post-1407662)
 * Right, use this:
 *     ```
       $values = get_cimyFieldValue($user['ID'], false);
   
       if (!empty($values)) {
       	foreach ($values as $value) {
       		echo $value['LABEL'].": ";
       		echo cimy_uef_sanitize_content($value['VALUE'])."<br />";
       	}
       }
       ```
   
 *  Thread Starter [jlmno](https://wordpress.org/support/users/jlmno/)
 * (@jlmno)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/#post-1407664)
 * Awesome thank you very much! Now onto the Alkivia profile page…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Cimy User Extra Fields] User List loop’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [jlmno](https://wordpress.org/support/users/jlmno/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-cimy-user-extra-fields-user-list-loop/#post-1407664)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
