Fixing performance issues in some forum queries due to distinct.

DataQuery always adds DISTINCT to queries, but this slows things down
when performing queries against large amounts of data. In those cases,
we also don't need to be checking distinct.
Merge pull request #100 from halkyon/performance_fixes

Fixing performance issues in some forum queries.
Fixing getLatestMembers performance when limiting by 1

Uses a more efficient aggregate query, to avoid the database having to
do a filesort on a temporary table because of joining and sorting.
Using RIGHT JOIN in this case appears to be faster, so had to drop back
to straight up SQL instead of using the ORM.

On large Member tables, this reduces the querying from ~400ms in one
to around ~60ms in two (one to get the max ID, and another to fetch
the Member record by ID)

Also removed the administrators group from the query. I don't see why
you'd want to see the latest administrator join the site.
Merge pull request #101 from halkyon/member_query_performance

Fixing getLatestMembers performance when limiting by 1
Configuable avatar and attachment folders - retires the CMS configable folders which are not as robust
Merge pull request #103 from camfindlay/90-uploadfolder

Configuable avatar and attachment folders
Update 0.7 dev branch travis to test against 3.1 core
Tracking CI against 3.1
Removing redundant filter. This is handled in ForumSpamPostExtension
Fixing LatestMembers query to not rely on RIGHT JOIN

Just use the Group_Members table to find the latest MemberID. This
also makes it work in databases that don't support RIGHT JOIN.
Merge pull request #105 from halkyon/latest_members_fix

Fixing LatestMembers query to not rely on RIGHT JOIN
Merge pull request #104 from halkyon/remove_redundant_query

Removing redundant filter. This is handled in ForumSpamPostExtension
Provide the ability to disable "Currently Online" functionality.

It relies on a write to Member.LastViewed on every request for a logged
in forum Member, which can be database blocking if forum traffic is
high.
Merge pull request #106 from halkyon/currently_online_disable

Provide the ability to disable "Currently Online" functionality.
Fix performance dramatically for large Post tables

Pre-filter the sub-select of Post in these queries, which massively
improves performance on large Post tables.

Add indexes to ForumThread as well which helps across the board.
Merge pull request #108 from halkyon/performance_fixes2

Fix performance dramatically for large Post tables
BUG Fix isFirstPost crashing on unsaved records
Merge pull request #110 from tractorcow/pulls/0.7/fix-firstpost

BUG Fix isFirstPost crashing on unsaved records
BUG Attempt to access File::$allowed_extensions when uploading invalid file

Use Config to retrieve the variable instead of trying to access it
directly, and failing.
Merge pull request #112 from halkyon/allowed_exts_fix

BUG Attempt to access File::$allowed_extensions when uploading invalid file