You are here

function invite_stats_block_view in Invite 7.2

Implements hook_block_view().

File

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

Code

function invite_stats_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'top_inviters':
      if (user_access('view invite statistics')) {
        if (arg(0) == 'user' && is_numeric(arg(1)) && ($account = user_load(arg(1)))) {
          $block = array(
            'subject' => t("@user's invite rank", array(
              '@user' => $account->name,
            )),
            'content' => invite_stats_display_user_rank($account->uid),
          );
        }
        else {
          $block = array(
            'subject' => t('Top inviters'),
            'content' => invite_stats_display_top_inviters(),
          );
        }
      }
      break;
  }
  return $block;
}