| // | Plugin description : | // | Ce plugin permet l'enregistrement d'un utilisateur directement dans | // | PunBB (http://www.punbb.org) - This plugin allows to automatically | // | register a PWG user in a PunBB forum (http://www.punbb.org) | // +-----------------------------------------------------------------------+ // | This program 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 | // | | // | This program 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 this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ // ****************************************** // ** Database install - uninstall queries ** // ****************************************** define('REGISTER_PUNBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); include_once(REGISTER_PUNBB_PATH.'include/constants.php'); function plugin_install() { $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_status","0","Activation of Register_PunBB plugin");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_prefix","forum_","Préfixe des tables de punbb");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_id_default_group","4","ID du groupe par défaut dans PunBB");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_admin","admin","Nom d\'utilisateur de l\'administrateur de PWG. Doit être identique à celui de PunBB");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_email_setting","1","Parametre de visibilité des emails");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_save_pass","0","Parametre pour la sauvegarde du mot de passe");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("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");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_timezone","1","Zone de temps");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_language","English","Parametre de langue");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_style","Cobalt","Style du forum");'; pwg_query($q); $q = ' INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("punbb_del_pt","1","Suppression des topics et post de l\'utilisateur");'; pwg_query($q); $q = ' CREATE TABLE IF NOT EXISTS '.PLUGIN_REGISTER_PUNBB_ID.' ( id_user_pwg smallint(5) NOT NULL default "0", id_user_punbb int(10) NOT NULL default "0", KEY id_user_pwg (id_user_pwg,id_user_punbb));'; pwg_query($q); } function plugin_uninstall() { $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_status" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_prefix" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_id_default_group" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_admin" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_email_setting" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_save_pass" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_notify_with_post" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_timezone" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_language" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_style" LIMIT 1;'; pwg_query( $q ); $q = ' DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_del_pt" LIMIT 1;'; pwg_query( $q ); $q = 'DROP TABLE '.PLUGIN_REGISTER_PUNBB_ID.';'; pwg_query( $q ); } ?>