forked from sicalpath/tjupt
-
Notifications
You must be signed in to change notification settings - Fork 2
/
app_renamelog.php
143 lines (130 loc) · 5.2 KB
/
app_renamelog.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
<?php
require_once('include/bittorrent.php');
dbconn();
loggedinorreturn();
parked();
global $CURUSER;
$lang_app_renamelog = array(
'std_error' => "这谁家熊孩子啊",
'std_invalid_action' => '别到处乱跑了,回家吃饭去吧!',
'text_no_permission' => "<b>错误!</b>你没有该权限。",
'head_karma_page' => "北洋园用户改名历史",
'text_karma_system' => " <b>园道•轮回天生</b> 使用记录",
'text_no_log' => "还没有人用过哦~<br/><br/><a href='mybonus.php'>返回</a>",
'return_to_bonus_system' => "<a class='faqlink' href='mybonus.php'>返回魔力值系统</a>"
);
function print_logstable($res, $action, $sort)
{
print ('<table class="main" border="0" cellspacing="0" cellpadding="0">');
print ('<tr>');
$mytd = '<td class="colhead" align="center"><a href="' . htmlspecialchars("app_renamelog.php?action=" . $action . "&sort=" . ($sort == "useridasc" ? "useriddesc" : "useridasc")) . '">用户ID</a></td>';
$mytd .= '<td class="colhead" align="center">当前用户名</td>';
$mytd .= '<td class="colhead" align="center"><a href="' . htmlspecialchars("app_renamelog.php?action=" . $action . "&sort=" . ($sort == "timerenameasc" ? "timerenamedesc" : "timerenameasc")) . '">轮回时间</a></td>';
$mytd .= '<td class="colhead" align="center"><a href="' . htmlspecialchars("app_renamelog.php?action=" . $action . "&sort=" . ($sort == "oldnameasc" ? "oldnamedesc" : "oldnameasc")) . '">轮回前用户名</a></td>';
$mytd .= '<td class="colhead" align="center"><a href="' . htmlspecialchars("app_renamelog.php?action=" . $action . "&sort=" . ($sort == "newnameasc" ? "newnamedesc" : "newnameasc")) . '">轮回后用户名</a></td>';
$mytd .= '<td class="colhead" align="center">花费魔力值</td>';
print ($mytd);
print ('<tr/>');
while ($row = mysql_fetch_assoc($res)) {
print ('<tr>');
print ('<td class="rowfollow" align="center" >' . $row ["userid"] . '</td>');
print ('<td class="rowfollow" align="center" >' . get_username($row ["userid"]) . '</td>');
print ('<td class="rowfollow" align="center" >' . $row ["timerename"] . '</td>');
print ('<td class="rowfollow" align="center" >' . $row ["oldname"] . '</td>');
print ('<td class="rowfollow" align="center" >' . $row ["newname"] . '</td>');
print ('<td class="rowfollow" align="center" >' . $row ["paybonus"] . '</td>');
print ('</tr>');
}
print ('</table><br/>');
}
$action = htmlspecialchars($_GET ['action']);
$allowed_actions = array(
"renamelog"
);
if (!$action) {
$action = 'renamelog';
}
if (!in_array($action, $allowed_actions)) {
stderr($lang_app_renamelog ['std_error'], $lang_app_renamelog ['std_invalid_action']);
}
if ($_GET ["sort"]) {
switch ($_GET ["sort"]) {
case 'useridasc' :
{
$orderby = "userid ASC";
break;
}
case 'useriddesc' :
{
$orderby = "userid DESC";
break;
}
case 'oldnameasc' :
{
$orderby = "oldname ASC";
break;
}
case 'oldnamedesc' :
{
$orderby = "oldname DESC";
break;
}
case 'newnameasc' :
{
$orderby = "newname ASC";
break;
}
case 'newnamedesc' :
{
$orderby = "newname DESC";
break;
}
case 'timerenameasc' :
{
$orderby = "timerename ASC";
break;
}
case 'timerenamedesc' :
{
$orderby = "timerename DESC";
break;
}
default :
{
$orderby = "id DESC";
}
}
} else {
$orderby = "id DESC";
}
stdhead($lang_app_renamelog ['head_karma_page']);
if ($action == "renamelog") {
$sql = 'SELECT COUNT(*) FROM app_rename';
$res = sql_query($sql) or die (mysql_error());
$count = 0;
while ($row = mysql_fetch_array($res))
$count += $row [0];
if ($CURUSER ["torrentsperpage"]) {
$logsperpage = ( int )$CURUSER ["torrentsperpage"];
// } elseif ($logsperpage_main) {
// $logsperpage = $logsperpage_main;
} else {
$logsperpage = 50;
}
$addparam = "action=renamelog&";
if ($count) {
list ($pagertop, $pagerbottom, $limit) = pager($logsperpage, $count, "?" . $addparam);
$query = "SELECT id, userid, oldname, newname, timerename, paybonus FROM app_rename ORDER BY " . $orderby . " " . $limit;
$res = sql_query($query) or die (mysql_error());
print ('<h1 align="center">' . $lang_app_renamelog ["text_karma_system"] . '</h1><br/>');
print_logstable($res, $action, $_GET ["sort"]);
print ($pagerbottom);
print ('<br/><h1 align="center">' . $lang_app_renamelog ["return_to_bonus_system"] . '</h1>');
} else {
unset ($res);
print ('<h1 align="center">' . $lang_app_renamelog ["text_no_log"] . '</h1>');
}
} else {
stderr($lang_app_renamelog ['std_error'], $lang_app_renamelog ['std_invalid_action']);
}
stdfoot();