5 * Distribue sous licence GPL
9 if (!defined("_ECRIRE_INC_VERSION")) return;
13 * Declarer le champ notification_email sur la table forum
15 * @param array $tables
18 function notifications_declarer_tables_objets_sql($tables){
20 // champ notification (editable via le form de forum) :
21 // 0/1 (non abonne/abonne) defaut 1
22 $tables['spip_forum']['field']['notification'] = "tinyint NOT NULL default 1";
23 $tables['spip_forum']['champs_editables'][] = 'notification';
25 // champ notification_email :
26 // vide -> notification par le champ id_auteur ou email_auteur
27 // email -> notification sur cet email (permet de maj l'email de notif sans modifier l'email de signature)
28 $tables['spip_forum']['field']['notification_email'] = "text DEFAULT '' NOT NULL";
37 * @param string $nom_meta_base_version
38 * @param string $version_cible
40 function notifications_upgrade($nom_meta_base_version,$version_cible){
43 $maj['create'] = array(
44 array('maj_tables',array('spip_forum')),
47 $maj['0.1.3'] = array(
48 array('sql_alter',"TABLE spip_forum CHANGE notification notification_email text DEFAULT '' NOT NULL"),
49 array('maj_tables',array('spip_forum')),
52 include_spip('base/upgrade');
53 maj_plugin($nom_meta_base_version, $version_cible, $maj);
56 function notifications_vider_tables($nom_meta_base_version) {
57 #on ne drop pas pour ne pas perdre les reglages.. a voir
58 #sql_alter("TABLE spip_forum DROP COLUMN notification");
59 effacer_meta($nom_meta_base_version);