The Active Profile

Applies to: Jamroom 7.0+ Last verified: 2026-10-24
  • Users with several profiles

    A user can have several profiles (a power user, or a member of a band), and a profile can have several users. So when a user creates an item, Jamroom needs to know which profile it belongs to.

    That's the active profile: $_user['user_active_profile_id']. When a user views a profile they can change, it becomes their active profile. The + create buttons on that profile then create items on it.

  • In your module

    • On profile pages, the create buttons ({jrCore_item_create_button}) take care of this.
    • A create button outside a profile creates the item on the user's current active profile, which may not be the one they expect. Pass the profile explicitly, or let the user choose.
    • In a create_save view, jrCore_db_create_item() uses the active profile unless you set _profile_id in its core values.

    Check that the user may change a profile with jrProfile_is_profile_owner($profile_id).

Tags