ad5c04c4e54fb35ef730e93b25e73bfe03d521cf
[euphorik.git] / modules / include / euphorik_bd.hrl
1 % Copyright 2008 Grégory Burri\r
2 %\r
3 % This file is part of Euphorik.\r
4 %\r
5 % Euphorik is free software: you can redistribute it and/or modify\r
6 % it under the terms of the GNU General Public License as published by\r
7 % the Free Software Foundation, either version 3 of the License, or\r
8 % (at your option) any later version.\r
9 %\r
10 % Euphorik is distributed in the hope that it will be useful,\r
11 % but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 % GNU General Public License for more details.\r
14 %\r
15 % You should have received a copy of the GNU General Public License\r
16 % along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
17 %\r
18 % @author GBurri\r
19
20
21 % Version de la BD
22 -define(VERSION_BD, 2).
23
24
25 % Pour générer des id\r
26 -record(counter,\r
27    {\r
28       key,\r
29       value\r
30    }).\r
31    
32    
33 % Mémorse toutes les propriétés, entre autre la version des données
34 -record(proprietes,
35    {
36       nom,
37       valeur
38    }).\r
39
40 \r
41 % décrit un enregistrement d'un message\r
42 -record(minichat,
43    {\r
44       id, % integer\r
45       auteur_id, % -> #user.id
46       date, % erlang:now()
47       pseudo, % chaine de caractère
48       contenu, % chaine de caractère
49       troll_id = undefined, % l'id du troll associé correspondant
50       racine_id = undefined % la racine, par défaut correspond à l'id du message
51    }).\r
52    
53    \r
54 % type bag\r
55 % 'repondant' repond à 'cible'\r
56 -record(reponse_minichat,\r
57    {\r
58       repondant, % -> #minichat.id\r
59       cible % -> #minichat.id\r
60    }). \r
61
62 \r
63 -record(user,\r
64    {\r
65       id,\r
66       cookie, % string()\r
67       pseudo = [], % string()
68       login = [], % string()
69       password = [], % string() (md5)
70       email = [], % string()\r
71       date_creation, % erlang:now()\r
72       date_derniere_connexion, % erlang:now(), est mis à jour lors de n'importe quelle activitée (envoie de message par exemple)\r
73       css = [], % string()
74       nick_format = nick, %atom(), peut valoir 'nick', 'login' ou 'nick_login'
75       view_times = true,
76       view_tooltips = true,
77       message_order = reverse, % can be normal or reverse
78       indice_flood = 0, % integer() est incrémenté lorsque l'utilisateur envoie trop rapidement des messages.
79       conversations = [], % [integer()], la liste des messages correspondant au conversation
80       ek_master = false,
81       last_ip = undefined % integer(), undefined si inconnu\r
82    }).
83
84
85 % identificateur : (ip)
86 -record(ip_table,
87    {
88       ip, % {integer(), integer(), integer(), integer()}
89       ban = undefined, % la date du dernier bannissement
90       ban_duration = 0, % le temps de ban en minute
91       nb_try_register = 0,
92       nb_try_login = 0, % pour l'instant pas utilisé
93       date_last_try_register,
94       date_last_try_login % pour l'instant pas utilisé
95    }).
96    
97    
98 -record(troll,
99    {
100       id,
101       id_user,
102       date_create, % erlang:now()
103       date_post = undefined, % date à laquelle le troll est affiché sur la page principale. undefined initialement puis erlang:now() quand affiché
104       content % chaine de caractère
105    }).
106