Improve posts datation

This commit is contained in:
Pierre 2018-05-13 13:25:43 +02:00
parent 1ffa215d4d
commit 9731f3b632
2 changed files with 3 additions and 1 deletions

View File

@ -425,6 +425,7 @@ class Posts {
"ID_personne" => $post_user_id,
"ID_amis" => $post_friend_id,
"date_envoi" => mysql_date(),
"time_insert" => time(),
"texte" => $post->has_content() ? $post->get_content() : "",
"niveau_visibilite" => $post->get_visibility_level(),
"type" => $post_kind_db,
@ -684,7 +685,7 @@ class Posts {
$post->set_id($entry["ID"]);
$post->set_userID($entry["ID_amis"] == 0 ? $entry["ID_personne"] : $entry["ID_amis"]);
$post->set_user_page_id($entry["ID_personne"]);
$post->set_time_sent(strtotime($entry["date_envoi"]));
$post->set_time_sent($entry["time_insert"] == null ? strtotime($entry["date_envoi"]) : $entry["time_insert"]);
$post->set_content($entry["texte"]);
$post->set_visibility_level($entry["niveau_visibilite"]);
$post->set_kind($this::POSTS_DB_TYPES[$entry["type"]]);

View File

@ -421,6 +421,7 @@ CREATE TABLE `texte` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`ID_personne` int(11) NOT NULL,
`date_envoi` datetime NOT NULL,
`time_insert` int(11) DEFAULT NULL,
`texte` text NOT NULL,
`ID_amis` int(11) NOT NULL DEFAULT '0',
`niveau_visibilite` varchar(255) NOT NULL DEFAULT '1',