You are here

function invite_stats_display_top_inviters in Invite 5.2

Same name and namespace in other branches
  1. 5 invite_stats.module \invite_stats_display_top_inviters()
  2. 6.2 invite_stats.module \invite_stats_display_top_inviters()
  3. 7.2 modules/invite_stats/invite_stats.module \invite_stats_display_top_inviters()

Render the "Top inviters" block.

1 call to invite_stats_display_top_inviters()
invite_stats_block in ./invite_stats.module
Implementation of hook_block().

File

./invite_stats.module, line 103
Displays some statistics about sent invitations.

Code

function invite_stats_display_top_inviters() {
  $inviters = array();
  $result = db_query_range("SELECT uid, COUNT(uid) AS count FROM {invite} WHERE joined <> 0 GROUP BY uid ORDER BY count DESC", 0, variable_get('invite_num_ranks', 5));
  while ($row = db_fetch_object($result)) {
    $inviters[] = $row;
  }
  return theme('invite_stats_ranking', $inviters);
}