-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.php
23 lines (19 loc) · 1.02 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/*
* CMS module: Download Gallery 3
* Copyright and more information see file info.php
*/
// prevent this file from being accessed directly
if (!defined('WB_PATH')) die(header('Location: index.php'));
$dlgmodname = str_replace(str_replace('\\','/',WB_PATH).'/modules/','',str_replace('\\','/',dirname(__FILE__)));
$tablename = 'mod_'.$dlgmodname;
//Remove all table entries and drop some tables.
$database->query("DELETE FROM `".TABLE_PREFIX."search` WHERE `name` = 'module' AND `value` = '$dlgmodname'");
$database->query("DELETE FROM `".TABLE_PREFIX."search` WHERE `extra` = '$dlgmodname'");
$database->query("DROP TABLE `".TABLE_PREFIX.$tablename."_files`");
$database->query("DROP TABLE `".TABLE_PREFIX.$tablename."_settings`");
$database->query("DROP TABLE `".TABLE_PREFIX.$tablename."_groups`");
$database->query("DROP TABLE `".TABLE_PREFIX.$tablename."_file_ext`");
//Remove the download_gallery folder in the media dir
require_once WB_PATH.'/framework/functions.php';
rm_full_dir(WB_PATH . MEDIA_DIRECTORY . '/' . $dlgmodname);