1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Plugin Name : Register_PunBB | |
---|
4 | // | Plugin Version : 1.3a | |
---|
5 | // | File Version : 0.3 | |
---|
6 | // | Plugin Version author : Eric <lucifer@infernoweb.net> | |
---|
7 | // | Plugin description : | |
---|
8 | // | Ce plugin permet l'enregistrement d'un utilisateur directement dans | |
---|
9 | // | PunBB (http://www.punbb.org) - This plugin allows to automatically | |
---|
10 | // | register a PWG user in a PunBB forum (http://www.punbb.org) | |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | This program is free software; you can redistribute it and/or modify | |
---|
13 | // | it under the terms of the GNU General Public License as published by | |
---|
14 | // | the Free Software Foundation | |
---|
15 | // | | |
---|
16 | // | This program is distributed in the hope that it will be useful, but | |
---|
17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
19 | // | General Public License for more details. | |
---|
20 | // | | |
---|
21 | // | You should have received a copy of the GNU General Public License | |
---|
22 | // | along with this program; if not, write to the Free Software | |
---|
23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
24 | // | USA. | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | |
---|
27 | // ****************************************** |
---|
28 | // ** Database install - uninstall queries ** |
---|
29 | // ****************************************** |
---|
30 | |
---|
31 | define('REGISTER_PUNBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
32 | include_once(REGISTER_PUNBB_PATH.'include/constants.php'); |
---|
33 | |
---|
34 | function plugin_install() |
---|
35 | { |
---|
36 | $q = ' |
---|
37 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
38 | VALUES |
---|
39 | ("punbb_status","0","Activation of Register_PunBB plugin");'; |
---|
40 | |
---|
41 | pwg_query($q); |
---|
42 | |
---|
43 | $q = ' |
---|
44 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
45 | VALUES |
---|
46 | ("punbb_prefix","forum_","Préfixe des tables de punbb");'; |
---|
47 | |
---|
48 | pwg_query($q); |
---|
49 | |
---|
50 | $q = ' |
---|
51 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
52 | VALUES |
---|
53 | ("punbb_id_default_group","4","ID du groupe par défaut dans PunBB");'; |
---|
54 | |
---|
55 | pwg_query($q); |
---|
56 | |
---|
57 | $q = ' |
---|
58 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
59 | VALUES |
---|
60 | ("punbb_admin","admin","Nom d\'utilisateur de l\'administrateur de PWG. Doit être identique à celui de PunBB");'; |
---|
61 | |
---|
62 | pwg_query($q); |
---|
63 | |
---|
64 | $q = ' |
---|
65 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
66 | VALUES |
---|
67 | ("punbb_email_setting","1","Parametre de visibilité des emails");'; |
---|
68 | |
---|
69 | pwg_query($q); |
---|
70 | |
---|
71 | $q = ' |
---|
72 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
73 | VALUES |
---|
74 | ("punbb_save_pass","0","Parametre pour la sauvegarde du mot de passe");'; |
---|
75 | |
---|
76 | pwg_query($q); |
---|
77 | |
---|
78 | $q = ' |
---|
79 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
80 | VALUES |
---|
81 | ("punbb_notify_with_post","1","En activant cette option, une version en texte brut du nouveau message sera incluse dans l\'avis d\abonnement par e-mail");'; |
---|
82 | |
---|
83 | pwg_query($q); |
---|
84 | |
---|
85 | $q = ' |
---|
86 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
87 | VALUES |
---|
88 | ("punbb_timezone","1","Zone de temps");'; |
---|
89 | |
---|
90 | pwg_query($q); |
---|
91 | |
---|
92 | $q = ' |
---|
93 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
94 | VALUES |
---|
95 | ("punbb_language","English","Parametre de langue");'; |
---|
96 | |
---|
97 | pwg_query($q); |
---|
98 | |
---|
99 | $q = ' |
---|
100 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
101 | VALUES |
---|
102 | ("punbb_style","Cobalt","Style du forum");'; |
---|
103 | |
---|
104 | pwg_query($q); |
---|
105 | |
---|
106 | $q = ' |
---|
107 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
108 | VALUES |
---|
109 | ("punbb_del_pt","1","Suppression des topics et post de l\'utilisateur");'; |
---|
110 | |
---|
111 | pwg_query($q); |
---|
112 | |
---|
113 | $q = ' |
---|
114 | CREATE TABLE IF NOT EXISTS '.PLUGIN_REGISTER_PUNBB_ID.' ( |
---|
115 | id_user_pwg smallint(5) NOT NULL default "0", |
---|
116 | id_user_punbb int(10) NOT NULL default "0", |
---|
117 | KEY id_user_pwg (id_user_pwg,id_user_punbb));'; |
---|
118 | |
---|
119 | pwg_query($q); |
---|
120 | } |
---|
121 | |
---|
122 | |
---|
123 | function plugin_uninstall() |
---|
124 | { |
---|
125 | $q = ' |
---|
126 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_status" LIMIT 1;'; |
---|
127 | pwg_query( $q ); |
---|
128 | |
---|
129 | $q = ' |
---|
130 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_prefix" LIMIT 1;'; |
---|
131 | pwg_query( $q ); |
---|
132 | |
---|
133 | $q = ' |
---|
134 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_id_default_group" LIMIT 1;'; |
---|
135 | pwg_query( $q ); |
---|
136 | |
---|
137 | $q = ' |
---|
138 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_admin" LIMIT 1;'; |
---|
139 | pwg_query( $q ); |
---|
140 | |
---|
141 | $q = ' |
---|
142 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_email_setting" LIMIT 1;'; |
---|
143 | pwg_query( $q ); |
---|
144 | |
---|
145 | $q = ' |
---|
146 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_save_pass" LIMIT 1;'; |
---|
147 | pwg_query( $q ); |
---|
148 | |
---|
149 | $q = ' |
---|
150 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_notify_with_post" LIMIT 1;'; |
---|
151 | pwg_query( $q ); |
---|
152 | |
---|
153 | $q = ' |
---|
154 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_timezone" LIMIT 1;'; |
---|
155 | pwg_query( $q ); |
---|
156 | |
---|
157 | $q = ' |
---|
158 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_language" LIMIT 1;'; |
---|
159 | pwg_query( $q ); |
---|
160 | |
---|
161 | $q = ' |
---|
162 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_style" LIMIT 1;'; |
---|
163 | pwg_query( $q ); |
---|
164 | |
---|
165 | $q = ' |
---|
166 | DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_del_pt" LIMIT 1;'; |
---|
167 | pwg_query( $q ); |
---|
168 | |
---|
169 | $q = 'DROP TABLE '.PLUGIN_REGISTER_PUNBB_ID.';'; |
---|
170 | pwg_query( $q ); |
---|
171 | } |
---|
172 | |
---|
173 | ?> |
---|