function __construct($dbconn, $user) { parent::__construct($dbconn, $user); $this->user_id = $user; $this->db = $dbconn; $this->name = 'Google Addressbook'; $this->readonly = true; $this->groups = false; $this->undelete = false; $this->db_name = get_table_name('contacts_google'); }
/** * Reindex contacts */ public static function indexcontacts() { $db = self::db(); // iterate over all users $sql_result = $db->query("SELECT `user_id` FROM " . $db->table_name('users', true) . " ORDER BY `user_id`"); while ($sql_result && ($sql_arr = $db->fetch_assoc($sql_result))) { echo "Indexing contacts for user " . $sql_arr['user_id'] . "...\n"; $contacts = new rcube_contacts($db, $sql_arr['user_id']); $contacts->set_pagesize(9999); $result = $contacts->list_records(); while ($result->count && ($row = $result->next())) { unset($row['words']); $contacts->update($row['ID'], $row); } } echo "done.\n"; }
function __construct($dbconn, $user) { parent::__construct($dbconn, $user); $this->db_name = get_table_name('collected_contacts'); }