That's not something you would do with cron task, that's something you would do in the script when those conditions are met.Hervé wrote: Sun Jul 14, 2024 8:07 am The ideal would be each time a member modifies a specific profile field, at least each time a member logs in
This is something you would do with cron task. Note that the cron task within phpBB is what is considered a "poor mans cron" as it typically relies on a user loading a page to trigger it. You don't need phpBB to do this.If you look in your hosting control panel there is probably section for contrab where you can set it to execute a script based on whatever time measurement you want.
or even once a day.
Code: Select all
// Update Custom Fields
$cp->update_profile_field_data($user->data['user_id'], $cp_data);
update_profile_field_data
Code: Select all
public function update_profile_field_data($user_id, $cp_data)
{
$sql = 'UPDATE ' . $this->fields_data_table . '
SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . '
WHERE user_id = ' . (int) $user_id;
$this->db->sql_query($sql);
}
Code: Select all
$sql = "UPDATE phpbb_profile_fields_data SET `pf_autovol`='".$Vol."' WHERE user_id=".data['user_id'];
$this->db->sql_query($sql);
Code: Select all
$user->get_profile_fields( $user->data['user_id'] );
$TankDim = $user->profile_fields['pf_tankdim'];
// compute $Vol = F($TankDim)
$user->profile_fields['pf_autovol'] = $Vol;