-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfreeleech.php
71 lines (67 loc) · 3.21 KB
/
freeleech.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
<?php
require "include/bittorrent.php";
dbconn();
if (php_sapi_name() == 'cli') {
if (isset($argv[1])) {
$action = $argv[1];
}
else {
echo 'No action!', "\n";
die;
}
$name = 'sysop';
}
else {
loggedinorreturn();
checkPrivilegePanel();
$action = (isset($_POST['status']) ? $_POST['status'] : 'main');
$name = $CURUSER['username'];
}
if ($action != 'main') {
write_log('Global sp state set to ' . $action . ' by ' . $name , 'mod');
}
if ($action == 'Free') {
sql_query("UPDATE torrents_state SET global_sp_state = 2");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set free..');
}
elseif ($action == '2XUP') {
sql_query("UPDATE torrents_state SET global_sp_state = 3");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set 2x up..');
}
elseif ($action == '2XFree') {
sql_query("UPDATE torrents_state SET global_sp_state = 4");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set 2x up and free..');
}
elseif ($action == '50%Down') {
sql_query("UPDATE torrents_state SET global_sp_state = 5");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set half down..');
}
elseif ($action == '2XUp&50%Down') {
sql_query("UPDATE torrents_state SET global_sp_state = 6");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set half down..');
}
elseif ($action == 'Normal') {
sql_query("UPDATE torrents_state SET global_sp_state = 1");
$Cache->delete_value('global_promotion_state');
stderr('Success','All torrents have been set normal..');
}
elseif ($action == 'main') {
//stderr('Select action','Click <a class=altlink href=freeleech.php?action=setallfree>here</a> to set all torrents free.. <br /> Click <a class=altlink href=freeleech.php?action=setall2up>here</a> to set all torrents 2x up..<br /> Click <a class=altlink href=freeleech.php?action=setall2up_free>here</a> to set all torrents 2x up and free.. <br />Click <a class=altlink href=freeleech.php?action=setallhalf_down>here</a> to set all torrents half down..<br />Click <a class=altlink href=freeleech.php?action=setall2up_half_down>here</a> to set all torrents 2x up and half down..<br />Click <a class=altlink href=freeleech.php?action=setallnormal>here</a> to set all torrents normal..', false);
stdhead();
?>
<div class="minor-list-vertical center"><ul>
<li><form method="post" ><input type="hidden" value="Free" name="status" /><input type="submit" value="Free" /></form></li>
<li><form method="post" ><input type="hidden" value="2XUP" name="status" /><input type="submit" value="2x Up" /></form></li>
<li><form method="post" ><input type="hidden" value="2XFree" name="status"/><input type="submit" value="2x & Free" /></form></li>
<li><form method="post" ><input type="hidden" value="50%Down" name="status" /><input type="submit" value="50%" /></form></li>
<li><form method="post" ><input type="hidden" value="2XUp&50%Down" name="status"/><input type="submit" value="2x & 50%" /></form></li>
<li><form method="post" ><input type="hidden" value="Normal" name="status"/><input type="submit" value="Normal" /></form></li>
</ul></div>
<?php
stdfoot();
}