forked from hi5z/vkbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
247 lines (197 loc) · 9 KB
/
index.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
/////////////////////// ЗАЩИТА ВО ВСЕ ПОЛЯ! ////////////////////////////////////
include 'config.php';
$pass = md5($config['adminpass']);
if($_COOKIE["pass"]!==$pass){
sleep(1);
if(isset($_POST["pass"])){
setcookie("pass",md5($_POST["pass"]), time()+3600*24*14);
die('<meta http-equiv="refresh" content="1; url=./">');
}
?>
<html>
<head>
<title>Админ-панель</title>
<link rel="stylesheet" href="http://hash2vote.su/css/bootstrap.css">
<link rel="stylesheet" href="http://hash2vote.su/css/bootstrap-theme.css">
<link rel="stylesheet" href="http://hash2vote.su/css/admin.css">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://hash2vote.su/js/bootstrap.min.js"></script>
<script src="http://hash2vote.su/js/TweenLite.min.js"></script>
<script>
$(document).ready(function() {
$(document).mousemove(function(event) {
TweenLite.to($("body"),
.5, {
css: {
backgroundPosition: "" + parseInt(event.pageX / 8) + "px " + parseInt(event.pageY / '12') + "px, " + parseInt(event.pageX / '15') + "px " + parseInt(event.pageY / '15') + "px, " + parseInt(event.pageX / '30') + "px " + parseInt(event.pageY / '30') + "px",
"background-position": parseInt(event.pageX / 8) + "px " + parseInt(event.pageY / 12) + "px, " + parseInt(event.pageX / 15) + "px " + parseInt(event.pageY / 15) + "px, " + parseInt(event.pageX / 30) + "px " + parseInt(event.pageY / 30) + "px"
}
})
})
})
</script>
</head>
<body>
<div class="container">
<div class="row vertical-offset-100">
<div class="col-md-4 col-md-offset-4">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row-fluid user-row">
<img src="http://s11.postimg.org/7kzgji28v/logo_sm_2_mr_1.png" class="img-responsive" alt="Le mew wuz here"/>
</div>
</div>
<div class="panel-body">
<form method="POST" accept-charset="UTF-8" role="form" class="form-signin">
<fieldset>
<label class="panel-login">
<div class="login_result"></div>
</label>
<input class="form-control" placeholder="Введите пароль" id="password" name="pass" type="password">
<br><br>
<input class="btn btn-lg btn-success btn-block" type="submit" id="submit" value="Войти »">
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
exit();
}
//////////////////////// КОНЕЦ ЗАЩИТЫ ////////////////////////////////////////
require_once 'classes.php';
require_once 'config.php';
require 'vk.api.php';
define('VK_TOKEN',$config['token']);
$vk = new VK(VK_TOKEN);
$accountinfo = $vk->request('users.get', array(
'fields' => 'photo_max,online,counters'
));
$friendsget = $vk->request('friends.getRequests', array(
'out' => '0'
));
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Бот
- <?= $accountinfo['response'][0]['first_name'] ?> <?= $accountinfo['response'][0]['last_name'] ?></title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<script>
var interval = null;
function updateShouts() {
$('#shoutbox').load('autoupdate.php');
}
function updateNews() {
$('#news').load('autoupdatenews.php');
}
function updateFriends() {
$('#friendsadd').load('autofriends.php');
}
$(document).ready(function () {
$('#check').change(function(){
if ($('#check').is(':checked')) {
$('#status').text('Работает');
$('#isonline').text('Online*');
$('#preloader').show("slow");
$('#notrunned').hide("slow");
$('#shoutbox').load('autoupdate.php');
interval = setInterval("updateShouts()", 10000);
} else {
$('#status').text('Не работает');
clearInterval(interval);
}})
$('#reposts').change(function(){
if ($('#reposts').is(':checked')) {
$('#preloader2').show("slow");
$('#notrunned2').hide("slow");
$('#news').load('autoupdatenews.php');
interval = setInterval("updateNews()", 1800000);
} else {
clearInterval(interval);
}})
$('#friends').change(function(){
if ($('#friends').is(':checked')) {
$('#friendsadd').load('autofriends.php');
interval = setInterval("updateFriends()", 900000);
} else {
clearInterval(interval);
}})
});
</script>
<div class="container">
<div class="row">
<div class="col-lg-4">
<h3><?= $accountinfo['response'][0]['first_name'] ?> <?= $accountinfo['response'][0]['last_name'] ?></h3>
<img width="200px" src="<?= $accountinfo['response'][0]['photo_max'] ?>" class="img-thumbnail"/> <br />
<form method="get">
<b>Автоматический чат?</b> <input type="checkbox" id="check" name="check" /><br />
<b>Рандомные репосты?</b> <input type="checkbox" id="reposts" name="reposts" /><br />
<b>Автоподтверждение друзей?</b> <input type="checkbox" id="friends" name="friends" /><br />
</form>
Статус: <span id="isonline"><? if ($accountinfo['response'][0]['online'] == '1') {
echo '<font color="green">Online</font>';
} else {
echo '<font color="red">Offline</font>';
} ?></span><br/>
Друзей: <?= $accountinfo['response'][0]['counters']['friends'] ?><br/>
Друзей онлайн: <?= $accountinfo['response'][0]['counters']['online_friends'] ?><br/>
Подписчиков: <?= $accountinfo['response'][0]['counters']['followers'] ?><br/>
Авточат сейчас: <span id="status">Выключен</span><br />
<hr />
<h3>Заявки в друзья</h3>
<?
if ($friendsget['response'] != null) {
for ($i = 0; $i < count($friendsget['response']); $i++) {
$friendinfo = curl("https://api.vk.com/method/users.get?fields=photo_max&user_ids=" . $friendsget['response'][$i]);
?>
<div class="media">
<div class="media-left">
<a href="http://vk.com/id<?= $friendsget['response'][$i] ?>">
<img class="media-object" width="50px" src="<?= $friendinfo['response'][0]['photo_max'] ?>"
alt="<?= $friendinfo['response'][0]['first_name'] ?> <?= $friendinfo['response'][0]['last_name'] ?>">
</a>
</div>
<div class="media-body">
<h4 class="media-heading"><?= $friendinfo['response'][0]['first_name'] ?> <?= $friendinfo['response'][0]['last_name'] ?></h4>
</div>
</div>
<?
} } else { echo 'Заявок в друзья нет';}?>
</div>
<div class="col-lg-4" id="shoutbox">
<h3>История сообщений</h3>
<span id="notrunned">Для того, чтобы включить бота - воспользуйтесь кнопкой слева.</span>
<span id="preloader" style="display:none; text-align: center;"><img width="150px" src="/preloader.gif"/></span>
</div>
<div class="col-lg-4" id="news">
<h3>Лента</h3>
<span id="notrunned2">Для того, чтобы включить автоматический репостинг - воспользуйтесь кнопкой слева.</span>
<span id="preloader2" style="display:none; text-align: center;"><img width="150px" src="/preloader.gif"/></span>
</div>
</div>
<div class="row">
<div class="col-lg-4">
</div>
<div class="col-lg-4">
</div>
<div class="col-lg-4">
</div>
</div>
</div>
<div id="friendsadd" style="display:none;"> </div>
</body>
<footer>
<div class="col-md-12 text-center">vkbotphp v0.1.8.1</div>
</footer>
</html>