[ticket/10605] Check for orphan privmsgs when deleting a user

Also moved the hole code into a new function.

PHPBB3-10605
[ticket/10605] Delete orphan private messages on update

PHPBB3-10605
[ticket/10605] Prefix function with phpbb_ and use true instead of 1

PHPBB3-10605
[ticket/10605] Use unset() instead of checking user_id over and over again.

PHPBB3-10605
[ticket/10605] Turn $undelivered_user into a real array of counters.

PHPBB3-10605
[ticket/10605] Remove unused variable declarations.

PHPBB3-10605
[ticket/10605] Remove unnecessary array_keys calls on $delete_rows.

PHPBB3-10605
[ticket/10605] Remove unnecessary $delete_ids array.

PHPBB3-10605
[ticket/10605] Break long comment into multiple lines 80 chars short.

PHPBB3-10605
[ticket/10605] Rename $delete_rows to $delete_ids.

PHPBB3-10605
[ticket/10605] Split query to be able to use indexes

PHPBB3-10605
[ticket/10605] Reset user´s pm count to 0 when deleting his PMs

PHPBB3-10605
[ticket/10605] Fix syntax error in database updater.

PHPBB3-10605
[ticket/10605] Add a section for updating from 3.0.10 to schema updates.

Without it data updates do not appear to be run.

PHPBB3-10605
[ticket/10605] Fix left join usage.

Previously this produced broken SQL:

SELECT p.msg_id FROM phpbb_privmsgs p
LEFT JOIN 0 phpbb_privmsgs_to ON (p.msg_id = t.msg_id)
WHERE t.user_id IS NULL LIMIT 500 OFFSET 0

PHPBB3-10605
[ticket/10605] Add parameter documentation to phpbb_delete_user_pms

PHPBB3-10605
[ticket/10605] Put end of array on its own line because start of array is too.

PHPBB3-10605
[ticket/10605] Use database updater function _sql() instead of $db->sql_query()

PHPBB3-10605
Merge branch 'ticket/10605' into develop-olympus

* ticket/10605:
  [ticket/10605] Use database updater function _sql() instead of $db->sql_query()
  [ticket/10605] Put end of array on its own line because start of array is too.
  [ticket/10605] Add parameter documentation to phpbb_delete_user_pms
  [ticket/10605] Fix left join usage.
  [ticket/10605] Add a section for updating from 3.0.10 to schema updates.
  [ticket/10605] Fix syntax error in database updater.
  [ticket/10605] Reset user´s pm count to 0 when deleting his PMs
  [ticket/10605] Split query to be able to use indexes
  [ticket/10605] Rename $delete_rows to $delete_ids.
  [ticket/10605] Break long comment into multiple lines 80 chars short.
  [ticket/10605] Remove unnecessary $delete_ids array.
  [ticket/10605] Remove unnecessary array_keys calls on $delete_rows.
  [ticket/10605] Remove unused variable declarations.
  [ticket/10605] Turn $undelivered_user into a real array of counters.
  [ticket/10605] Use unset() instead of checking user_id over and over again.
  [ticket/10605] Prefix function with phpbb_ and use true instead of 1
  [ticket/10605] Delete orphan private messages on update
  [ticket/10605] Check for orphan privmsgs when deleting a user

Conflicts:
	phpBB/install/database_update.php
Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/10605] Use database updater function _sql() instead of $db->sql_query()
  [ticket/10605] Put end of array on its own line because start of array is too.
  [ticket/10605] Add parameter documentation to phpbb_delete_user_pms
  [ticket/10605] Fix left join usage.
  [ticket/10605] Add a section for updating from 3.0.10 to schema updates.
  [ticket/10605] Fix syntax error in database updater.
  [ticket/10605] Reset user´s pm count to 0 when deleting his PMs
  [ticket/10605] Split query to be able to use indexes
  [ticket/10605] Rename $delete_rows to $delete_ids.
  [ticket/10605] Break long comment into multiple lines 80 chars short.
  [ticket/10605] Remove unnecessary $delete_ids array.
  [ticket/10605] Remove unnecessary array_keys calls on $delete_rows.
  [ticket/10605] Remove unused variable declarations.
  [ticket/10605] Turn $undelivered_user into a real array of counters.
  [ticket/10605] Use unset() instead of checking user_id over and over again.
  [ticket/10605] Prefix function with phpbb_ and use true instead of 1
  [ticket/10605] Delete orphan private messages on update
  [ticket/10605] Check for orphan privmsgs when deleting a user