(Preliminary note : This is a deep modification in tikiwiki's prefs code. Please test first and send feedback if you can)
* Now use the $prefs array everywhere (in php files also) instead of global vars. This will :
- allow to use prefs the same way in smarty and php ($prefs array),
- simplify all code parts that modifiy a preference, because when a pref is modified in php's $prefs array, it is also up-to-date in smarty $prefs array (everything is passed by reference now). So, no more need to reassign values in smarty each time,
- avoid duplication of values in memory,
- reduce risks of errors (e.g. collision in variables names, forget to add one of the "global $prefname", ...)
* All user prefs are now retrieved in one query at tiki-setup stage (as site prefs) and also in session vars (when sessions are used). This will :
- reduce overhead and database queries after the first page
* User prefs are now overriding $prefs. This will :
- simplify the whole usage of $prefs, because only one array is used (no more need, in general, to use tikilib's functions to get user prefs),
- set some $prefs['site_*'] (listed in the $user_overrider_prefs array of lib/setup/user_prefs.php) for some specific site prefs that needs to be accessed in php (for example when sending mails) and that could have been overrided with the corresponding user pref

[MOD] timezones: rollback of last commit about timezones. Idea is good but spreading timestamp manipulation makes erratic border effects and makes impossible to display timezone properly with date functions. Please hold commits for some hours, calendar rolledback code will be committed back, as well as some other parts, as there were some nice fixes anyway

[MOD] dates and timezones : Modify every call to php native date / timezone functions in order to use GMT timezone instead of the server timezone.
Timestamps stored in the database should be stored in GMT timezone, because changing the server (or just its timezone settings) should never have an impact on tikiwiki. This is why every date(), strftime() and mktime() calls are replaced by gmdate(), gmstrftime() and gmmktime(). Those functions will use GMT timestamps and not a timestamp that depends on the server TZ environment variable.
!! Note that everything has not been fully tested yet and that this update lacks of an upgrade path for existing calendars and timezones stored in database with a server timezone.