function subscribe_pegas($album_id) { global $db, $users_table; $phpbb_gallery_notification = new \phpbbgallery\core\notification(); $sql = 'SELECT user_id FROM ' . $users_table . ' WHERE subscribe_pegas = 1'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $phpbb_gallery_notification->add_albums($album_id, (int) $row['user_id']); } $db->sql_freeresult($result); }