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