X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=sidebyside;f=modules%2Finclude%2Feuphorik_bd.hrl;h=0b04c4b53697b79674a77eba93880602d6e63e6f;hb=75cd78e0253509fad9c3cbfadda4a1c193c2b6e0;hp=8c16c702181c852c45ef1fa95abf5c1320d989e4;hpb=bde82d4691e6bb96f841307b8e2771cec5996e5d;p=euphorik.git
diff --git a/modules/include/euphorik_bd.hrl b/modules/include/euphorik_bd.hrl
index 8c16c70..0b04c4b 100755
--- a/modules/include/euphorik_bd.hrl
+++ b/modules/include/euphorik_bd.hrl
@@ -1,68 +1,100 @@
-% Copyright 2008 Grégory Burri
-%
-% This file is part of Euphorik.
-%
-% Euphorik is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% Euphorik is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with Euphorik. If not, see .
-%
-% @author GBurri
+% coding: utf-8
+% Copyright 2008 Grégory Burri
+%
+% This file is part of Euphorik.
+%
+% Euphorik is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Euphorik is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Euphorik. If not, see .
+%
+% @author GBurri
-% Pour générer des id
--record(counter,
- {
- key,
- value
- }).
-
-
-% décrit un enregistrement d'un message
+% Version de la BD
+-define(VERSION_BD, 3).
+-define(TABLES, [counter, proprietes, minichat, reponse_minichat, user, ip_table, troll]).
+
+
+% Pour générer des id
+-record(counter,
+ {
+ key,
+ value
+ }).
+
+
+% Mémorse toutes les propriétés, entre autre la version des données
+-record(proprietes,
+ {
+ nom,
+ valeur
+ }).
+
+
+% Contient tous les textes que peut envoyer le serveur vers client.
+-record(texte,
+ {
+ id,
+ fr
+ }).
+
+
+% décrit un enregistrement d'un message
-record(minichat,
- {
- id, % integer
+ {
+ id, % integer
auteur_id, % -> #user.id
date, % erlang:now()
- pseudo, % chaine de caractère
- contenu % chaine de caractère
- }).
+ pseudo, % chaine de caractère
+ contenu, % chaine de caractère
+ racine_id = undefined % la racine, par défaut correspond à l'id du message
+ }).
-
-% type bag
-% 'repondant' repond à 'cible'
--record(reponse_minichat,
- {
- repondant, % -> #minichat.id
- cible % -> #minichat.id
- }).
+
+% type bag
+% 'repondant' repond à 'cible'
+-record(reponse_minichat,
+ {
+ repondant, % -> #minichat.id
+ cible % -> #minichat.id
+ }).
+
-
--record(user,
- {
- id,
- cookie, % string()
+-record(profile, % attention : pas une table !
+ {
pseudo = [], % string()
- login = [], % string()
- password = [], % string() (md5)
- email = [], % string()
- date_creation, % erlang:now()
- date_derniere_connexion, % erlang:now(), est mis à jour lors de n'importe quelle activitée (envoie de message par exemple)
+ email = [], % string()
css = [], % string()
nick_format = nick, %atom(), peut valoir 'nick', 'login' ou 'nick_login'
- indice_flood = 0, % integer() est incrémenté lorsque l'utilisateur envoie trop rapidement des messages.
- page_principale = 1, % la page de la conversation principale
- conversations = [], % [{integer(), integer()}], la liste des messages correspondant au conversation ainsi que la page affichée
+ view_times = true,
+ view_tooltips = true,
+ ostentatious_master = light, % peut valoir invisible, light ou heavy. seulement pour ek_master
+ chat_order = reverse, % peut valoir chrono ou reverse
+ conversations = [] % [{integer(), bool}], la liste des messages correspondant au conversation {racine, reduite?}
+ }).
+
+
+-record(user,
+ {
+ id,
+ cookie, % string()
+ login = [], % string()
+ password = [], % string() (md5)
+ profile = #profile{},
+ date_creation, % erlang:now()
+ date_derniere_connexion, % erlang:now(), est mis à jour lors de n'importe quelle activitée (envoie de message par exemple)
+ indice_flood = 0, % integer() est incrémenté lorsque l'utilisateur envoie trop rapidement des messages.
ek_master = false,
- last_ip = undefined % integer(), undefined si inconnu
+ last_ip = undefined % integer(), undefined si inconnu
}).
@@ -73,18 +105,19 @@
ban = undefined, % la date du dernier bannissement
ban_duration = 0, % le temps de ban en minute
nb_try_register = 0,
- nb_try_login = 0, % pour l'instant pas utilisé
+ nb_try_login = 0, % pour l'instant pas utilisé
date_last_try_register,
- date_last_try_login % pour l'instant pas utilisé
+ date_last_try_login % pour l'instant pas utilisé
}).
-record(troll,
{
id,
- id_user,
+ id_user,
+ id_minichat = undefined, % l'id du message associé
date_create, % erlang:now()
- date_post = undefined, % date à laquelle le troll est affiché sur la page principale. undefined initialement puis erlang:now() quand affiché
- content % chaine de caractère
+ date_post = undefined, % date à laquelle le troll est affiché sur la page principale. undefined initialement puis erlang:now() quand affiché
+ content % chaine de caractère
}).
\ No newline at end of file