Improved speed due to forced indexes when showing items

This pull request contains some speed improvements in SQL queries. I did some analyzing on my system and forced some indexes. This seems to work quite well on my server. This should be helpful for smaller servers as well.

During my tests i beautified the code and removed several blanks in the source code.

And some other thing: In the past I had some problems with detecting the own hostname. I don't know if that's a general issue or only a problem for me. Since the .htconfig.php is loaded *after* the hostname is already detected, I added a new optional config file named ".htpreconfig.php"

If it's a problem that this pull request contains two things I could revert it - but I guess that would last more than one week because I need all of my time for the upcoming elections in germany.