diff --git a/includes/session.php b/includes/session.php index 0c0f660..dac376c 100755 --- a/includes/session.php +++ b/includes/session.php @@ -6,17 +6,29 @@ ini_set("session.cookie_lifetime",60*60*24*30); session_start(); $user = new Kabano\User(); -$user->rank = "visitor"; // All users are visitors if(isset($_SESSION['userid'])) { - $user->checkID($_SESSION['userid']); if ($user->checkID($_SESSION['userid'])) { $user->updateLoginDate(); - //setlocale(LC_ALL, $config['locales'][$user->locale][4]); + $config['locale'] = $user->locale; + $config['timezone'] = $user->timezone; } else { session_destroy(); + $config['locale'] = locale_get_default(); + $config['timezone'] = date_default_timezone_get(); + $user->rank = "visitor"; // All users are visitors } } +else { + $config['locale'] = locale_get_default(); + $config['timezone'] = date_default_timezone_get(); + $user->rank = "visitor"; // All users are visitors +} + +$user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::NONE, $config['timezone']); +$user->datetime_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::SHORT, $config['timezone']); +$user->datetimeshort_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $config['timezone']); + ?> \ No newline at end of file diff --git a/models/d.users.php b/models/d.users.php index d6d361d..5307af9 100755 --- a/models/d.users.php +++ b/models/d.users.php @@ -213,7 +213,7 @@ class User $this->visit_date = date('r'); $this->register_date = date('r'); $this->locale = "fr_FR"; - $this->timezone = "CEST"; + $this->timezone = "Europe/Paris"; $con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass']) or die ("Could not connect to server\n"); diff --git a/views/d.blog.list.html b/views/d.blog.list.html index cc06ecf..ebfdeeb 100755 --- a/views/d.blog.list.html +++ b/views/d.blog.list.html @@ -27,7 +27,7 @@

Lire la suite... - Le update_date)) ?> par + Le date_format,strtotime($row->update_date)) ?> par rankIsHigher("registered")) { ?> author_name?> objs as $row) { ?> - + @@ -45,7 +45,7 @@ else { ?> author_name?> - le creation_date)) ?> UTC

+ le datetime_format,strtotime($blogArticle->creation_date)) ?>

@@ -83,7 +83,7 @@ author_obj->name?> - le update_date)) ?> UTC + le datetime_format,strtotime($comment->update_date)) ?>

rankIsHigher("moderator") || $user->id == $comment->author) && $comment->is_public == 't') { ?> Effacer le commentaire diff --git a/views/d.user.member_list.html b/views/d.user.member_list.html index 083e01f..aadd3ab 100755 --- a/views/d.user.member_list.html +++ b/views/d.user.member_list.html @@ -45,8 +45,8 @@ name?> get_rank()?> - register_date)) ?> - visit_date)) ?> + date_format,strtotime($row->register_date)) ?> + date_format,strtotime($row->visit_date)) ?> website != "") { ?> Site internet diff --git a/views/d.user.profile.html b/views/d.user.profile.html index bdf21b0..718f6ff 100755 --- a/views/d.user.profile.html +++ b/views/d.user.profile.html @@ -24,8 +24,8 @@

Langue : get_locale()?>

-

Inscrit le register_date)) ?> UTC

-

Dernière connexion le visit_date)) ?> UTC

+

Inscrit le datetime_format,strtotime($userProfile->register_date)) ?>

+

Dernière connexion le datetime_format,strtotime($userProfile->visit_date)) ?>

get_rank()?>

website != "") { ?> diff --git a/views/d.wiki.view.html b/views/d.wiki.view.html index 35a7c30..836eaca 100755 --- a/views/d.wiki.view.html +++ b/views/d.wiki.view.html @@ -15,7 +15,7 @@ @@ -38,7 +38,7 @@ content_html?>

-

Page mise à jour le update_date)) ?> UTC

+

Page mise à jour le datetime_format,strtotime($wikiPage->update_date)) ?>