You are here

function dlike_user_list in Drupal like (Flag counter) 7

Same name and namespace in other branches
  1. 7.3 dlike.inc \dlike_user_list()
  2. 7.2 dlike.inc \dlike_user_list()

Get list of names of all the users who flagged particular content.

1 string reference to 'dlike_user_list'
dlike_menu in ./dlike.module
Implementation of hook_menu().

File

./dlike.inc, line 21
This files contains all the include functions.

Code

function dlike_user_list($flag_type, $content_id, $flag_name) {
  $output = '';
  $i = 0;
  $flaggers = array();
  $flaggers = dlike_get_users($flag_type, $content_id, $flag_name);
  $output .= "<div class='dlike'>";
  $output .= '<h2>' . variable_get('dlike-modal-window-title-' . $flag_name, NULL) . '</h2>';
  if (count($flaggers) > 0) {
    while (isset($flaggers[$i])) {
      $user = user_load($flaggers[$i]);
      $user_view = user_view($user, 'full');
      $output .= '<div class="dlike-user-row">' . render($user_view) . '</div>';
      $i++;
    }
  }
  $output .= "</div>";
  print $output;
}