1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Plugin Name : Register_PhpBB | |
---|
4 | // | Plugin Version : 1.2a | |
---|
5 | // | File Version : 0.2 | |
---|
6 | // | Plugin Version author : Eric <lucifer@infernoweb.net> | |
---|
7 | // | Plugin description : | |
---|
8 | // | Ce plugin permet l'enregistrement d'un utilisateur directement dans | |
---|
9 | // | phpbb - This plugin allows to automatically register a PWG user in a | |
---|
10 | // | phpbb forum | |
---|
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_PHPBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
32 | include_once(REGISTER_PHPBB_PATH.'include/constants.php'); |
---|
33 | |
---|
34 | function plugin_install() |
---|
35 | { |
---|
36 | $q = ' |
---|
37 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
38 | VALUES |
---|
39 | ("phpbb_status","0","Activation of Register_PhpBB plugin");'; |
---|
40 | |
---|
41 | pwg_query($q); |
---|
42 | |
---|
43 | $q = ' |
---|
44 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
45 | VALUES |
---|
46 | ("phpbb_prefix","phpbb_","PhpBB prefix tables");'; |
---|
47 | |
---|
48 | pwg_query($q); |
---|
49 | |
---|
50 | $q = ' |
---|
51 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
52 | VALUES |
---|
53 | ("phpbb_admin","admin","PWG administrator username. Must be the same as PhpBB administrator username");'; |
---|
54 | |
---|
55 | pwg_query($q); |
---|
56 | |
---|
57 | $q = ' |
---|
58 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
59 | VALUES |
---|
60 | ("phpbb_timezone","1","Timezone");'; |
---|
61 | |
---|
62 | pwg_query($q); |
---|
63 | |
---|
64 | $q = ' |
---|
65 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
66 | VALUES |
---|
67 | ("phpbb_language","English","Language");'; |
---|
68 | |
---|
69 | pwg_query($q); |
---|
70 | |
---|
71 | $q = ' |
---|
72 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
73 | VALUES |
---|
74 | ("phpbb_style","1","Default forum\'s skin ID");'; |
---|
75 | |
---|
76 | pwg_query($q); |
---|
77 | |
---|
78 | $q = ' |
---|
79 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
80 | VALUES |
---|
81 | ("phpbb_del_pt","1","Deletion of topics and posts from deleted user");'; |
---|
82 | |
---|
83 | pwg_query($q); |
---|
84 | |
---|
85 | $q = ' |
---|
86 | CREATE TABLE IF NOT EXISTS '.PLUGIN_REGISTER_PHPBB_ID.' ( |
---|
87 | id_user_pwg smallint(5) NOT NULL default "0", |
---|
88 | id_user_phpbb int(10) NOT NULL default "0", |
---|
89 | KEY id_user_pwg (id_user_pwg,id_user_phpbb));'; |
---|
90 | |
---|
91 | pwg_query($q); |
---|
92 | } |
---|
93 | |
---|
94 | |
---|
95 | function plugin_uninstall() |
---|
96 | { |
---|
97 | $q = ' |
---|
98 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_status" LIMIT 1;'; |
---|
99 | pwg_query( $q ); |
---|
100 | |
---|
101 | $q = ' |
---|
102 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_prefix" LIMIT 1;'; |
---|
103 | pwg_query( $q ); |
---|
104 | |
---|
105 | $q = ' |
---|
106 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_admin" LIMIT 1;'; |
---|
107 | pwg_query( $q ); |
---|
108 | |
---|
109 | $q = ' |
---|
110 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_timezone" LIMIT 1;'; |
---|
111 | pwg_query( $q ); |
---|
112 | |
---|
113 | $q = ' |
---|
114 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_language" LIMIT 1;'; |
---|
115 | pwg_query( $q ); |
---|
116 | |
---|
117 | $q = ' |
---|
118 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_style" LIMIT 1;'; |
---|
119 | pwg_query( $q ); |
---|
120 | |
---|
121 | $q = ' |
---|
122 | DELETE FROM '.CONFIG_TABLE.' WHERE param="phpbb_del_pt" LIMIT 1;'; |
---|
123 | pwg_query( $q ); |
---|
124 | |
---|
125 | $q = 'DROP TABLE '.PLUGIN_REGISTER_PHPBB_ID.';'; |
---|
126 | pwg_query( $q ); |
---|
127 | } |
---|
128 | |
---|
129 | ?> |
---|