You are here

function _fb_register_summary in Drupal for Facebook 6.2

TODO: This should probably be a theme function.

2 calls to _fb_register_summary()
fb_register_all_users in contrib/fb_register.module
This callback will register a chunk of users, then redirect to itself to register another chunk. And so on, to quickly register all users of a site, rather than waiting for cron jobs to take care of it all.
fb_register_now_form in contrib/fb_register.module

File

contrib/fb_register.module, line 88
This code aims to prevent duplicate accounts.

Code

function _fb_register_summary($fb_app) {

  // Display a summary.
  $cache = cache_get('fb_register_cache');
  if (!$cache) {
    $cache = new stdClass();
    $cache->data = array(
      $fb_app->apikey => 0,
    );
  }
  $last_uid_registered = $cache->data[$fb_app->apikey];
  $registered = db_result(db_query("SELECT count(uid) as count FROM {fb_register} WHERE uid <= %d", $last_uid_registered));
  $local = db_result(db_query("SELECT count(u.uid) FROM {users} u WHERE uid > 0"));
  $registerable = db_result(db_query("SELECT count(u.uid) FROm {users} u WHERE u.uid > 0 ANd u.mail IS NOT NULL AND u.mail <> ''"));
  $summary = t("%registered of %registerable accounts have been registered for !app. <br/>(Of %local total users, %registerable have email addresses.)", array(
    '%registered' => $registered,
    '%registerable' => $registerable,
    '%local' => $local,
    '!app' => $fb_app->label,
  ));
  return $summary;
}