-
Notifications
You must be signed in to change notification settings - Fork 29
/
edit.php
124 lines (110 loc) · 9.12 KB
/
edit.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
<?
/*
// +--------------------------------------------------------------------------+
// | Project: TBDevYSE - TBDev Yuna Scatari Edition |
// +--------------------------------------------------------------------------+
// | This file is part of TBDevYSE. TBDevYSE is based on TBDev, |
// | originally by RedBeard of TorrentBits, extensively modified by |
// | Gartenzwerg. |
// | |
// | TBDevYSE is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | TBDevYSE is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with TBDevYSE; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require_once("include/bittorrent.php");
if (!mkglobal("id"))
die();
$id = intval($id);
if (!$id)
die();
dbconn();
loggedinorreturn();
$res = sql_query("SELECT * FROM torrents WHERE id = $id");
$row = mysql_fetch_array($res);
if (!$row)
die();
stdhead("Ðåäàêòèðîâàíèå òîððåíòà \"" . $row["name"] . "\"");
if (!isset($CURUSER) || ($CURUSER["id"] != $row["owner"] && get_user_class() < UC_MODERATOR)) {
stdmsg($tracker_lang['error'],"Âû íå ìîæåòå ðåäàêòèðîâàòü ýòîò òîððåíò.");
} else {
print("<form name=\"edit\" method=post action=takeedit.php enctype=multipart/form-data>\n");
print("<input type=\"hidden\" name=\"id\" value=\"$id\">\n");
if (isset($_GET["returnto"]))
print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars_uni($_GET["returnto"]) . "\" />\n");
print("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
print("<tr><td class=\"colhead\" colspan=\"2\">Ðåäàêòèðîâàòü òîððåíò</td></tr>");
if ($row['multitracker'] == 'no')
tr($tracker_lang['torrent_file'], "<input type=file name=tfile size=80>\n", 1); // disable torrent update for multitracked ones
tr($tracker_lang['torrent_name'], "<input type=\"text\" name=\"name\" value=\"" . $row["name"] . "\" size=\"80\" />", 1);
tr($tracker_lang['img_poster'], "<input type=radio name=img1action value='keep' checked>Îñòàâèòü ïîñòåð  "."<input type=radio name=img1action value='delete'>Óäàëèòü ïîñòåð  "."<input type=radio name=img1action value='update'>Îáíîâèòü ïîñòåð<br /><b>Ïîñòåð:</b>  <input type=file name=image0 size=80>", 1);
tr($tracker_lang['images'],
"<input type=radio name=img2action value='keep' checked>Îñòàâèòü ñêðèíøîò ¹1  "."<input type=radio name=img2action value='delete'>Óäàëèòü ñêðèíøîò ¹1  "."<input type=radio name=img2action value='update'>Îáíîâèòü ñêðèíøîò ¹1<br /><b>Êàðòèíêà ¹2:</b>  <input type=file name=image1 size=80><br /><br />".
"<input type=radio name=img3action value='keep' checked>Îñòàâèòü ñêðèíøîò ¹2  "."<input type=radio name=img3action value='delete'>Óäàëèòü ñêðèíøîò ¹2  "."<input type=radio name=img3action value='update'>Îáíîâèòü ñêðèíøîò ¹2<br /><b>Êàðòèíêà ¹3:</b>  <input type=file name=image2 size=80><br /><br />".
"<input type=radio name=img4action value='keep' checked>Îñòàâèòü ñêðèíøîò ¹3  "."<input type=radio name=img4action value='delete'>Óäàëèòü ñêðèíøîò ¹3  "."<input type=radio name=img4action value='update'>Îáíîâèòü ñêðèíøîò ¹3<br /><b>Êàðòèíêà ¹4:</b>  <input type=file name=image3 size=80><br /><br />".
"<input type=radio name=img5action value='keep' checked>Îñòàâèòü ñêðèíøîò ¹4  "."<input type=radio name=img5action value='delete'>Óäàëèòü ñêðèíøîò ¹4  "."<input type=radio name=img5action value='update'>Îáíîâèòü ñêðèíøîò ¹4<br /><b>Êàðòèíêà ¹5:</b>  <input type=file name=image4 size=80>", 1);
if ((strpos($row["ori_descr"], "<") === false) || (strpos($row["ori_descr"], "<") !== false))
$c = "";
else
$c = " checked";
//tr("Îïèñàíèå", "<textarea name=\"descr\" rows=\"10\" cols=\"80\">" . htmlspecialchars_uni($row["ori_descr"]) . "</textarea><br />(HTML <b>íå</b> ðàçðåøåí. Íàæìèòå <a href=tags.php>ñþäà</a> äëÿ ïîëó÷åíèÿ èíôîðìàöèè î òåãàõ.)", 1);
print("<tr><td class=rowhead style='padding: 3px'>".$tracker_lang['description']."</td><td>");
textbbcode("edit","descr",htmlspecialchars_uni($row["ori_descr"]));
print("</td></tr>\n");
$s = "<select name=\"type\">\n";
$cats = genrelist();
foreach ($cats as $subrow) {
$s .= "<option value=\"" . $subrow["id"] . "\"";
if ($subrow["id"] == $row["category"])
$s .= " selected=\"selected\"";
$s .= ">" . htmlspecialchars_uni($subrow["name"]) . "</option>\n";
}
$s .= "</select>\n";
tr("Òèï", $s, 1);
tr("Âèäèìûé", "<input type=\"checkbox\" name=\"visible\"" . (($row["visible"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" />
Âèäèìûé â òîððåíòàõ<br /><table border=0 cellspacing=0 cellpadding=0 width=420><tr><td class=embedded>Îáðàòèòå âíèìàíèå, ÷òî òîððåíò àâòîìàòè÷åñêè ñòàíåò âèäèìûì êîãäà ïîÿâèòüñÿ ðàçäàþùèé è àâòîìàòè÷åñêè ïåðåñòàíåò áûòü âèäèìûì (ñòàíåò ìåðòâÿêîì) êîãäà íå áóäåò ðàçäàþùåãî íåêîòîðîå âðåìÿ.
Èñïîëüçóéòå ýòîò ïåðåêëþ÷àòåëü äëÿ óñêîðåíèÿ ïðîöåñà. Òàêæå ó÷òèòå ÷òî íåâèäèìûå òîððåíòû (ìåðòâÿêè) âñå-ðàâíî ìîãóò áûòü ïðîñìîòðåíû è íàéäåíû, ýòî ïðîñòî íå ïî-óìîë÷àíèþ.</td></tr></table>", 1);
if(get_user_class() >= UC_ADMINISTRATOR)
tr("Çàáàíåí", "<input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" />", 1);
if(get_user_class() >= UC_ADMINISTRATOR)
tr("Òèï ðàçäà÷è",
"<input type=\"radio\" name=\"free\" id=\"gold\" value=\"yes\"" . (($row["free"] == "yes") ? " checked" : "") . " /><label for=\"gold\">Çîëîòàÿ ðàçäà÷à (ñ÷èòàåòüñÿ òîëüêî ðàçäà÷à, ñêà÷êà íå ó÷èòèâàåòüñÿ)</label><br />".
"<input type=\"radio\" name=\"free\" id=\"silver\" value=\"silver\"" . (($row["free"] == "silver") ? " checked" : "") . " /><label for=\"silver\">Ñåðåáðÿíàÿ ðàçäà÷à (ñêà÷êà íå ó÷èòèâàåòüñÿ òîëüêî íà 50%)</label><br />".
"<input type=\"radio\" name=\"free\" id=\"no\" value=\"no\"" . (($row["free"] == "no") ? " checked" : "") . " /><label for=\"no\">Îáû÷íàÿ ðàçäà÷à (ñêà÷êà è ðàçäà÷à ó÷èòèâàåòüñÿ êàê îáû÷íî)</label><br />"
, 1);
if(get_user_class() >= UC_ADMINISTRATOR)
tr("Âàæíûé", "<input type=\"checkbox\" name=\"not_sticky\"" . (($row["not_sticky"] == "no") ? " checked=\"checked\"" : "" ) . " value=\"yes\" /> Ïðèêðåïèòü ýòîò òîððåíò (âñåãäà íàâåðõó)", 1);
print("<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Îòðåäàêòèðîâàòü\" style=\"height: 25px; width: 100px\"> <input type=reset value=\"Îáðàòèòü èçìåíåíèÿ\" style=\"height: 25px; width: 100px\"></td></tr>\n");
print("</table>\n");
print("</form>\n");
print("<p>\n");
print("<form method=\"post\" action=\"delete.php\">\n");
print("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
print("<tr><td class=embedded style='background-color: #F5F4EA;padding-bottom: 5px' colspan=\"2\"><b>Óäàëèòü òîððåíò</b> Ïðè÷èíà:</td></tr>");
print("<td><input name=\"reasontype\" type=\"radio\" value=\"1\"> Ìåðòâÿê </td><td> 0 ðàçäàþùèõ, 0 êà÷àþùèõ = 0 ñîåäèíåíèé</td></tr>\n");
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\"> Äóïëèêàò</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\"> Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\"> Ïðàâèëà</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(Îáÿçàòåëüíî)</td></tr>");
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"5\" checked> Äðóãîå:</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(Îáÿçàòåëüíî)</td></tr>\n");
print("<input type=\"hidden\" name=\"id\" value=\"$id\">\n");
if (isset($_GET["returnto"]))
print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars_uni($_GET["returnto"]) . "\" />\n");
print("<td colspan=\"2\" align=\"center\"><input type=submit value='Óäàëèòü' style='height: 25px'></td></tr>\n");
print("</table>");
print("</form>\n");
print("</p>\n");
}
stdfoot();
?>