function multiple_email_load in Multiple E-mail Addresses 6
Same name and namespace in other branches
- 7 multiple_email.module \multiple_email_load()
- 2.x multiple_email.module \multiple_email_load()
Loads a single address from the e-mail registry and returns it as an object.
Parameters
integer $eid:
integer $reset:
Return value
object
8 calls to multiple_email_load()
- multiple_email_confirm_email in ./
multiple_email.module - Marks an e-mail address as confirmed in the e-mail registry
- multiple_email_delete_email in ./
multiple_email.module - Deletes specified e-mail from registry - no error checking!
- multiple_email_edit_form_submit in ./
multiple_email_edit_page.inc - Processes form submission of multiple_email_edit_form
- multiple_email_expire_address in ./
multiple_email.module - Removes the specified address from the user who added it and sends their primary e-mail account a message notifying them about the expiration.
- multiple_email_find_address in ./
multiple_email.module - Finds the specified e-mail and returns an object containing its data. Returns false if e-mail cannot be found.
File
- ./
multiple_email.module, line 428 - multiple_email module file
Code
function multiple_email_load($eid, $reset = FALSE) {
static $emails = array();
if (!empty($reset)) {
$emails = array();
}
if (!empty($eid) && empty($emails[$eid])) {
$emails[$eid] = db_fetch_object(db_query("\n SELECT\n a.eid,\n a.uid,\n a.email,\n a.time_registered,\n a.time_registered,\n a.confirmed,\n a.confirm_code,\n a.time_code_generated,\n a.attempts,\n IF(LOWER(a.email) = LOWER(u.mail), 1, 0) AS primary_address\n FROM\n {multiple_email} a\n INNER JOIN {users} u ON (u.uid = a.uid)\n WHERE\n a.eid = %d", $eid));
}
return !empty($eid) && !empty($emails[$eid]) ? $emails[$eid] : FALSE;
}