:) この質問は、Tankauth プラグインに詳しい人向けです。
ユーザープロファイルが電子メール検証なしで入力されるように、tankauth を編集しました。
登録フォームに、「first_name」と「last_name」という名前の 2 つのフィールドを追加して検証しました。フォームが送信されたときに、これらのフィールドを user_profiles テーブルに追加します。
以下は、ユーザーがアクティブ化されている場合にユーザー ID を user_profiles テーブルに追加する tankauth 関数です。if ($activated) をコメントアウトしました。問題は、新しいフィールド first_name と last_name をデータベースに挿入する方法がわからないことです。何をしようとしてもエラーが発生し続けます。
function create_user($data, $activated = TRUE)
{
$data['created'] = date('Y-m-d H:i:s');
$data['activated'] = $activated ? 1 : 0;
if ($this->db->insert($this->table_name, $data)) {
$user_id = $this->db->insert_id();
//if ($activated)
$this->create_profile($user_id);
return array(
'user_id' => $user_id,
'first_name' => $first_name, //added by me
'first_name' => $first_name, //added by me
);
}
return NULL;
}
上記は接続されています
private function create_profile($user_id)
{
$this->db->set('user_id', $user_id);
$this->db->set('first_name', $first_name); //added by me
return $this->db->insert($this->profile_table_name);
}
誰かがいくつかのガイダンスを共有できますか?