-
Notifications
You must be signed in to change notification settings - Fork 1
/
donbot_uninstaller.php
90 lines (77 loc) · 3.03 KB
/
donbot_uninstaller.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE HTML>
<html>
<head>
<title>Óäàëåíèå ìîäóëÿ DonBot</title>
<link rel="stylesheet" type="text/css" href="http://store.alaev.info/style.css" />
<style type="text/css">
#header {width: 100%; text-align: center;}
.box-cnt{width: 100%; overflow: hidden;}
</style>
</head>
<body>
<div class="wrap">
<div id="header">
<h1>DonBot</h1>
</div>
<div class="box">
<div class="box-t"> </div>
<div class="box-c">
<div class="box-cnt">
<?php
$output = module_uninstaller();
echo $output;
?>
</div>
</div>
<div class="box-b"> </div>
</div>
</div>
</body>
</html>
<?php
function module_uninstaller()
{
// Ñòàíäàðòíûé òåêñò
$output = '<h2>Äîáðî ïîæàëîâàòü â ñêðèïò äëÿ óäàëåíèÿ ìîäóëÿ DonBot!</h2>';
$output .= '<p><strong>Âíèìàíèå!</strong> Ïîñëå óäàëåíèÿ ìîäóëÿ <strong>îáÿçàòåëüíî</strong> óäàëèòå ôàéë <strong>donbot_uninstaller.php</strong> ñ Âàøåãî ñåðâåðà!</p>';
$output .= '<p>';
$output .= '<strong>Êðîìå òîãî, íåîáõîäèìî óäàëèòü ñëåäóþùèå ôàéëû è ïàïêè:</strong>';
$output .= '<ul>';
$output .= '<li>/engine/modules/<strong>donbot.php</strong></li>';
$output .= '<li>/engine/inc/<strong>donbot.php</strong></li>';
$output .= '<li>/engine/skins/images/<strong>donbot.png</strong></li>';
$output .= '<li>/engine/skins/<strong>donbot</strong>/</li>';
$output .= '</ul>';
$output .= '</p>';
// Åñëè ÷åðåç $_POST ïåðåäà¸òñÿ ïàðàìåòð donbot_uninstall, ïðîèçâîäèì èíñòàëëÿöèþ, ñîãëàñíî ïàðàìåòðàì
if(!empty($_POST['donbot_uninstall']))
{
// Ïîäêëþ÷àåì config
include_once ('engine/data/config.php');
// Ïîäêëþ÷àåì DLE API
include ('engine/api/api.class.php');
// Óäàëÿåì ìîäóëü èç àäìèíêè
$dle_api->uninstall_admin_module('donbot');
// Âûâîä
$output .= '<p>';
$output .= 'Ìîäóëü óñïåøíî óäàë¸í!';
$output .= '</p>';
}
// Åñëè ÷åðåç $_POST íè÷åãî íå ïåðåäà¸òñÿ, âûâîäèì ôîðìó äëÿ óäàëåíèÿ ìîäóëÿ
else
{
// Âûâîä
$output .= '<p>';
$output .= '<form method="POST" action="donbot_uninstaller.php">';
$output .= '<input type="hidden" name="donbot_uninstall" value="1" />';
$output .= '<input type="submit" value="Óäàëèòü ìîäóëü" />';
$output .= '</form>';
$output .= '</p>';
}
$output .= '<p>';
$output .= '<a href="http://alaev.info/blog/post/4481?from=DonBot">ðàçðàáîòêà è ïîääåðæêà ìîäóëÿ</a>';
$output .= '</p>';
// Ôóíêöèÿ âîçâðàùàåò òî, ÷òî äîëæíî áûòü âûâåäåíî
return $output;
}
?>