Merge pull request #178 from Robertof/master

Rewrite the video/audio logic and fix two critical vulnerabilities
Update submodules tpl/{0,1,2,3}
Improve UTF-8 support. Remove htmlentities in favour of htmlspecialchars. Join validation of users properties in creating and updating preferences. The same for projects. Change database structure. Remove checks about UTC timezone (the setup script set the timezone to UTC). Add migration scripts in setup folder. Various fixes
Remove debug code
Remove wrong setcookie function calls. logout function remove cookie in the safe way
Merge branch 'master' of github.com:nerdzeu/nerdz.eu
Remove blackist control now handled via dmbs trigger
Fix username session variable
Remove twitter closing tag from titles
Update submodule tpl/2
Fixes issue #182
Fixes  NERDZIlla issue #179
Update submodule tpl/1
Update submodules 1,2
Update templates
Fixes  NERDZIlla issue #194
Major changes to the PM/notification counters

Here's a list of changes:
- Some code has been refactored (no more 2 spaces sh**).
- New API method: N.isLoggedIn(), checks if the PM counter exists.
- The counters are now event-based. Each time a new notification or PM is detected, an event is fired.
- NERDZ is now using these events internally, but they are available for every theme/userscript developer.
- You can subscribe to these events with jQuery using the jQuery(document).on ('eventName', function (event, counter, previousCounter) { }).
Event names:
- nerdz:notification: fired each time a new notification is detected.
- nerdz:pm: fired each time a new PM is detected.
- nerdz_internal:set_counter: an internal event used to manually set the counter to a specified value.
WARNING: since NERDZ is using these events you cannot unsubscribe to them using simply jQuery(document).off ('eventName'), otherwise NERDZ notifications would stop working. You must use jQuery namespaces, please read more at http://api.jquery.com/on/#event-names. NERDZ is using the reserved namespace 'nerdz'. Usage of that namespace is forbidden.
The common users will not notice these changes, unless something goes wrong (it shouldn't). The PMs got the priority over the notifications (so you will always see [pm_count] (notification_count) instead of (notification_count) [pm_count]).