[ticket/12765] Use db_tools instead of generating queries at moment

PHPBB3-12765
[ticket/12765] Execute query directly from db tools

PHPBB3-12765
[ticket/13005] Add event to display_forums() to modify category template data

While there're events to modify/add FORUM_POST/FORUM_LINK template data,
such an event is missing for FORUM_CAT forum type.

PHPBB3-13005
[ticket/13006] Add variables to the 'core.modify_quickmod_actions' event

Add $quickmod and $action variables
for the 'core.modify_quickmod_actions' event trigerring
to avoid of using global operator in corresponding extensions.

PHPBB3-13006
[ticket/12969] Add template events around username link on composing pm

Add template event before/after find username link on composing pm
to allow extensions perform additional actions on user finding.

PHPBB3-12969
[ticket/13031] Only use mimetype guesser guess if it helps us

If we already have a mimetype and the guesser's guess is the default fallback,
we should keep the already existing mimetype the browser supplied. Otherwise,
platforms that might not support mimetype guessers will cause us to always
have the mimetype set to application/octet-stream on images. This will prevent
users from uploading images.

PHPBB3-13031
[ticket/12852] Make get_url_parts handle get variable with no value

PHPBB3-12852
[ticket/12852] Remove whitespace

PHPBB3-12852
[ticket/12852] Add space after if

PHPBB3-12852
[ticket/12852] Add unit tests

PHPBB3-12852
[ticket/13031] Guess with all mimetype guessers and pick best guess

PHPBB3-13031
[ticket/12983] Correctly validate sorting options in the UCP

PHPBB3-12983
Merge pull request #2868 from rxu/ticket/12969

[ticket/12969] Add template events around username link on composing pm
Merge branch 'develop-ascraeus' into develop

Conflicts:
	phpBB/styles/subsilver2/template/ucp_header.html
Merge pull request #2748 from carlo94it/ticket/12765

[ticket/12765] Use db_tools instead of generating queries at moment
Merge branch 'develop-ascraeus' into develop
[ticket/13031] Slightly change behavior of choose_mime_type and add unit tests

The mime type 'application/octet-stream' will still always be overwritten by
proper guesses. However, guesses with guessers that have a higher priority
will now overwrite previous guesses even if the mime types of these guesses
had a slash in them.

PHPBB3-13031
Merge pull request #2918 from marc1706/ticket/13031

[ticket/13031] Only use mimetype guesser guess if it helps us

* marc1706/ticket/13031:
  [ticket/13031] Slightly change behavior of choose_mime_type and add unit tests
  [ticket/13031] Guess with all mimetype guessers and pick best guess
  [ticket/13031] Only use mimetype guesser guess if it helps us
Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/13031] Slightly change behavior of choose_mime_type and add unit tests
  [ticket/13031] Guess with all mimetype guessers and pick best guess
  [ticket/13031] Only use mimetype guesser guess if it helps us
[ticket/12983] Add functional test for ucp pref module

PHPBB3-12983