-
Notifications
You must be signed in to change notification settings - Fork 2
/
kp.php
102 lines (88 loc) · 3.14 KB
/
kp.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
<?php
// KP page indicator for includes
define("KPPAGE", true);
$head_time_start = microtime(true);
require_once "lib/lib.php";
require_once "lib/sorts.php";
connect();
Login();
$user = $_SESSION["user"];
$userId = $user['id'];
$login = $user['login'] ? $user['login'] : $user['vkid'];
if (array_key_exists('method', $_POST))
switch ($_POST['method']) {
case "setSettings":
setSettings($user,
array("kpID"=>(int)$_POST['kpID'],
"onlyNewTor"=>(int)!empty($_POST['onlyNewTor']),
"quality"=>(int)!empty($_POST['quality']),
"translateQuality"=>(int)$_POST['translateQuality'],
"sortType" => (int)$_POST['sortType'],
)
);
//Login();
break;
default:
break;
}
$movies = array();
$movieKPIdList = getKinopoiskMoviesList($user['kpID']);
$sqlIn = "";
if (!empty($movieKPIdList))
foreach($movieKPIdList as $id)
$sqlIn .= $id . ",";
$sqlIn .= "-1";
$q = "SELECT * FROM `movies` WHERE `movies`.kpid in ( " . $sqlIn . " ) AND `movies`.id in (SELECT movieId FROM links)";
$sqlresult = mysqli_query($GLOBALS['mysqli'], $q);
$user["sqlIn"] = "";
while ($row = mysqli_fetch_assoc($sqlresult)) {
$user["sqlIn"] .= $row['id'] . ",";
$movies[(int)$row['id']] = $row;
}
$user["sqlIn"] .= "-1";
if ($login == 'wise guest' || $login == 'guest') {
$userId = -1;
$login = false;
}
$keys = sortBySeedLeech($movies, $user);
?>
<!DOCTYPE html>
<html lang="en">
<?php
include "html/head.php";
?>
<body>
<?php
include "html/userSettings.php";
?>
<?php
// Head tabs
// this requires global $liactive pointing at active tab
$liactive = "kp";
include "html/navbar.php";
?>
<div id='main' class="container-fluid">
<?php if (!$user['kpID']) { ?>
<p>
укажите в фильтре Kinopoisk ID для импорта списка Ваших фильмов из <?=KINOPOISKROOT?>/user/{ВАШ_KINOPOISK_ID}/movies/
</p>
<p style="font-size: 14px">
импортируются максимум 200 фильмов <br/>
убедитесь, что Ваши списки "публичные" - не скрыты настройками приватности
</p>
<?php } else if (empty($keys)) { ?>
<p>
Ваших фильмов нет (либо они непопулярны) на торрентах
</p>
<?php } ?>
<?php
// Divs with movies' posters
// this requires global $keys
include "html/movieDivs.php";
?>
</div>
<?php
include "html/footer.php";
?>
</body>
</html>