-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.php
48 lines (39 loc) · 1.37 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
*
* @category modules
* @package oneforall
* @author WBCE Community
* @copyright 2004-2009, Ryan Djurovich
* @copyright 2009-2010, Website Baker Org. e.V.
* @copyright 2019-, WBCE Community
* @link https://www.wbce.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WBCE
*
*/
// Prevent this file from being accessed directly
if (defined('WB_PATH') == false) {
exit('Cannot access this file directly');
}
// Include path
$inc_path = dirname(__FILE__);
// Get module name
require_once($inc_path.'/info.php');
// Include WB functions
require_once(WB_PATH.'/framework/functions.php');
// No need to delete item access directory or files
// since all module pages have to be deleted manually before uninstall
// Delete module image directory
$directory = WB_PATH.MEDIA_DIRECTORY.'/'.$mod_name;
if (is_dir($directory)) {
rm_full_dir($directory);
}
// Drop module tables
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_fields`");
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_images`");
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_items`");
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_item_fields`");
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_page_settings`");
$database->query("DROP TABLE `".TABLE_PREFIX."mod_".$mod_name."_general_settings`");
?>