-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmy.php
More file actions
280 lines (251 loc) · 17.1 KB
/
Copy pathmy.php
File metadata and controls
280 lines (251 loc) · 17.1 KB
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?
/*
// +--------------------------------------------------------------------------+
// | 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");
dbconn(false);
loggedinorreturn();
stdhead($tracker_lang['my_my']);
if (isset($_GET["edited"])) {
print("<h1>".$tracker_lang['my_updated']."</h1>\n");
if (isset($_GET["mailsent"]))
print("<h2>".$tracker_lang['my_mail_sent']."</h2>\n");
} elseif (isset($_GET["emailch"]))
print("<h1>".$tracker_lang['my_mail_updated']."</h1>\n");
/*else
print("<h1>Добро пожаловать, <a href=userdetails.php?id=$CURUSER[id]>$CURUSER[username]</a>!</h1>\n");*/
?>
<table border="1" cellspacing="0" cellpadding="10" align="center">
<tr>
<td align="center" width="33%"><a href="logout.php"><b><?=$tracker_lang['logout'];?></b></a></td>
<td align="center" width="33%"><a href="mytorrents.php"><b><?=$tracker_lang['my_torrents'];?></b></a></td>
<td align="center" width="33%"><a href="friends.php"><b>Мои списки пользователей</b></a></td>
</tr>
<tr>
<td colspan="3">
<form method="post" action="takeprofedit.php">
<table border="1" cellspacing=0 cellpadding="5">
<?
/***********************
$res = sql_query("SELECT COUNT(*) FROM ratings WHERE user=" . $CURUSER["id"]);
$row = mysql_fetch_array($res);
tr("Ratings submitted", $row[0]);
$res = sql_query("SELECT COUNT(*) FROM comments WHERE user=" . $CURUSER["id"]);
$row = mysql_fetch_array($res);
tr("Written comments", $row[0]);
****************/
$themes = theme_selector($CURUSER["theme"]);
$countries = "<option value=0>---- ".$tracker_lang['my_unset']." ----</option>\n";
$ct_r = sql_query("SELECT id, name FROM countries ORDER BY name ASC") or sqlerr(__FILE__,__LINE__);
while ($ct_a = mysql_fetch_array($ct_r))
$countries .= "<option value=$ct_a[id]" . ($CURUSER["country"] == $ct_a['id'] ? " selected" : "") . ">$ct_a[name]</option>\n";
$dir = opendir('languages');
$lang = array();
while ( $file = readdir($dir) ) {
if (preg_match('#^lang_#i', $file) && !is_file($dir . '/' . $file) && !is_link($dir . '/' . $file)) {
$filename = trim(str_replace("lang_","", $file));
$displayname = preg_replace("/^(.*?)_(.*)$/", "\\1 [ \\2 ]", $filename);
$displayname = preg_replace("/\[(.*?)_(.*)\]/", "[ \\1 - \\2 ]", $displayname);
$lang[$displayname] = $filename;
}
}
closedir($dir);
@asort($lang);
@reset($lang);
$lang_select = '<select name="language">';
while ( list($displayname, $filename) = @each($lang) ) {
$selected = ((strtolower($CURUSER["language"]) == strtolower($filename) ) ? ' selected="selected"' : '');
$lang_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>';
}
$lang_select .= '</select>';
function format_tz($a)
{
$h = floor($a);
$m = ($a - floor($a)) * 60;
return ($a >= 0?"+":"-") . (strlen(abs($h)) > 1?"":"0") . abs($h) .
":" . ($m==0?"00":$m);
}
tr($tracker_lang['my_allow_pm_from'],
"<input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "yes" ? " checked" : "") . " value=\"yes\">Все (исключая блокированных)
<br /><input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "friends" ? " checked" : "") . " value=\"friends\">Только друзей
<br /><input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "no" ? " checked" : "") . " value=\"no\">Только администрации"
,1);
tr($tracker_lang['my_parked'],
"<input type=\"radio\" name=\"parked\"" . ($CURUSER["parked"] == "yes" ? " checked" : "") . " value=\"yes\">".$tracker_lang['yes']."
<input type=\"radio\" name=\"parked\"" . ($CURUSER["parked"] == "no" ? " checked" : "") . " value=\"no\">".$tracker_lang['no']."
<br /><font class=\"small_text\">".$tracker_lang['my_you_can_park'].".</font>"
,1);
tr($tracker_lang['my_delete_after_reply'], "<input type=checkbox name=deletepms" . ($CURUSER["deletepms"] == "yes" ? " checked" : "") . ">",1);
tr($tracker_lang['my_sentbox'], "<input type=checkbox name=savepms" . ($CURUSER["savepms"] == "yes" ? " checked" : "") . ">",1);
$r = genrelist();
//$categories = "Default browsing categories:<br />\n";
if (count($r) > 0)
{
$categories = "<table><tr>\n";
$i = 0;
foreach ($r as $a)
{
$categories .= ($i && $i % 2 == 0) ? "</tr><tr>" : "";
$categories .= "<td class=bottom style='padding-right: 5px'><input name=cat$a[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat$a[id]]") !== false ? " checked" : "") . " value='yes'> " . htmlspecialchars($a["name"]) . "</td>\n";
++$i;
}
$categories .= "</tr></table>\n";
}
tr($tracker_lang['my_email_notify'], "<input type=checkbox name=pmnotif" . (strpos($CURUSER['notifs'], "[pm]") !== false ? " checked" : "") . " value=yes> Уведомить меня при получении ЛС<br />\n" .
"<input type=checkbox name=emailnotif" . (strpos($CURUSER['notifs'], "[email]") !== false ? " checked" : "") . " value=yes> Уведомить меня при размещении торрента в одной <br /> из следующих предпочитаемых категорий.\n"
, 1);
tr($tracker_lang['my_default_browse'],$categories,1);
tr($tracker_lang['my_style'], "$themes",1);
tr($tracker_lang['my_country'], "<select name=country>\n$countries\n</select>",1);
tr($tracker_lang['my_language'], $lang_select ,1);
tr($tracker_lang['my_avatar_url'], "<input name=avatar size=50 value=\"" . htmlspecialchars($CURUSER["avatar"]) .
"\"><br />\n".sprintf($tracker_lang['max_avatar_size'], $avatar_max_width, $avatar_max_height),1);
tr($tracker_lang['my_gender'],
"<input type=radio name=gender" . ($CURUSER["gender"] == "1" ? " checked" : "") . " value=1>".$tracker_lang['my_gender_male']."
<input type=radio name=gender" . ($CURUSER["gender"] == "2" ? " checked" : "") . " value=2>".$tracker_lang['my_gender_female']
,1);
///////////////// BIRTHDAY MOD /////////////////////
$birthday = $CURUSER['birthday'];
$birthday = date('Y-m-d', strtotime($birthday));
list($year1, $month1, $day1) = explode('-', $birthday);
if ($CURUSER['birthday'] == '0000-00-00') {
$year .= "<select name=year><option value=\"0000\">".$tracker_lang['my_year']."</option>\n";
$i = "1920";
while($i <= (date('Y',time())-13)) {
$year .= "<option value=" .$i. ">".$i."</option>\n";
$i++;
}
$year .= "</select>\n";
$birthmonths = array(
"01" => $tracker_lang['my_months_january'],
"02" => $tracker_lang['my_months_february'],
"03" => $tracker_lang['my_months_march'],
"04" => $tracker_lang['my_months_april'],
"05" => $tracker_lang['my_months_may'],
"06" => $tracker_lang['my_months_june'],
"07" => $tracker_lang['my_months_jule'],
"08" => $tracker_lang['my_months_august'],
"09" => $tracker_lang['my_months_september'],
"10" => $tracker_lang['my_months_october'],
"11" => $tracker_lang['my_months_november'],
"12" => $tracker_lang['my_months_december'],
);
$month = "<select name=\"month\"><option value=\"00\">".$tracker_lang['my_month']."</option>\n";
foreach ($birthmonths as $month_no => $show_month)
{
$month .= "<option value=$month_no>$show_month</option>\n";
}
$month .= "</select>\n";
$day .= "<select name=day><option value=\"00\">".$tracker_lang['my_day']."</option>\n";
$i = 1;
while ($i <= 31) {
if($i < 10) {
$day .= "<option value=0".$i. ">0".$i."</option>\n";
} else {
$day .= "<option value=".$i.">".$i."</option>\n";
}
$i++;
}
$day .="</select>\n";
tr($tracker_lang['my_birthdate'], $year . $month . $day ,1);
}
if ($CURUSER['birthday'] != "0000-00-00") {
tr($tracker_lang['my_birthdate'],"<b><input type=hidden name=year value=$year1>$year1<input type=hidden name=month value=$month1>.$month1<input type=hidden name=day value=$day1>.$day1</b>",1);
}
///////////////// BIRTHDAY MOD /////////////////////
print("<tr><td class=\"tablecat\" colspan=\"2\" align=left><b>".$tracker_lang['my_contact']."</b></td></tr>\n");
tr(" ", " <table cellspacing=\"3\" cellpadding=\"0\" width=\"100%\" border=\"0\">
<tr>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\" colspan=2>
".$tracker_lang['my_contact_descr']."</td>
</tr>
<tr>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_icq']."<br />
<img alt src=pic/contact/icq.gif width=\"17\" height=\"17\">
<input maxLength=\"30\" size=\"25\" name=\"icq\" value=\"" . $CURUSER["icq"] . "\" ></td>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_aim']."<br />
<img alt src=pic/contact/aim.gif width=\"17\" height=\"17\">
<input maxLength=\"30\" size=\"25\" name=\"aim\" value=\"" . $CURUSER["aim"] . "\" ></td>
</tr>
<tr>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_msn']."<br />
<img alt src=pic/contact/msn.gif width=\"17\" height=\"17\">
<input maxLength=\"50\" size=\"25\" name=\"msn\" value=\"" . $CURUSER["msn"] . "\" ></td>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_yahoo']."<br />
<img alt src=pic/contact/yahoo.gif width=\"17\" height=\"17\">
<input maxLength=\"30\" size=\"25\" name=\"yahoo\" value=\"" . $CURUSER["yahoo"] . "\" ></td>
</tr>
<tr>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_skype']."<br />
<img alt src=pic/contact/skype.gif width=\"17\" height=\"17\">
<input maxLength=\"32\" size=\"25\" name=\"skype\" value=\"" . $CURUSER["skype"] . "\" ></td>
<td style=\"font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif\">
".$tracker_lang['my_contact_mirc']."<br />
<img alt src=pic/contact/mirc.gif width=\"17\" height=\"17\">
<input maxLength=\"30\" size=\"25\" name=\"mirc\" value=\"" . $CURUSER["mirc"] . "\" ></td>
</tr>
</table>",1);
tr($tracker_lang['my_website'], "<input type=\"text\" name=\"website\" size=50 value=\"" . htmlspecialchars($CURUSER["website"]) . "\" /> ", 1);
tr($tracker_lang['my_torrents_per_page'], "<input type=text size=10 name=torrentsperpage value=$CURUSER[torrentsperpage]> (0 = установки по умолчанию)",1);
tr($tracker_lang['my_topics_per_page'], "<input type=text size=10 name=topicsperpage value=$CURUSER[topicsperpage]> (0 = установки по умолчанию)",1);
tr($tracker_lang['my_messages_per_page'], "<input type=text size=10 name=postsperpage value=$CURUSER[postsperpage]> (0 = установки по умолчанию)",1);
tr($tracker_lang['my_show_avatars'], "<input type=checkbox name=avatars" . ($CURUSER["avatars"] == "yes" ? " checked" : "") . "> (Пользователи с маленькими каналами могут отключить эту опцию)",1);
tr($tracker_lang['my_info'], "<textarea name=info cols=50 rows=4>" . $CURUSER["info"] . "</textarea><br />Показывается на вашей публичной странице. Может содержать <a href=tags.php target=_new>BB коды</a>.", 1);
tr($tracker_lang['my_userbar'], "<img src=\"torrentbar/bar.php/".$CURUSER["id"].".png\" border=\"0\"><br />".$tracker_lang['my_userbar_descr'].":<br /><input type=\"text\" size=65 value=\"[url=$DEFAULTBASEURL][img]$DEFAULTBASEURL/torrentbar/bar.php/".$CURUSER["id"].".png[/img][/url]\" readonly />",1);
tr($tracker_lang['my_mail'], "<input type=\"text\" name=\"email\" size=50 value=\"" . htmlspecialchars($CURUSER["email"]) . "\" />", 1);
print("<tr><td colspan=\"2\" align=left><b>Примечание:</b> Если вы смените ваш Email адрес, то вам придет запрос о подтверждении на ваш новый Email-адрес. Если вы не подтвердите письмо, то Email адрес не будет изменен.</td></tr>\n");
tr("Сменить пасскей","<input type=checkbox name=resetpasskey value=1 /> (Вы должны перекачать все активные торренты после смены пасскея)", 1);
if (strlen($CURUSER['passkey']) != 32) {
$CURUSER['passkey'] = md5($CURUSER['username'].get_date_time().$CURUSER['passhash']);
sql_query("UPDATE users SET passkey='$CURUSER[passkey]' WHERE id=$CURUSER[id]");
}
tr("Мой пасскей","<b>$CURUSER[passkey]</b>", 1);
tr("Привязать IP к пасскею", "<input type=checkbox name=passkey_ip" . ($CURUSER["passkey_ip"] != "" ? " checked" : "") . "> Включив эту опцию вы можете защитить себя от неавторизованной закакачки по вашему пасскею привязав его к IP. Если ваш IP динамический - не включайте эту опцию.<br />На данный момент ваш IP: <b>".getip()."</b>", 1);
tr("Старый пароль", "<input type=\"password\" name=\"oldpassword\" size=\"50\" />", 1);
tr("Сменить пароль", "<input type=\"password\" name=\"chpassword\" size=\"50\" />", 1);
tr("Пароль еще раз", "<input type=\"password\" name=\"passagain\" size=\"50\" />", 1);
function priv($name, $descr) {
global $CURUSER;
if ($CURUSER["privacy"] == $name)
return "<input type=\"radio\" name=\"privacy\" value=\"$name\" checked=\"checked\" /> $descr";
return "<input type=\"radio\" name=\"privacy\" value=\"$name\" /> $descr";
}
/* tr("Privacy level", priv("normal", "Normal") . " " . priv("low", "Low (email address will be shown)") . " " . priv("strong", "Strong (no info will be made available)"), 1); */
?>
<tr><td colspan="2" align="center"><input type="submit" value="Обновить профиль" style='height: 25px'> <input type="reset" value="Сбросить изменения" style='height: 25px'></td></tr>
</table>
</form>
</td>
</tr>
</table>
<?
print("<p><a href=users.php><b>Найти пользователя/Список пользователей</b></a></p>");
stdfoot();
?>