| // | Mod description : | // | Ce module est base sur le module existant pour le telechargement, | // | cette version permet le telechargement sur plusieurs pages. | // +-----------------------------------------------------------------------+ // | 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. | // +-----------------------------------------------------------------------+ if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } defined('DM_DIR') || define('DM_DIR' , basename(dirname(__FILE__))); defined('DM_PATH') || define('DM_PATH' , PHPWG_PLUGINS_PATH . DM_DIR . '/'); global $lang; load_language('plugin.lang', DM_PATH); function plugin_install($plugin_id, $plugin_version, &$errors) { global $prefixeTable; if(!class_exists('zipArchive')) { array_push($errors, l10n('dl_class_exist')); } list($mysql_version) = mysql_fetch_row(pwg_query('SELECT VERSION();')); if (version_compare($mysql_version, '4.1', '<')) { array_push($errors, l10n('dl_mysql_version')); } else if (version_compare(phpversion(), '5.0.0', '<')) { array_push($errors, l10n('dl_php_version')); } else { $query = ' CREATE TABLE IF NOT EXISTS `'.$prefixeTable.'download_multi` ( `id_image` mediumint(8) NOT NULL default \'0\', `id_user` smallint(5) NOT NULL default \'0\', `type` enum(\'t\',\'n\',\'h\') NOT NULL default \'t\', `filesize` int(10) unsigned NOT NULL default \'0\', UNIQUE KEY Index_1 (`id_image`,`id_user`,`type`) ) ENGINE=MyISAM COMMENT=\'Gestion des telechargement sur plusieurs pages\'; '; pwg_query($query); } } function plugin_activate($plugin_id, $plugin_version, &$errors) { } function plugin_deactivate($plugin_id) { global $prefixeTable; $query = ' DELETE FROM '.CONFIG_TABLE.' WHERE param=\'downloadmulti_config\''; pwg_query($query); } function plugin_uninstall($plugin_id) { global $prefixeTable; $query = ' DELETE FROM '.CONFIG_TABLE.' WHERE param=\'downloadmulti_config\''; pwg_query($query); $query = 'DROP TABLE IF EXISTS `'.$prefixeTable.'download_multi`;'; pwg_query($query); } ?>