sync: 2022-12-07 14:03:38 +0000

This commit is contained in:
mosasauroidea-bot
2022-12-07 14:03:38 +00:00
parent 5a0b5e7fb4
commit 22feecb017
59 changed files with 2366 additions and 2151 deletions

BIN
.bin/geoip2-csv-converter Executable file

Binary file not shown.

View File

@@ -200,7 +200,7 @@ class LoginWatch extends Base {
(ip.FromIP IS NOT NULL) AS banned
FROM login_attempts w
LEFT JOIN users_main um ON (um.ID = w.UserID)
LEFT JOIN ip_bans ip ON (ip.FromIP = inet_aton(w.IP))
LEFT JOIN ip_bans ip ON (ip.FromIP = inet6_aton(w.IP))
WHERE (w.BannedUntil > now() OR w.LastAttempt > now() - INTERVAL 6 HOUR)
ORDER BY $orderBy $orderWay
");
@@ -219,9 +219,9 @@ class LoginWatch extends Base {
$reason = trim($reason);
$n = 0;
foreach ($list as $id) {
$ipv4 = $this->db->scalar(
$ip = $this->db->scalar(
"
SELECT inet_aton(IP) FROM login_attempts WHERE ID = ?
SELECT inet6_aton(IP) FROM login_attempts WHERE ID = ?
",
$id
);
@@ -233,8 +233,8 @@ class LoginWatch extends Base {
",
$userId,
$reason,
$ipv4,
$ipv4
$ip,
$ip
);
$n += $this->db->affected_rows();
}

View File

@@ -2,55 +2,9 @@
namespace Gazelle\Manager;
class IPv4 extends \Gazelle\Base {
class IP extends \Gazelle\Base {
const CACHE_KEY = 'ipv4_bans_';
/**
* Returns the unsigned 32bit form of an IPv4 address
*
* @param string $ipv4 The IP address x.x.x.x
* @return string the long it represents.
*/
public function ip2ulong(string $ipv4) {
return sprintf('%u', ip2long($ipv4));
}
/**
* Returns true if given IP is banned.
* TODO: This looks really braindead. Why not compare the 32bit address
* directly BETWEEN FromIP AND ToIP? Apart from dubious merits of
* caching?
*
* @param string $IP
* @return bool True if banned
*/
public function isBanned(string $IP) {
$A = substr($IP, 0, strcspn($IP, '.'));
$key = self::CACHE_KEY . $A;
$IPBans = $this->cache->get_value($key);
if (!is_array($IPBans)) {
$this->db->prepared_query(
"
SELECT FromIP, ToIP, ID
FROM ip_bans
WHERE FromIP BETWEEN ? << 24 AND (? << 24) - 1
",
$A,
$A + 1
);
$IPBans = $this->db->to_array(0, MYSQLI_NUM);
$this->cache->cache_value($key, $IPBans, 0);
}
$IPNum = $this->ip2ulong($IP);
foreach ($IPBans as $IPBan) {
list($FromIP, $ToIP) = $IPBan;
if ($IPNum >= $FromIP && $IPNum <= $ToIP) {
return true;
}
}
return false;
}
const CACHE_KEY = 'ip_bans_';
/**
* Create an ip address ban over a range of addresses. Will append
@@ -61,16 +15,14 @@ class IPv4 extends \Gazelle\Base {
* @param string $to The last adddress in the range (may equal $from)
* @param string $reason Why ban?
*/
public function createBan(int $userId, $ipv4From, string $ipv4To, string $reason) {
$from = $this->ip2ulong($ipv4From);
$to = $this->ip2ulong($ipv4To);
public function createBan(int $userId, $ipFrom, string $ipTo, string $reason) {
$current = $this->db->scalar(
'
SELECT Reason
FROM ip_bans
WHERE ? BETWEEN FromIP AND ToIP
WHERE INET6_ATON(?) BETWEEN FromIP AND ToIP
',
$from
$ipFrom
);
if ($current) {
@@ -81,13 +33,13 @@ class IPv4 extends \Gazelle\Base {
Reason = concat(?, ' AND ', Reason),
user_id = ?,
created = now()
WHERE FromIP = ?
AND ToIP = ?
WHERE FromIP = INET6_ATON(?)
AND ToIP = INET6_ATON(?)
",
$reason,
$userId,
$from,
$to
$ipFrom,
$ipTo
);
}
} else { // Not yet banned
@@ -95,15 +47,15 @@ class IPv4 extends \Gazelle\Base {
"
INSERT INTO ip_bans
(Reason, FromIP, ToIP, user_id)
VALUES (?, ?, ?, ?)
VALUES (?, ?, INET6_ATON(?), INET6_ATON(?))
",
$reason,
$from,
$to,
$ipFrom,
$ipTo,
$userId
);
$this->cache->delete_value(
self::CACHE_KEY . substr($ipv4From, 0, strcspn($ipv4From, '.'))
self::CACHE_KEY . substr($ipFrom, 0, strcspn($ipFrom, '.'))
);
}
}
@@ -116,7 +68,7 @@ class IPv4 extends \Gazelle\Base {
public function removeBan(int $id) {
$fromClassA = $this->db->scalar(
"
SELECT FromIP >> 24 FROM ip_bans WHERE ID = ?
SELECT INET6_NTOA(FromIP) FROM ip_bans WHERE ID = ?
",
$id
);

View File

@@ -32,10 +32,10 @@ class DonationsView {
<div class="SidebarItem-header Box-header">
<?= t('server.user.donor_statistics') ?></div>
<ul class="SidebarList SidebarItem-body Box-body">
<?
if ($IsDonor) {
<? if ($IsDonor) { ?>
<?
if (check_perms('users_mod') || $OwnProfile) {
?>
?>
<li class="SidebarList-item">
<?= t('server.user.total_donor_points') ?>: <?= $DonationInfo['TotRank'] ?>
</li class="SidebarList-item">
@@ -56,11 +56,13 @@ class DonationsView {
<li class="SidebarList-item">
<?= t('server.user.rank_expires') ?>: <?= ($DonationInfo['ExpireTime']) ?>
</li>
<? } else { ?>
<? } else {
?>
<li class="SidebarList-item">
<?= t('server.user.rank_expires') ?>
<?= t('server.common.no_results') ?>
</li>
<? } ?>
<?
} ?>
</ul>
</div>
<?

View File

@@ -24,7 +24,7 @@ class INVITE_TREE {
$UserID = $this->UserID;
?>
<div class="invitetree pad">
<div class="invitetree BoxBody">
<?
G::$DB->query("
SELECT TreePosition, TreeID, TreeLevel
@@ -113,11 +113,14 @@ class INVITE_TREE {
if ($Donor) {
$DonorCount++;
}
// Manage tree depth
if ($TreeLevel > $PreviousTreeLevel) {
for ($i = 0; $i < $TreeLevel - $PreviousTreeLevel; $i++) {
echo "\n\n<ul class=\"invitetree\">\n\t<li>\n";
if ($TreeLevel == 2) {
echo "\n\n<ul class=\"MenuList invitetree\">\n\t<li>\n";
} else {
echo "\n\n<ul class=\"MenuList SubMenu invitetree\">\n\t<li>\n";
}
}
} elseif ($TreeLevel < $PreviousTreeLevel) {
for ($i = 0; $i < $PreviousTreeLevel - $TreeLevel; $i++) {
@@ -240,8 +243,9 @@ class INVITE_TREE {
}
}
?>
<br />
<?= $Tree ?>
</div>
<div class="BoxBody">
<?= $Tree ?>
</div>
<?
G::$DB->set_query_id($QueryID);

View File

@@ -6,41 +6,13 @@ class Tools {
* @param string $IP
*/
public static function site_ban_ip($IP) {
global $Debug;
$A = substr($IP, 0, strcspn($IP, '.'));
$IPNum = Tools::ip_to_unsigned($IP);
$IPBans = G::$Cache->get_value('ip_bans_' . $A);
if (!is_array($IPBans)) {
$SQL = sprintf("
SELECT ID, FromIP, ToIP
FROM ip_bans
WHERE FromIP BETWEEN %d << 24 AND (%d << 24) - 1", $A, $A + 1);
$QueryID = G::$DB->get_query_id();
G::$DB->query($SQL);
$IPBans = G::$DB->to_array(0, MYSQLI_NUM);
G::$DB->set_query_id($QueryID);
G::$Cache->cache_value('ip_bans_' . $A, $IPBans, 0);
G::$DB->prepared_query('SELECT ID FROM ip_bans WHERE INET6_ATON(?) BETWEEN FromIP and ToIP', $IP);
if (G::$DB->has_results() > 0) {
return true;
}
foreach ($IPBans as $Index => $IPBan) {
list($ID, $FromIP, $ToIP) = $IPBan;
if ($IPNum >= $FromIP && $IPNum <= $ToIP) {
return true;
}
}
return false;
}
/**
* Returns the unsigned form of an IP address.
*
* @param string $IP The IP address x.x.x.x
* @return string the long it represents.
*/
public static function ip_to_unsigned($IP) {
return sprintf('%u', ip2long($IP));
}
/**
* Geolocate an IP address using the database
*
@@ -52,22 +24,14 @@ class Tools {
if (isset($IPs[$IP])) {
return $IPs[$IP];
}
if (is_number($IP)) {
$Long = $IP;
} else {
$Long = Tools::ip_to_unsigned($IP);
}
if (!$Long || $Long == 2130706433) { // No need to check cc for 127.0.0.1
return false;
}
$QueryID = G::$DB->get_query_id();
G::$DB->query("
SELECT EndIP, Code
SELECT Code
FROM geoip_country
WHERE $Long >= StartIP
WHERE INET6_ATON('$IP')>= StartIP and INET6_ATON('$IP') < EndIP
ORDER BY StartIP DESC
LIMIT 1");
if ((!list($EndIP, $Country) = G::$DB->next_record()) || $EndIP < $Long) {
if ((!list($Country) = G::$DB->next_record())) {
$Country = '?';
}
G::$DB->set_query_id($QueryID);
@@ -151,7 +115,7 @@ class Tools {
*/
public static function display_ip($IP) {
$Line = display_str($IP) . ' (' . Tools::get_country_code_by_ajax($IP) . ') ';
$Line .= '<a class="brackets" href="user.php?action=search&amp;ip_history=on&amp;ip=' . display_str($IP) . '&amp;matchtype=strict" data-tooltip="Search">' . t('server.common.search') . '</a>';
$Line .= '<a class="brackets" href="user.php?action=search&amp;ip_history=on&amp;ip=' . display_str($IP) . '&amp;matchtype=strict" data-tooltip="Search">' . S . '</a>';
return $Line;
}
@@ -299,18 +263,4 @@ class Tools {
WHERE UserID = \'' . db_string($UserID) . '\'');
G::$DB->set_query_id($QueryID);
}
/**
* Check if an IP address is part of a given CIDR range.
* @param string $CheckIP the IP address to be looked up
* @param string $Subnet the CIDR subnet to be checked against
*/
public static function check_cidr_range($CheckIP, $Subnet) {
$IP = ip2long($CheckIP);
$CIDR = split('/', $Subnet);
$SubnetIP = ip2long($CIDR[0]);
$SubnetMaskBits = 32 - $CIDR[1];
return (($IP >> $SubnetMaskBits) == ($SubnetIP >> $SubnetMaskBits));
}
}

View File

@@ -0,0 +1,85 @@
<?php
use Phinx\Migration\AbstractMigration;
class Ipv6 extends AbstractMigration {
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change() {
$this->table('ip_bans')
->renameColumn('FromIP', 'FromIP_Old')
->renameColumn('ToIP', 'ToIP_Old')
->addColumn('FromIP', 'varbinary', ['length' => 16])
->addColumn('ToIP', 'varbinary', ['length' => 16])
->save();
$this->execute('UPDATE ip_bans SET FromIP=INET6_ATON(INET_NTOA(FromIP_Old)), ToIP=INET6_ATON(INET_NTOA(ToIP_Old));');
$this->table('geoip_country')
->renameColumn('StartIP', 'StartIP_Old')
->renameColumn('EndIP', 'EndIP_Old')
->addColumn('StartIP', 'varbinary', ['length' => 16])
->addColumn('EndIP', 'varbinary', ['length' => 16])
->save();
$this->execute('UPDATE geoip_country SET StartIP=INET6_ATON(INET_NTOA(StartIP_Old)), EndIP=INET6_ATON(INET_NTOA(EndIP_Old));');
$this->table('login_attempts')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_history_ips')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_main')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_history_ips')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_history_emails')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_history_passkeys')
->changeColumn('ChangerIP', 'string', ['length' => 45])
->save();
$this->table('users_history_passkeys')
->changeColumn('ChangerIP', 'string', ['length' => 45])
->save();
$this->table('users_sessions')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('apply_user')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('ip_lock')
->changeColumn('IPs', 'string', ['length' => 255])
->save();
$this->table('register_apply_link')
->changeColumn('IP', 'string', ['length' => 45])
->save();
$this->table('users_enable_requests')
->changeColumn('IP', 'string', ['length' => 45])
->save();
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Phinx\Migration\AbstractMigration;
class Ipv6Index extends AbstractMigration {
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change() {
$this->table('ip_bans')->removeIndexByName('FromIP_2')->removeIndexByName('ToIP')->addIndex(['FromIP', 'ToIP'], ['unique' => true])->save();
$this->table('geoip_country')->changePrimaryKey(['StartIP', 'EndIP'])->save();
}
}

View File

@@ -33,8 +33,9 @@ function claim(id) {
}
if (json['status'] == 'success') {
var username = json['username']
$('#claim_' + id).raw().innerHTML =
'<a href="#" onclick="return false;">Claimed by ' + username + '</a>'
$('#claim_' + id).ghide()
$('#unclaim_' + id).gshow()
$('#claimer_' + id).raw().innerHTML = username
}
})
}
@@ -46,12 +47,9 @@ function unClaim(id) {
ajax.post('reports.php?action=unclaim', post, function (response) {
var json = JSON.parse(response)
if (json['status'] == 'success') {
$('#claimed_' + id).raw().innerHTML =
'<a href="#" id="claim_' +
id +
'" onclick="claim(' +
id +
'); return false;" class="brackets">Claim</a>'
$('#claim_' + id).gshow()
$('#unclaim_' + id).ghide()
$('#claimer_' + id).raw().innerHTML = ''
}
})
}
@@ -60,26 +58,20 @@ function resolve(id, claimer) {
var answer = true
if (!claimer) {
if ($('#claimed_' + id).raw()) {
var answer = confirm(
'This is a claimed report. Are you sure you want to resolve it?'
)
var answer = confirm('This is a claimed report. Are you sure you want to resolve it?')
if (answer) answer = true
else answer = false
}
}
if (answer) {
ajax.post(
'reports.php?action=resolve',
'report_form_' + id,
function (response) {
var json = JSON.parse(response)
if (json['status'] == 'success') {
$('#report_' + id).remove()
} else {
alert(json['status'])
}
ajax.post('reports.php?action=resolve', 'report_form_' + id, function (response) {
var json = JSON.parse(response)
if (json['status'] == 'success') {
$('#report_' + id).remove()
} else {
alert(json['status'])
}
)
})
}
return false
}

View File

@@ -64,7 +64,42 @@ $TotalMonthlyPoints = $TotalDailyPoints * 30.436875;
$TotalYearlyPoints = $TotalDailyPoints * 365.2425;
$Pages = Format::get_pages($Page, $TotalTorrents, CONFIG['TORRENTS_PER_PAGE']);
if ($TotalTorrents > 0) {
$DB->prepared_query("
SELECT
t.ID,
t.GroupID,
t.Size,
t.Size / (1024 * 1024 * 1024) as CorrectSize,
t.Codec,
t.Source,
t.Processing,
t.Container,
t.Resolution,
t.Scene,
t.RemasterYear,
t.RemasterTitle,
t.Slot,
GREATEST(t.Seeders, 1) AS Seeders,
xfh.seedtime AS Seedtime,
(t.Size / (1024 * 1024 * 1024) * 1 *(
0.025 + (
(0.06 * LN(1 + (xfh.seedtime / (24)))) / (POW(GREATEST(t.Seeders, 1), 0.6))
)
)) AS HourlyPoints
FROM
(SELECT DISTINCT uid,fid FROM xbt_files_users WHERE active=1 AND remaining=0 AND mtime > unix_timestamp(NOW() - INTERVAL 1 HOUR) AND uid = ?) AS xfu
JOIN xbt_files_history AS xfh ON xfh.uid = xfu.uid AND xfh.fid = xfu.fid
JOIN torrents AS t ON t.ID = xfu.fid
WHERE
xfu.uid = ?
$OrderBy
LIMIT ?
OFFSET ?", $UserID, $UserID, $Limit, $Offset);
$GroupIDs = $DB->collect('GroupID');
$Groups = Torrents::get_groups($GroupIDs, true, true, false);
}
?>
<div class=LayoutBody>
<div class="BodyHeader">
@@ -134,59 +169,26 @@ $Pages = Format::get_pages($Page, $TotalTorrents, CONFIG['TORRENTS_PER_PAGE']);
<?
$LinkTail = "&order_way=" . ($OrderWay == "asc" ? "desc" : "asc") . ($Page != 1 ? "&page=$Page" : "");
?>
<div class="TableContainer">
<table class="TableBonusRateDetail Table">
<thead>
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=size<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.common.size') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=seeders<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.common.seeders') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=seedtime<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.bonus.seedtime') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=hourlypoints<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.bonus.bp_hour') ?></a></td>
<td class="Table-cell"><?= t('server.bonus.bp_day') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_week') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_month') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_year') ?></td>
</tr>
</thead>
<tbody>
<?php
if ($TotalTorrents > 0) {
$DB->prepared_query("
SELECT
t.ID,
t.GroupID,
t.Size,
t.Size / (1024 * 1024 * 1024) as CorrectSize,
t.Codec,
t.Source,
t.Processing,
t.Container,
t.Resolution,
t.Scene,
t.RemasterYear,
t.RemasterTitle,
t.Slot,
GREATEST(t.Seeders, 1) AS Seeders,
xfh.seedtime AS Seedtime,
(t.Size / (1024 * 1024 * 1024) * 1 *(
0.025 + (
(0.06 * LN(1 + (xfh.seedtime / (24)))) / (POW(GREATEST(t.Seeders, 1), 0.6))
)
)) AS HourlyPoints
FROM
(SELECT DISTINCT uid,fid FROM xbt_files_users WHERE active=1 AND remaining=0 AND mtime > unix_timestamp(NOW() - INTERVAL 1 HOUR) AND uid = ?) AS xfu
JOIN xbt_files_history AS xfh ON xfh.uid = xfu.uid AND xfh.fid = xfu.fid
JOIN torrents AS t ON t.ID = xfu.fid
WHERE
xfu.uid = ?
$OrderBy
LIMIT ?
OFFSET ?", $UserID, $UserID, $Limit, $Offset);
$GroupIDs = $DB->collect('GroupID');
$Groups = Torrents::get_groups($GroupIDs, true, true, false);
<?
if ($TotalTorrents > 0) {
?>
<div class="TableContainer">
<table class="TableBonusRateDetail Table">
<thead>
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=size<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.common.size') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=seeders<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.common.seeders') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=seedtime<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.bonus.seedtime') ?></a></td>
<td class="Table-cell"><a href="bonus.php?action=bprates&order_by=hourlypoints<?= $LinkTail ?><?= $UserID == $LoggedUser['ID'] ? "" : "&userid=$UserID" ?>"><?= t('server.bonus.bp_hour') ?></a></td>
<td class="Table-cell"><?= t('server.bonus.bp_day') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_week') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_month') ?></td>
<td class="Table-cell"><?= t('server.bonus.bp_year') ?></td>
</tr>
</thead>
<tbody>
<?
while ($Torrent = $DB->next_record(MYSQLI_ASSOC)) {
$Size = intval($Torrent['Size']);
$CorrectSize = $Torrent['CorrectSize'];
@@ -201,7 +203,7 @@ $Pages = Format::get_pages($Page, $TotalTorrents, CONFIG['TORRENTS_PER_PAGE']);
'SettingTorrentTitle' => G::$LoggedUser['SettingTorrentTitle'],
]);
$DisplayName = '<a href="torrents.php?id=' . $GroupID . '&amp;torrentid=' . $Torrent['ID'] . '" data-tooltip="' . t('server.common.view_torrent') . '" dir="ltr">' . $Name . '</a>';
?>
?>
<tr class="Table-row">
<td class="Table-cell"><?= $DisplayName ?></td>
<td class="Table-cell"><?= Format::get_size($Torrent['Size']) ?></td>
@@ -213,22 +215,12 @@ $Pages = Format::get_pages($Page, $TotalTorrents, CONFIG['TORRENTS_PER_PAGE']);
<td class="Table-cell"><?= number_format($MonthlyPoints) ?></td>
<td class="Table-cell"><?= number_format($YearlyPoints) ?></td>
</tr>
<?php
}
} else {
?>
<tr class="Table-row">
<td colspan="10" style="text-align:center;"><?= t('server.bonus.no_torrent_seeded_currently') ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<? } ?>
</tbody>
</table>
</div>
<? } ?>
</div>
<?php
<?
View::show_footer();
?>

View File

@@ -13,6 +13,7 @@ if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'purchase':
/* handle validity and cost as early as possible */
if (isset($_REQUEST['label']) && preg_match('/^[a-z]{1,15}(-\w{1,15}){0,4}/', $_REQUEST['label'])) {
$Label = $_REQUEST['label'];
$Item = $Bonus->getItem($Label);

View File

@@ -5,12 +5,12 @@ View::show_header('积分商城', 'bonus', 'PageBonusStore');
if (isset($_GET['complete'])) {
$label = $_GET['complete'];
$item = $Bonus->getItem($label);
$Items = $Bonus->getList();
?>
<div class="alertbar blend">
&quot;<?= t("server.bonus.${item['Label']}") ?>&quot;&nbsp;<?= t('server.bonus.purchased') ?>
</div>
<?
}
$Items = $Bonus->getList();
?>
<div class=LayoutBody>
@@ -24,66 +24,74 @@ if (isset($_GET['complete'])) {
</div>
<div class="LayoutBody">
<div class="TableContainer">
<table class="TableBonusStore Table">
<thead>
<tr class="Table-rowHeader">
<td class="Table-cell" width="30px">#</td>
<td class="Table-cell"><?= t('server.bonus.description') ?></td>
<td class="Table-cell" width="45px"><?= t('server.bonus.points_price') ?></td>
<td class="Table-cell" width="70px"><?= t('server.bonus.checkout') ?></td>
</tr>
</thead>
<tbody>
<?php
<div class="alertbar blend">
&quot;<?= t("server.bonus.${item['Label']}") ?>&quot;&nbsp;<?= t('server.bonus.purchased') ?>
</div>
<? if (count($Items) > 0) { ?>
<div class="TableContainer">
<table class="TableBonusStore Table">
<thead>
<tr class="Table-rowHeader">
<td class="Table-cell" width="30px">#</td>
<td class="Table-cell"><?= t('server.bonus.description') ?></td>
<td class="Table-cell" width="45px"><?= t('server.bonus.points_price') ?></td>
<td class="Table-cell" width="70px"><?= t('server.common.actions') ?></td>
</tr>
</thead>
<tbody>
<?php
$Cnt = 0;
$Items = $Bonus->getList();
$Cnt = 0;
foreach ($Items as $Label => $Item) {
/*
foreach ($Items as $Label => $Item) {
/*
if ($Item['MinClass'] > G::$LoggedUser['EffectiveClass']) {
continue;
}
*/
$Cnt++;
$Price = $Bonus->getEffectivePrice($Label, G::$LoggedUser['EffectiveClass']);
$FormattedPrice = number_format($Price);
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Cnt ?></td>
<td class="Table-cell"><?= t("server.bonus.${Item['Label']}") ?></td>
<td class="Table-cell"><?= $FormattedPrice ?></td>
<td class="Table-cell">
<?
if ($Item['MinClass'] > $LoggedUser['EffectiveClass']) {
?>
<span style="font-style: italic"><?= t('server.bonus.need_higher_user_class') ?></span>
$Cnt++;
$Price = $Bonus->getEffectivePrice($Label, G::$LoggedUser['EffectiveClass']);
$FormattedPrice = number_format($Price);
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Cnt ?></td>
<td class="Table-cell"><?= t("server.bonus.${Item['Label']}") ?></td>
<td class="Table-cell"><?= $FormattedPrice ?></td>
<td class="Table-cell">
<?
} else {
if (G::$LoggedUser['BonusPoints'] >= $Price) {
$NextFunction = preg_match('/^other-\d$/', $Label) ? 'ConfirmOther' : 'null';
$OnClick = preg_match('/^title-bbcode-[yn]$/', $Label) ? "NoOp" : "ConfirmPurchase";
if ($Item['MinClass'] > $LoggedUser['EffectiveClass']) {
?>
<a id="bonusconfirm" href="bonus.php?action=purchase&label=<?= $Label ?>&auth=<?= $LoggedUser['AuthKey'] ?>" onclick="<?= $OnClick ?>(event, '<?= t('server.bonus.' . $Item['Label']) ?>', <?= $NextFunction ?>, this);"><?= t('server.bonus.purchase') ?></a>
<?
<span style="font-style: italic"><?= t('server.bonus.need_higher_user_class') ?></span>
<?
} else {
?>
<span style="font-style: italic"><?= t('server.bonus.too_expensive') ?></span>
<?
if (G::$LoggedUser['BonusPoints'] >= $Price) {
$NextFunction = preg_match('/^other-\d$/', $Label) ? 'ConfirmOther' : 'null';
$OnClick = preg_match('/^title-bbcode-[yn]$/', $Label) ? "NoOp" : "ConfirmPurchase";
?>
<button class="Button" id="bonusconfirm" href="" onclick="<?= $OnClick ?>(event, '<?= t('server.bonus.' . $Item['Label']) ?>', <?= $NextFunction ?>, this); location.href='bonus.php?action=purchase&label=<?= $Label ?>&auth=<?= $LoggedUser['AuthKey'] ?>'"><?= t('server.bonus.purchase') ?></button>
<?
} else {
?>
<span style="font-style: italic"><?= t('server.bonus.too_expensive') ?></span>
<?
}
}
}
print <<<HTML
print <<<HTML
</td>
</tr>
HTML;
}
?>
</tbody>
</table>
</div>
}
?>
</tbody>
</table>
</div>
<? } else {
VIew::line(t('server.common.no_results'));
}
?>
</div>
</div>
<?php

View File

@@ -105,7 +105,6 @@ switch ($_GET['feed']) {
$Feed->channel('Gazelle Change Log', 'RSS feed for Gazelle\'s changelog.');
if (!$Changelog = $Cache->get_value('changelog')) {
require(CONFIG['SERVER_ROOT'] . '/classes/mysql.class.php');
require(CONFIG['SERVER_ROOT'] . '/classes/misc.class.php');
$DB = new DB_MYSQL;
$DB->query("

View File

@@ -93,126 +93,128 @@ View::show_header(t('server.forums.forums_greater_than_search'), 'bbcode,forum_s
</div>
<form class="Form SearchPage Box SearchForum" name="forums" action="" method="get">
<input type="hidden" name="action" value="search" />
<table class="Form-rowList">
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.search_for') ?>:</td>
<td class="Form-inputs">
<input class="Input" type="text" name="search" size="70" value="<?= display_str($Search) ?>" />
</td>
</tr>
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.posted_by') ?>:</td>
<td class="Form-inputs">
<input class="Input" type="text" name="user" placeholder="Username" size="70" value="<?= display_str($User) ?>" />
</td>
</tr>
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.topic_created') ?>:</td>
<td class="Form-inputs">
<?= t('server.forums.after') ?>:
<input class="Input is-small" type="text" name="thread_created_after" id="thread_created_after" value="<?= $ThreadAfterDate ?>" />
<?= t('server.forums.before') ?>:
<input class="Input is-small" type="text" name="thread_created_before" id="thread_created_before" value="<?= $ThreadBeforeDate ?>" />
</td>
</tr>
<?
if (empty($ThreadID)) {
?>
<div class="SearchPageBody">
<table class="Form-rowList">
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.search_in') ?>:</td>
<td class="Form-label"><?= t('server.forums.search_for') ?>:</td>
<td class="Form-inputs">
<div class="Radio">
<input class="Input" type="radio" name="type" id="type_title" value="title" <? if ($Type == 'title') {
echo ' checked="checked"';
} ?> />
<label class="Radio-label" for="type_title"><?= t('server.forums.titles') ?></label>
</div>
<div class="Radio">
<input class="Input" type="radio" name="type" id="type_body" value="body" <? if ($Type == 'body') {
echo ' checked="checked"';
} ?> />
<label class="Radio-label" for="type_body"><?= t('server.forums.post_bodies') ?></label>
</div>
<input class="Input" type="text" name="search" size="70" value="<?= display_str($Search) ?>" />
</td>
</tr>
<tr class="Form-row <?= $Type == 'title' ? 'hidden' : '' ?>" id="post_created_row">
<td class="Form-label"><?= t('server.forums.post_created') ?>:</td>
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.posted_by') ?>:</td>
<td class="Form-inputs">
<input class="Input" type="text" name="user" placeholder="Username" size="70" value="<?= display_str($User) ?>" />
</td>
</tr>
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.topic_created') ?>:</td>
<td class="Form-inputs">
<?= t('server.forums.after') ?>:
<input class="Input" type="text" name="post_created_after" id="post_created_after" value="<?= $PostAfterDate ?>" />
<input class="Input is-small" type="text" name="thread_created_after" id="thread_created_after" value="<?= $ThreadAfterDate ?>" />
<?= t('server.forums.before') ?>:
<input class="Input" type="text" name="post_created_before" id="post_created_before" value="<?= $PostBeforeDate ?>" />
<input class="Input is-small" type="text" name="thread_created_before" id="thread_created_before" value="<?= $ThreadBeforeDate ?>" />
</td>
</tr>
<tr class="Form-row" variant="alighLeft">
<td class="Form-label"><?= t('server.forums.search_forums') ?>:</td>
<td class="Form-inputs">
<table class="SearchForum-forumList" id="forum_search_cat_list">
<?
// List of forums
$Open = false;
$LastCategoryID = -1;
$Columns = 0;
$i = 0;
foreach ($Forums as $Forum) {
if (!Forums::check_forumperm($Forum['ID'])) {
continue;
}
$Columns++;
if ($Forum['CategoryID'] != $LastCategoryID) {
$LastCategoryID = $Forum['CategoryID'];
if ($Open) {
if ($Columns % 5) { ?>
<td colspan="<?= (5 - ($Columns % 5)) ?>"></td>
<?
}
?>
</tr>
<?
<?
if (empty($ThreadID)) {
?>
<tr class="Form-row">
<td class="Form-label"><?= t('server.forums.search_in') ?>:</td>
<td class="Form-inputs">
<div class="Radio">
<input class="Input" type="radio" name="type" id="type_title" value="title" <? if ($Type == 'title') {
echo ' checked="checked"';
} ?> />
<label class="Radio-label" for="type_title"><?= t('server.forums.titles') ?></label>
</div>
<div class="Radio">
<input class="Input" type="radio" name="type" id="type_body" value="body" <? if ($Type == 'body') {
echo ' checked="checked"';
} ?> />
<label class="Radio-label" for="type_body"><?= t('server.forums.post_bodies') ?></label>
</div>
</td>
</tr>
<tr class="Form-row <?= $Type == 'title' ? 'hidden' : '' ?>" id="post_created_row">
<td class="Form-label"><?= t('server.forums.post_created') ?>:</td>
<td class="Form-inputs">
<?= t('server.forums.after') ?>:
<input class="Input" type="text" name="post_created_after" id="post_created_after" value="<?= $PostAfterDate ?>" />
<?= t('server.forums.before') ?>:
<input class="Input" type="text" name="post_created_before" id="post_created_before" value="<?= $PostBeforeDate ?>" />
</td>
</tr>
<tr class="Form-row" variant="alighLeft">
<td class="Form-label"><?= t('server.forums.search_forums') ?>:</td>
<td class="Form-inputs">
<table class="SearchForum-forumList" id="forum_search_cat_list">
<?
// List of forums
$Open = false;
$LastCategoryID = -1;
$Columns = 0;
$i = 0;
foreach ($Forums as $Forum) {
if (!Forums::check_forumperm($Forum['ID'])) {
continue;
}
$Columns = 0;
$Open = true;
$i++;
?>
<tr class="Form-row" variant="alignLeft">
<td colspan="5" class="forum_cat">
<strong><?= $ForumCats[$Forum['CategoryID']] ?></strong>
<a href="#" class="brackets forum_category" id="forum_category_<?= $i ?>"><?= t('server.forums.check_all') ?></a>
$Columns++;
if ($Forum['CategoryID'] != $LastCategoryID) {
$LastCategoryID = $Forum['CategoryID'];
if ($Open) {
if ($Columns % 5) { ?>
<td colspan="<?= (5 - ($Columns % 5)) ?>"></td>
<?
}
?>
</tr>
<?
}
$Columns = 0;
$Open = true;
$i++;
?>
<tr class="Form-row" variant="alignLeft">
<td colspan="5" class="forum_cat">
<strong><?= $ForumCats[$Forum['CategoryID']] ?></strong>
<a href="#" class="brackets forum_category" id="forum_category_<?= $i ?>"><?= t('server.forums.check_all') ?></a>
</td>
</tr>
<tr class="Form-row" variant="alignLeft">
<? } elseif ($Columns % 5 == 0) { ?>
</tr>
<tr class="Form-row" variant="alignLeft">
<? } ?>
<td class="Form-submit">
<div class="Checkbox">
<input class="Input" type="checkbox" name="forums[]" value="<?= $Forum['ID'] ?>" data-category="forum_category_<?= $i ?>" id="forum_<?= $Forum['ID'] ?>" <? if (isset($_GET['forums']) && in_array($Forum['ID'], $_GET['forums'])) {
echo ' checked="checked"';
} ?> />
<label class="Checkbox-label" for="forum_<?= $Forum['ID'] ?>"><?= htmlspecialchars($Forum['Name']) ?></label>
</div>
</td>
</tr>
<tr class="Form-row" variant="alignLeft">
<? } elseif ($Columns % 5 == 0) { ?>
</tr>
<tr class="Form-row" variant="alignLeft">
<? } ?>
<td class="Form-submit">
<div class="Checkbox">
<input class="Input" type="checkbox" name="forums[]" value="<?= $Forum['ID'] ?>" data-category="forum_category_<?= $i ?>" id="forum_<?= $Forum['ID'] ?>" <? if (isset($_GET['forums']) && in_array($Forum['ID'], $_GET['forums'])) {
echo ' checked="checked"';
} ?> />
<label class="Checkbox-label" for="forum_<?= $Forum['ID'] ?>"><?= htmlspecialchars($Forum['Name']) ?></label>
</div>
</td>
<? }
if ($Columns % 5) { ?>
<td colspan="<?= (4 - ($Columns % 5)) ?>"></td>
<? } ?>
</tr>
</table>
<? } else { ?>
<input type="hidden" name="threadid" value="<?= $ThreadID ?>" />
<? } ?>
</td>
</tr>
<tr class="Form-row">
<td colspan="2" class="center">
<input class="Button" type="submit" value="Search" />
<? }
if ($Columns % 5) { ?>
<td colspan="<?= (4 - ($Columns % 5)) ?>"></td>
<? } ?>
</tr>
</table>
<? } else { ?>
<input type="hidden" name="threadid" value="<?= $ThreadID ?>" />
<? } ?>
</td>
</tr>
</table>
</tr>
</table>
</div>
<div class="SearchPageFooter">
<div class="SearchPageFooter-actions">
<button class="Button" type="submit" value="Search"><?= t('server.common.search') ?></button>
</div>
</div>
</form>
<div class="BodyNavLinks">
<?

View File

@@ -1,6 +1,9 @@
<?
enforce_login();
if (!check_perms('site_view_full_log')) {
error(403);
}
View::show_header(t('server.log.site_log'), '', 'PageLogHome');
include(CONFIG['SERVER_ROOT'] . '/sections/log/sphinx.php');

View File

@@ -5,6 +5,67 @@ use Gazelle\Util\Crypto;
/*-- TODO ---------------------------//
Add the JavaScript validation into the display page using the class
//-----------------------------------*/
// Function to log a user's login attempt
function log_attempt($UserID) {
global $DB, $Cache, $AttemptID, $Attempts, $Bans, $BannedUntil;
$IPStr = $_SERVER['REMOTE_ADDR'];
if ($AttemptID) { // User has attempted to log in recently
$Attempts++;
if ($Attempts > 5) { // Only 6 allowed login attempts, ban user's IP
$BannedUntil = time_plus(60 * 60 * 6);
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '" . db_string($BannedUntil) . "',
Bans = Bans + 1
WHERE ID = '" . db_string($AttemptID) . "'");
if ($Bans > 9) { // Automated bruteforce prevention
$DB->query("
SELECT Reason
FROM ip_bans
WHERE INET6_ATON('$IPStr') BETWEEN FromIP AND ToIP");
if ($DB->has_results()) {
//Ban exists already, only add new entry if not for same reason
list($Reason) = $DB->next_record(MYSQLI_BOTH, false);
if ($Reason != 'Automated ban per >60 failed login attempts') {
$DB->query("
UPDATE ip_bans
SET Reason = CONCAT('Automated ban per >60 failed login attempts AND ', Reason)
WHERE FromIP < INET6_ATON('$IPStr')
AND ToIP > INET6_ATON('$IPStr')");
}
} else {
//No ban
$DB->query("
INSERT IGNORE INTO ip_bans
(FromIP, ToIP, Reason)
VALUES
(INET6_ATON('$IPStr'),INET6_ATON('$IPStr'), 'Automated ban per >60 failed login attempts')");
$Cache->delete_value("ip_bans_$IPStr");
}
}
} else {
// User has attempted fewer than 6 logins
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '0000-00-00 00:00:00'
WHERE ID = '" . db_string($AttemptID) . "'");
}
} else { // User has not attempted to log in recently
$Attempts = 1;
$DB->query("
INSERT INTO login_attempts
(UserID, IP, LastAttempt, Attempts)
VALUES
('" . db_string($UserID) . "', '" . db_string($IPStr) . "', '" . sqltime() . "', 1)");
}
} // end log_attempt function
function checkLoginKey($Key) {
$Key = db_string($Key);
@@ -249,69 +310,7 @@ elseif (isset($_REQUEST['act']) && $_REQUEST['act'] === '2fa_recovery') {
WHERE IP = '" . db_string($_SERVER['REMOTE_ADDR']) . "'");
list($AttemptID, $Attempts, $Bans, $BannedUntil) = $DB->next_record();
// Function to log a user's login attempt
function log_attempt($UserID) {
global $DB, $Cache, $AttemptID, $Attempts, $Bans, $BannedUntil;
$IPStr = $_SERVER['REMOTE_ADDR'];
$IPA = substr($IPStr, 0, strcspn($IPStr, '.'));
$IP = Tools::ip_to_unsigned($IPStr);
if ($AttemptID) { // User has attempted to log in recently
$Attempts++;
if ($Attempts > 5) { // Only 6 allowed login attempts, ban user's IP
$BannedUntil = time_plus(60 * 60 * 6);
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '" . db_string($BannedUntil) . "',
Bans = Bans + 1
WHERE ID = '" . db_string($AttemptID) . "'");
if ($Bans > 9) { // Automated bruteforce prevention
$DB->query("
SELECT Reason
FROM ip_bans
WHERE $IP BETWEEN FromIP AND ToIP");
if ($DB->has_results()) {
//Ban exists already, only add new entry if not for same reason
list($Reason) = $DB->next_record(MYSQLI_BOTH, false);
if ($Reason != 'Automated ban per >60 failed login attempts') {
$DB->query("
UPDATE ip_bans
SET Reason = CONCAT('Automated ban per >60 failed login attempts AND ', Reason)
WHERE FromIP = $IP
AND ToIP = $IP");
}
} else {
//No ban
$DB->query("
INSERT IGNORE INTO ip_bans
(FromIP, ToIP, Reason)
VALUES
('$IP','$IP', 'Automated ban per >60 failed login attempts')");
$Cache->delete_value("ip_bans_$IPA");
}
}
} else {
// User has attempted fewer than 6 logins
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '0000-00-00 00:00:00'
WHERE ID = '" . db_string($AttemptID) . "'");
}
} else { // User has not attempted to log in recently
$Attempts = 1;
$DB->query("
INSERT INTO login_attempts
(UserID, IP, LastAttempt, Attempts)
VALUES
('" . db_string($UserID) . "', '" . db_string($IPStr) . "', '" . sqltime() . "', 1)");
}
} // end log_attempt function
log_attempt($UserID);
unset($_SESSION['temp_stay_logged'], $_SESSION['temp_user_data']);
header('Location: login.php');
@@ -413,70 +412,6 @@ else {
WHERE IP = '" . db_string($_SERVER['REMOTE_ADDR']) . "'");
list($AttemptID, $Attempts, $Bans, $BannedUntil) = $DB->next_record();
// Function to log a user's login attempt
function log_attempt($UserID) {
global $DB, $Cache, $AttemptID, $Attempts, $Bans, $BannedUntil;
$IPStr = $_SERVER['REMOTE_ADDR'];
$IPA = substr($IPStr, 0, strcspn($IPStr, '.'));
$IP = Tools::ip_to_unsigned($IPStr);
if ($AttemptID) { // User has attempted to log in recently
$Attempts++;
if ($Attempts > 5) { // Only 6 allowed login attempts, ban user's IP
$BannedUntil = time_plus(60 * 60 * 6);
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '" . db_string($BannedUntil) . "',
Bans = Bans + 1
WHERE ID = '" . db_string($AttemptID) . "'");
if ($Bans > 9) { // Automated bruteforce prevention
$DB->query("
SELECT Reason
FROM ip_bans
WHERE $IP BETWEEN FromIP AND ToIP");
if ($DB->has_results()) {
//Ban exists already, only add new entry if not for same reason
list($Reason) = $DB->next_record(MYSQLI_BOTH, false);
if ($Reason != 'Automated ban per >60 failed login attempts') {
$DB->query("
UPDATE ip_bans
SET Reason = CONCAT('Automated ban per >60 failed login attempts AND ', Reason)
WHERE FromIP = $IP
AND ToIP = $IP");
}
} else {
//No ban
$DB->query("
INSERT IGNORE INTO ip_bans
(FromIP, ToIP, Reason)
VALUES
('$IP','$IP', 'Automated ban per >60 failed login attempts')");
$Cache->delete_value("ip_bans_$IPA");
}
}
} else {
// User has attempted fewer than 6 logins
$DB->query("
UPDATE login_attempts
SET
LastAttempt = '" . sqltime() . "',
Attempts = '" . db_string($Attempts) . "',
BannedUntil = '0000-00-00 00:00:00'
WHERE ID = '" . db_string($AttemptID) . "'");
}
} else { // User has not attempted to log in recently
$Attempts = 1;
$DB->query("
INSERT INTO login_attempts
(UserID, IP, LastAttempt, Attempts)
VALUES
('" . db_string($UserID) . "', '" . db_string($IPStr) . "', '" . sqltime() . "', 1)");
}
} // end log_attempt function
// If user has submitted form
if (isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
if ($CloseLogin) {

View File

@@ -93,81 +93,94 @@ $DB->set_query_id($Reports);
$Type = $Types[$Short];
$Reference = "reports.php?id=$ReportID#report$ReportID";
?>
<div class="TableContainer pending_report_v1" id="report_<?= $ReportID ?>" style="margin-bottom: 1em;">
<table class="Table" cellpadding="5" id="report_<?= $ReportID ?>">
<tr class="Table-rowHeader">
<td class="Table-cell">
<strong><a href="<?= $Reference ?>"><?= t('server.reports.report') ?> #<?= $ReportID ?></a></strong>
<div class="pending_report_v1" id="report_<?= $ReportID ?>" style="margin-bottom: 1em;">
<table class="Form-rowList" cellpadding="5" id="report_<?= $ReportID ?>" variant="header">
<tr class="Form-rowHeader">
<td>
<a href="<?= $Reference ?>"> #<?= $ReportID ?></a>
<?= $Type['title'] ?>
</td>
<td class="Table-cell">
<strong><?= $Type['title'] ?></strong>
<?= t('server.reports.sth_was_reported_by_user_sometime', ['Values' => [
"<a href='user.php?id=${SnitchID}'>${SnitchName}</a>"
]]) ?>
<?= time_diff($ReportedTime) ?>
</tr>
<tr class="Form-row">
<td class="Form-label">
<?= t('server.reportsv2.reported_by') ?>
</td>
<td class="Form-inputs">
<?= Users::format_username($SnitchID) ?>
<a href="reports.php?action=compose&amp;to=<?= $SnitchID ?>&amp;reportid=<?= $ReportID ?>&amp;type=<?= $Short ?>&amp;thingid=<?= $ThingID ?>" class="brackets"><?= t('server.reports.contact') ?></a>
</td>
</tr>
<tr class="Table-row">
<td class="Table-cell center" colspan="2">
<strong>
<? switch ($Short) {
case 'user':
$DB->query("
<tr class="Form-row">
<td class="Form-label">
<?= t('server.reportsv2.date_reported') ?>
</td>
<td class="Form-inputs">
<?= time_diff($ReportedTime) ?>
</td>
</tr>
<tr class="Form-row">
<td class="Form-label">
<?= $Type['title'] ?>
</td>
<td class="Form-inputs">
<? switch ($Short) {
case 'user':
$DB->query("
SELECT Username
FROM users_main
WHERE ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_user_with_the_reported_id_found');
} else {
list($Username) = $DB->next_record();
echo "<a href=\"user.php?id=$ThingID\">" . display_str($Username) . '</a>';
}
break;
case 'request':
case 'request_update':
$DB->query("
if (!$DB->has_results()) {
echo t('server.reports.no_user_with_the_reported_id_found');
} else {
list($Username) = $DB->next_record();
echo "<a href=\"user.php?id=$ThingID\">" . display_str($Username) . '</a>';
}
break;
case 'request':
case 'request_update':
$DB->query("
SELECT Title
FROM requests
WHERE ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_user_with_the_reported_id_found');
} else {
list($Name) = $DB->next_record();
echo "<a href=\"requests.php?action=view&amp;id=$ThingID\">" . display_str($Name) . '</a>';
}
break;
case 'collage':
$DB->query("
if (!$DB->has_results()) {
echo t('server.reports.no_user_with_the_reported_id_found');
} else {
list($Name) = $DB->next_record();
echo "<a href=\"requests.php?action=view&amp;id=$ThingID\">" . display_str($Name) . '</a>';
}
break;
case 'collage':
$DB->query("
SELECT Name
FROM collages
WHERE ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_collage_with_the_reported_id_found');
} else {
list($Name) = $DB->next_record();
echo "<a href=\"collages.php?id=$ThingID\">" . display_str($Name) . '</a>';
}
break;
case 'thread':
$DB->query("
if (!$DB->has_results()) {
echo t('server.reports.no_collage_with_the_reported_id_found');
} else {
list($Name) = $DB->next_record();
echo "<a href=\"collages.php?id=$ThingID\">" . display_str($Name) . '</a>';
}
break;
case 'thread':
$DB->query("
SELECT Title
FROM forums_topics
WHERE ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_forum_thread_with_the_reported_id_found');
} else {
list($Title) = $DB->next_record();
echo "<a href=\"forums.php?action=viewthread&amp;threadid=$ThingID\">" . display_str($Title) . '</a>';
}
break;
case 'post':
if (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage'];
} else {
$PerPage = CONFIG['POSTS_PER_PAGE'];
}
$DB->query("
if (!$DB->has_results()) {
echo t('server.reports.no_forum_thread_with_the_reported_id_found');
} else {
list($Title) = $DB->next_record();
echo "<a href=\"forums.php?action=viewthread&amp;threadid=$ThingID\">" . display_str($Title) . '</a>';
}
break;
case 'post':
if (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage'];
} else {
$PerPage = CONFIG['POSTS_PER_PAGE'];
}
$DB->query("
SELECT
p.ID,
p.Body,
@@ -180,76 +193,99 @@ $DB->set_query_id($Reports);
) AS PostNum
FROM forums_posts AS p
WHERE p.ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_forum_post_with_the_reported_id_found');
} else {
list($PostID, $Body, $TopicID, $PostNum) = $DB->next_record();
echo "<a href=\"forums.php?action=viewthread&amp;threadid=$TopicID&amp;post=$PostNum#post$PostID\">FORUM POST ID #$PostID</a>";
}
break;
case 'comment':
$DB->query("
if (!$DB->has_results()) {
echo t('server.reports.no_forum_post_with_the_reported_id_found');
} else {
list($PostID, $Body, $TopicID, $PostNum) = $DB->next_record();
echo "<a href=\"forums.php?action=viewthread&amp;threadid=$TopicID&amp;post=$PostNum#post$PostID\">#$PostID</a>";
}
break;
case 'comment':
$DB->query("
SELECT 1
FROM comments
WHERE ID = $ThingID");
if (!$DB->has_results()) {
echo t('server.reports.no_comment_with_the_reported_id_found');
} else {
echo "<a href=\"comments.php?action=jump&amp;postid=$ThingID\">COMMENT</a>";
}
break;
}
?>
</strong>
if (!$DB->has_results()) {
echo t('server.reports.no_comment_with_the_reported_id_found');
} else {
echo "<a href=\"comments.php?action=jump&amp;postid=$ThingID\">$ThingID</a>";
}
break;
}
?>
</td>
</tr>
<tr class="Table-row">
<td class="Table-cell" colspan="2">
<tr class="Form-row">
<td class="Form-label">
<?= t('server.common.reason') ?>
</td>
<td class="Form-inputs">
<div class="HtmlText">
<?= Text::full_format($Reason) ?>
</div>
</td>
</tr>
<tr class="Table-row">
<td class="Table-cell" colspan="2">
<? if ($ClaimerID == $LoggedUser['ID']) { ?>
<span id="claimed_<?= $ReportID ?>">
<?= t('server.reports.claimed_by', ['Values' => [
Users::format_username($ClaimerID, false, false, false, false)
]]) ?>
<a href="#" onclick="unClaim(<?= $ReportID ?>); return false;" class="brackets"><?= t('server.reports.unclaim') ?></a></span>
<tr class="Form-row">
<td class="Form-label">
<?= t('server.reportsv2.in_progress_by') ?>
</td>
<td class="Form-inputs">
<div id="claimer_<?= $ReportID ?>">
<? if ($ClaimerID) { ?>
<?= Users::format_username($ClaimerID, false, false, false, false) ?>
<? } ?>
</div>
</td>
</tr>
<tr class="Form-row">
<td class="Form-label">
<?= t('server.tools.notes') ?>
</td>
<td class="Form-items">
<textarea class="Input" cols="50" rows="3" id="notes_<?= $ReportID ?>"><?= $Notes ?></textarea>
<div>
<button class="Button" type="submit" onclick="saveNotes(<?= $ReportID ?>)" value="Save"><?= t('client.common.save') ?></button>
</div>
</td>
<div id="notes_div_<?= $ReportID ?>" style="display: <?= empty($Notes) ? 'none' : 'block'; ?>;">
</div>
</tr>
<td class="Table-cell" colspan="2">
<? if ($ClaimerID == $LoggedUser['ID']) { ?>
<span id="claimed_<?= $ReportID ?>">
<? } elseif ($ClaimerID) { ?>
<span id="claimed_<?= $ReportID ?>">
<?= t('server.reports.claimed_by', ['Values' => [
Users::format_username($ClaimerID, false, false, false, false)
]]) ?></span>
<? } else { ?>
<a href="#" id="claim_<?= $ReportID ?>" onclick="claim(<?= $ReportID ?>); return false;" class="brackets"><?= t('server.reports.claim') ?></a>
<? } ?>
&nbsp;&nbsp;
<a href="#" onclick="toggleNotes(<?= $ReportID ?>); return false;" class="brackets"><?= t('server.reports.toggle_notes') ?></a>
<div id="notes_div_<?= $ReportID ?>" style="display: <?= empty($Notes) ? 'none' : 'block'; ?>;">
<textarea class="Input" cols="50" rows="3" id="notes_<?= $ReportID ?>"><?= $Notes ?></textarea>
<br />
<input class="Button" type="submit" onclick="saveNotes(<?= $ReportID ?>)" value="Save" />
</div>
</td>
</tr>
</td>
<? if ($Status != 'Resolved') { ?>
<tr class="Table-row">
<td class="Table-cell center" colspan="2">
<tr class="Form-row">
<td>
<form id="report_form_<?= $ReportID ?>" action="">
<input type="hidden" name="reportid" value="<?= $ReportID ?>" />
<input type="hidden" name="auth" value="<?= $LoggedUser['AuthKey'] ?>" />
<input class="Button" type="submit" onclick="return resolve(<?= $ReportID ?>, <?= (($ClaimerID == $LoggedUser['ID'] || !$ClaimerID) ? 'true' : 'false') ?>)" name="submit" value="Resolve" />
<button class="Button" type="submit" onclick="return resolve(<?= $ReportID ?>, <?= (($ClaimerID == $LoggedUser['ID'] || !$ClaimerID) ? 'true' : 'false') ?>)" name="submit" value="Resolve"><?= t('server.common.resolve') ?></button>
<? if ($ClaimerID) { ?>
<button id="unclaim_<?= $ReportID ?>" class="Button" onclick="unClaim(<?= $ReportID ?>); return false;"><?= t('server.reports.unclaim') ?></button>
<button class="hidden Button" id="claim_<?= $ReportID ?>" onclick="claim(<?= $ReportID ?>); return false;"><?= t('server.reports.claim') ?></button>
<? } else { ?>
<button class="hidden Button" id="unclaim_<?= $ReportID ?>" onclick="unClaim(<?= $ReportID ?>); return false;"><?= t('server.reports.unclaim') ?></button>
<button id="claim_<?= $ReportID ?>" class="Button" onclick="claim(<?= $ReportID ?>); return false;"><?= t('server.reports.claim') ?></button>
<? } ?>
</form>
</td>
</tr>
<? } else { ?>
<? $ResolverInfo = Users::user_info($ResolverID); ?>
<tr class="Table-row">
<td class="Table-cell" colspan="2">
<tr class="Form-row">
<td>
<?= t('server.reports.resolved_by', ['Values' => [
"<a href='users.php?id=$ResolverID'>${ResolverInfo['Username']}</a>"
]]) ?>

View File

@@ -6,19 +6,20 @@ if (!check_perms('admin_reports') && !check_perms('site_moderate_forums')) {
View::show_header(t('server.reports.other_reports_stats'), '', 'PageReportStat');
?>
<div class="BodyHeader">
<h2 class="BodyHeader-nav"><?= t('server.reports.other_reports_stats') ?></h2>
<div class="BodyNavLinks">
<a href="reports.php"><?= t('server.reports.new') ?></a>
<a href="reports.php?view=old"><?= t('server.reports.old') ?></a>
<a href="reports.php?action=stats"><?= t('server.reports.stats') ?></a>
<div class="LayoutBody">
<div class="BodyHeader">
<h2 class="BodyHeader-nav"><?= t('server.reports.other_reports_stats') ?></h2>
<div class="BodyNavLinks">
<a href="reports.php"><?= t('server.reports.new') ?></a>
<a href="reports.php?view=old"><?= t('server.reports.old') ?></a>
<a href="reports.php?action=stats"><?= t('server.reports.stats') ?></a>
</div>
</div>
</div>
<div class="thin float_clear" id="other_reports_stats_details">
<div class="two_columns pad">
<?
if (check_perms('admin_reports')) {
$DB->query("
<div class="Permissions" id="other_reports_stats_details">
<div class="permission_container">
<?
if (check_perms('admin_reports')) {
$DB->query("
SELECT um.Username,
COUNT(r.ID) AS Reports
FROM reports AS r
@@ -27,29 +28,82 @@ View::show_header(t('server.reports.other_reports_stats'), '', 'PageReportStat')
AND r.ReportedTime > NOW() - INTERVAL 24 HOUR
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><strong><?= t('server.reports.reports_resolved_in_the_last_24_hours') ?></strong></h3>
<table class="Table">
<tr class="Table-row">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reports.reports_resolved_in_the_last_24_hours') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
$DB->query("
SELECT um.Username,
COUNT(r.ID) AS Reports
FROM reports AS r
JOIN users_main AS um ON um.ID = r.ResolverID
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reports.reports_resolved_since_other_reports') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<?
} /* if (check_perms('admin_reports')) */ ?>
</div>
<div class="permission_container">
<?
$DB->query("
SELECT um.Username,
@@ -62,27 +116,87 @@ View::show_header(t('server.reports.other_reports_stats'), '', 'PageReportStat')
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><strong><?= t('server.reports.reports_resolved_in_the_last_week') ?></strong></h3>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell" number_column"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reports.reports_resolved_in_the_last_week') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell" number_column"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<?
$TrashForumIDs = '12';
$DB->query("
SELECT u.Username,
COUNT(f.LastPostAuthorID) as Trashed
FROM forums_topics AS f
LEFT JOIN users_main AS u ON u.ID = f.LastPostAuthorID
WHERE f.ForumID IN ($TrashForumIDs)
GROUP BY f.LastPostAuthorID
ORDER BY Trashed DESC
LIMIT 30");
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reports.threads_trashed_since_the_beginning_of_time') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell Table-cellRight"><?= t('server.reports.place') ?></td>
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.trashed') ?></td>
</tr>
<?
$i = 1;
foreach ($Results as $Result) {
list($Username, $Trashed) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell Table-cellRight"><?= $i ?></td>
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Trashed) ?></td>
</tr>
<?
$i++;
}
?>
</table>
</div>
</div>
</div>
<div class="permission_container">
<?
$DB->query("
SELECT um.Username,
@@ -95,106 +209,39 @@ View::show_header(t('server.reports.other_reports_stats'), '', 'PageReportStat')
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><strong><?= t('server.reports.reports_resolved_in_the_last_month') ?></strong></h3>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
<?
$DB->query("
SELECT um.Username,
COUNT(r.ID) AS Reports
FROM reports AS r
JOIN users_main AS um ON um.ID = r.ResolverID
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><strong><?= t('server.reports.reports_resolved_since_other_reports') ?></strong></h3>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
<?
} /* if (check_perms('admin_reports')) */ ?>
</div>
<div class="two_columns pad">
<?
$TrashForumIDs = '12';
$DB->query("
SELECT u.Username,
COUNT(f.LastPostAuthorID) as Trashed
FROM forums_topics AS f
LEFT JOIN users_main AS u ON u.ID = f.LastPostAuthorID
WHERE f.ForumID IN ($TrashForumIDs)
GROUP BY f.LastPostAuthorID
ORDER BY Trashed DESC
LIMIT 30");
$Results = $DB->to_array();
?>
<h3><strong><?= t('server.reports.threads_trashed_since_the_beginning_of_time') ?></strong></h3>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell Table-cellRight"><?= t('server.reports.place') ?></td>
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.trashed') ?></td>
</tr>
<?
$i = 1;
foreach ($Results as $Result) {
list($Username, $Trashed) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell Table-cellRight"><?= $i ?></td>
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Trashed) ?></td>
</tr>
<?
$i++;
}
?>
</table>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reports.reports_resolved_in_the_last_month') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reports.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reports.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Username ?></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
</div>
</div>
</div>
<?
View::show_footer();
?>

View File

@@ -28,8 +28,8 @@ $Owner = display_str($Owner);
<h2 class="BodyHeader-nav"><?= t('server.reportsv2.reports_v2_information') ?></h2>
<? include('header.php'); ?>
</div>
<div class="thin float_clear">
<div class="two_gigcolumns pad">
<div class="Permissions">
<div class="permission_container">
<?
$DB->query("
SELECT
@@ -43,30 +43,36 @@ $Owner = display_str($Owner);
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><?= t('server.reportsv2.time_d') ?></h3>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.time_d') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
}
?>
</table>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<?
}
?>
</table>
</div>
</div>
<?
$DB->query("
@@ -81,31 +87,40 @@ $Owner = display_str($Owner);
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><?= t('server.reportsv2.time_w') ?></h3>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.time_w') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
}
?>
</table>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<?
}
?>
</table>
</div>
</div>
</div>
<div class="permission_container">
<?
$DB->query("
SELECT
@@ -119,32 +134,39 @@ $Owner = display_str($Owner);
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><?= t('server.reportsv2.time_m') ?></h3>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.time_m') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
}
?>
</table>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<?
}
?>
</table>
</div>
</div>
<?
$DB->query("
SELECT
um.ID,
@@ -156,33 +178,39 @@ $Owner = display_str($Owner);
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<h3><?= t('server.reportsv2.time_a') ?></h3>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.time_a') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.username') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.reports') ?></td>
</tr>
<?
}
?>
</table>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell"><a href="reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td class="Table-cell Table-cellRight"><?= number_format($Reports) ?></td>
</tr>
<?
}
?>
</table>
</div>
</div>
</div>
<div class="two_columns pad">
<div class="permission_container">
<?
$DB->query("
SELECT
@@ -196,72 +224,84 @@ $Owner = display_str($Owner);
$Staff = $DB->to_array();
?>
<h3><?= t('server.reportsv2.currently_assigned_reports_by_staff_member') ?></h3>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.staff_member') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.current_count') ?></td>
</tr>
<?
foreach ($Staff as $Array) {
if ($Array['Username'] == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell">
<a href="reportsv2.php?view=staff&amp;id=<?= $Array['ResolverID'] ?>"><?= display_str($Array['Username']) ?><?= t('server.reportsv2.s_reports') ?></a>
</td>
<td class="Table-cell Table-cellRight"><?= number_format($Array['Count']) ?></td>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.currently_assigned_reports_by_staff_member') ?>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.staff_member') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.current_count') ?></td>
</tr>
<? } ?>
</table>
<?
foreach ($Staff as $Array) {
if ($Array['Username'] == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr class="Table-row">
<td class="Table-cell">
<a href="reportsv2.php?view=staff&amp;id=<?= $Array['ResolverID'] ?>"><?= display_str($Array['Username']) ?><?= t('server.reportsv2.s_reports') ?></a>
</td>
<td class="Table-cell Table-cellRight"><?= number_format($Array['Count']) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<h3><?= t('server.reportsv2.different_view_modes_by_report_type') ?></h3>
<?
$DB->query("
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.reportsv2.different_view_modes_by_report_type') ?>
</div>
</div>
<div class="Group-body">
<?
$DB->query("
SELECT
Type,
COUNT(ID) AS Count
FROM reportsv2
WHERE Status = 'New'
GROUP BY Type");
$Current = $DB->to_array();
if (!empty($Current)) {
?>
<div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.type') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.current_count') ?></td>
</tr>
<?
foreach ($Current as $Array) {
//Ugliness
foreach ($Types as $Category) {
if (!empty($Category[$Array['Type']])) {
$Title = $Category[$Array['Type']]['title'];
break;
}
}
?>
<tr class="Table-row" <?= $Title === 'Urgent' ? ' style="font-weight: bold;"' : '' ?>>
<td class="Table-cell">
<a href="reportsv2.php?view=type&amp;id=<?= display_str($Array['Type']) ?>"><?= display_str($Title) ?></a>
</td>
<td class="Table-cell Table-cellRight">
<?= number_format($Array['Count']) ?>
</td>
</tr>
<?
}
}
$Current = $DB->to_array();
if (!empty($Current)) {
?>
</table>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.reportsv2.type') ?></td>
<td class="Table-cell Table-cellRight"><?= t('server.reportsv2.current_count') ?></td>
</tr>
<?
foreach ($Current as $Array) {
//Ugliness
foreach ($Types as $Category) {
if (!empty($Category[$Array['Type']])) {
$Title = $Category[$Array['Type']]['title'];
break;
}
}
?>
<tr class="Table-row" <?= $Title === 'Urgent' ? ' style="font-weight: bold;"' : '' ?>>
<td class="Table-cell">
<a href="reportsv2.php?view=type&amp;id=<?= display_str($Array['Type']) ?>"><?= display_str($Title) ?></a>
</td>
<td class="Table-cell Table-cellRight">
<?= number_format($Array['Count']) ?>
</td>
</tr>
<?
}
}
?>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -91,7 +91,7 @@ View::show_header(t('server.requests.view_request') . ": $FullName", 'comments,b
<a href="reports.php?action=report&amp;type=request_update&amp;id=<?= $RequestID ?>" class="brackets"><?= t('server.requests.request_update') ?></a>
<? } ?>
<?
$google_url = "https://www.blu-ray.com/search/?quicksearch=1&quicksearch_country=all&section=bluraymovies&quicksearch_keyword=" . $Request['Name'];
$google_url = "https://www.blu-ray.com/search/?quicksearch=1&quicksearch_country=all&section=bluraymovies&quicksearch_keyword=" . display_str($Request['Name']);
?>
<a target="_blank" href="<? echo $google_url; ?>" class="brackets"><?= t('server.requests.find_in_stores') ?></a>
</div>

View File

@@ -4,7 +4,7 @@ $DB->query("INSERT INTO users_geodistribution
(Code, Users)
SELECT g.Code, COUNT(u.ID) AS Users
FROM geoip_country AS g
JOIN users_main AS u ON INET_ATON(u.IP) BETWEEN g.StartIP AND g.EndIP
JOIN users_main AS u ON INET6_ATON(u.IP) BETWEEN g.StartIP AND g.EndIP
WHERE u.Enabled = '1'
GROUP BY g.Code
ORDER BY Users DESC");

View File

@@ -74,116 +74,123 @@ View::show_header('Staff Inbox', 'PageStaffPMScoreboard');
$DB->prepared_query($BaseSQL, 1, 1, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_24_hours') ?></div>
<div class="Permissions">
<div class="permission_container">
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_24_hours') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_actions_total') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
<?php
$DB->prepared_query($BaseSQL, 7, 7, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="permission_container">
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_week') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
<?php
$DB->prepared_query($BaseSQL, 7, 7, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_week') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<?php
$DB->prepared_query($BaseSQL, 30, 30, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_month') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<?php
$DB->prepared_query($BaseSQL, 365000, 365000, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_actions_total') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
<?php
$DB->prepared_query($BaseSQL, 30, 30, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
<div class="permission_container">
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle"><?= t('server.staffpm.inbox_action_last_month') ?></div>
</div>
<div class="Group-body">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.staff.username') ?></td>
<td class="Table-cell"><?= t('server.staffpm.replies') ?></td>
<td class="Table-cell"><?= $COL ?></td>
</tr>
<?php
foreach ($Results as $Result) {
[$UserID, $Username, $Num, $Extra] = $Result;
?>
<tr>
<td><a href="/reportsv2.php?view=resolver&amp;id=<?= $UserID ?>"><?= $Username ?></a></td>
<td><?= $Num ?></td>
<td><?= $Extra ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<?php
$DB->prepared_query($BaseSQL, 365000, 365000, $LoggedUser['Class'], ...$SupportStaff);
$Results = $DB->to_array();
?>
</div>
</div>
</div>
<?php
View::show_footer();
<?php
View::show_footer();

View File

@@ -143,11 +143,11 @@ $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
<td class="Table-cell">
<span><?= display_str($IP) ?></span>
(<span><?= display_str($Uses) ?></span>)
<span style="float:right"><a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>" data-tooltip="<?= t('server.tools.history') ?>" class="brackets">H</a> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($IP) ?>" data-tooltip="<?= t('server.common.search') ?>" class="brackets">S</a> <a href="http://whatismyipaddress.com/ip/<?= display_str($IP) ?>" data-tooltip="<?= t('server.tools.wi') ?>" class="brackets">WI</a></span><br />
<span style="float:right"><a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>" data-tooltip="<?= t('server.tools.history') ?>" class="brackets">H</a> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($IP) ?>" data-tooltip="<?= t('server.common.search') ?>" class="brackets">S</a> <a href="http://whatismyipaddress.com/ip/<?= display_str($IP) ?>" data-tooltip="<?= t('server.tools.wi') ?>" class="brackets" target="_blank">WI</a></span><br />
<span><?= display_str($InviterIP) ?></span>
<? if ($InviterIP) { ?>
(<span> <?= display_str($InviterUses) ?></span>)
<span style="float:right"> <a href="userhistory.php?action=ips&amp;userid=<?= $InviterID ?>" data-tooltip="<?= t('server.tools.history') ?>" class="brackets">H</a> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($InviterIP) ?>" data-tooltip="<?= t('server.common.search') ?>" class="brackets">S</a> <a href="http://whatismyipaddress.com/ip/<?= display_str($InviterIP) ?>" data-tooltip="<?= t('server.tools.wi') ?>" class="brackets">WI</a></span><br />
<span style="float:right"> <a href="userhistory.php?action=ips&amp;userid=<?= $InviterID ?>" data-tooltip="<?= t('server.tools.history') ?>" class="brackets">H</a> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($InviterIP) ?>" data-tooltip="<?= t('server.common.search') ?>" class="brackets">S</a> <a href="http://whatismyipaddress.com/ip/<?= display_str($InviterIP) ?>" data-tooltip="<?= t('server.tools.wi') ?>" class="brackets" target="_blank">WI</a></span><br />
<? } ?>
</td>
<td class="Table-cell">

View File

@@ -26,9 +26,9 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
<?= t('server.tools.service') ?>
</div>
<div class="Box-body">
<ul class="List">
<ul class="MenuList">
<li><strong><?= t('server.tools.threads_active') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<?= t('server.tools.cache') ?>: <?= number_format($MemStats['threads']) ?> <span>(100.000%)</span>
</li>
@@ -43,7 +43,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</li>
<li>
<strong><?= t('server.tools.connections') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<?= t('server.tools.cache') ?>:
<?= number_format($MemStats['total_connections']) ?>
@@ -56,7 +56,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</li>
<li>
<strong><?= t('server.tools.cache_usage') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<?= t('server.tools.cashe_current_index') ?>:
<?= number_format($MemStats['curr_items']) ?></span>
@@ -81,9 +81,9 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
<?= t('server.tools.activity') ?>
</div>
<div class="Box-body">
<ul class="List">
<ul class="MenuList">
<li><strong><?= t('server.tools.total_reads') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<?= t('server.tools.cache') ?>:
<?= number_format($MemStats['cmd_get']) ?>
@@ -95,7 +95,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.total_writes') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<?= t('server.tools.cache') ?>:
<?= number_format($MemStats['cmd_set']) ?>
@@ -107,7 +107,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.get_select_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span data-tooltip="<?= t('server.tools.cache_hit_rate') ?>"><?= t('server.tools.cache') ?>:</span>
<span class="<?= $MemStats['get_hits'] / $MemStats['cmd_get'] < 0.7 ? "u-colorWarning" : "" ?>"><?= number_format($MemStats['get_hits']) ?> <span>(<?= number_format(($MemStats['get_hits'] / $MemStats['cmd_get']) * 100, 3); ?>%)</span></span>
@@ -119,7 +119,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.set_insert_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<?= number_format($MemStats['cmd_set']) ?> <span>(100.000%)</span>
@@ -131,7 +131,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.increment_decrement_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache_increment') ?>:</span>
<span class="<?= $MemStats['incr_hits'] / ($MemStats['incr_hits'] + $MemStats['incr_misses']) < 0.7 ? "u-colorWarning" : "" ?>"><?= number_format($MemStats['incr_hits']) ?> <span>(<?= number_format(($MemStats['incr_hits'] / ($MemStats['incr_hits'] + $MemStats['incr_misses'])) * 100, 3); ?>%)</span></span>
@@ -143,7 +143,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.cas_update_success') ?></strong>:
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span class="<? if ($MemStats['cas_hits'] > 0 && $MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses']) < 0.7) {
@@ -163,7 +163,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.delete_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span class="<? if ($MemStats['delete_hits'] / ($MemStats['delete_hits'] + $MemStats['delete_misses']) < 0.7) {
@@ -178,7 +178,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</li>
<li><strong><?= t('server.tools.data_read') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= Format::get_size($MemStats['bytes_read']) ?> </span>
@@ -190,7 +190,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.data_write') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= Format::get_size($MemStats['bytes_written']) ?> </span>
@@ -202,7 +202,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.others') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache_flushes') ?>:</span>
<span class="Table-cell <? if ($MemStats['cmd_flush'] > $MemStats['uptime'] / 7 * 24 * 3600) {
@@ -229,9 +229,9 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
<?= t('server.tools.concurrency') ?>
</div>
<div class="Box-body">
<ul class="List">
<ul class="MenuList">
<li><strong><?= t('server.tools.total_reads') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span class="<? if (($MemStats['cmd_get'] / $MemStats['uptime']) * 5 < $DBStats['Com_select']['Value'] / $DBStats['Uptime']['Value']) {
@@ -245,7 +245,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.total_writes') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span class="<? if (($MemStats['cmd_set'] / $MemStats['uptime']) * 5 < ($DBStats['Com_insert']['Value'] + $DBStats['Com_update']['Value']) / $DBStats['Uptime']['Value']) {
@@ -259,7 +259,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.get_select') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= number_format($MemStats['get_hits'] / $MemStats['uptime'], 5) ?>/s </span>
@@ -271,7 +271,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.set_insert') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= number_format($MemStats['cmd_set'] / $MemStats['uptime'], 5) ?>/s </span>
@@ -283,7 +283,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.increment_decrement_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache_increment') ?>:</span>
<span><?= number_format($MemStats['incr_hits'] / $MemStats['uptime'], 5) ?>/s</span>
@@ -295,7 +295,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.cas_updates') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= number_format($MemStats['cas_hits'] / $MemStats['uptime'], 5) ?>/s</span>
@@ -307,7 +307,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.delete_success') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= number_format($MemStats['delete_hits'] / $MemStats['uptime'], 5) ?>/s</span>
@@ -319,7 +319,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.others') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache_flushes') ?>:</span>
<span><?= number_format($MemStats['cmd_flush'] / $MemStats['uptime'], 5) ?>/s</span>
@@ -335,7 +335,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.data_read') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= Format::get_size($MemStats['bytes_read'] / $MemStats['uptime']) ?>/s</span>
@@ -347,7 +347,7 @@ View::show_header(t('server.tools.service_stats'), '', 'PageToolSericeStat');
</ul>
</li>
<li><strong><?= t('server.tools.data_write') ?></strong>
<ul class="List">
<ul class="MenuList SubMenu">
<li>
<span><?= t('server.tools.cache') ?>:</span>
<span><?= Format::get_size($MemStats['bytes_written'] / $MemStats['uptime']) ?>/s</span>

View File

@@ -25,10 +25,23 @@ if (!$HaveData) {
$client->run();
}
$FileNameIPv4HexBlocks = "$Dir/GeoLite2-City-CSV/GeoLite2-City-Blocks-IPv4-Hex.csv";
$FileNameIPv6HexBlocks = "$Dir/GeoLite2-City-CSV/GeoLite2-City-Blocks-IPv6-Hex.csv";
if (!file_exists($FileNameLocation) || !file_exists($FileNameIPv4Blocks) || !file_exists($FileNameIPv6Blocks)) {
// TODO by qwerty i18N
error('Download or extraction of maxmind database failed');
}
if (!file_exists($FileNameIPv4HexBlocks) || !file_exists($FileNameIPv6HexBlocks)) {
$BinPath = CONFIG['SERVER_ROOT'] . '/.bin';
shell_exec("$BinPath/geoip2-csv-converter -block-file $FileNameIPv4Blocks -include-hex-range -output-file $FileNameIPv4HexBlocks");
shell_exec("$BinPath/geoip2-csv-converter -block-file $FileNameIPv6Blocks -include-hex-range -output-file $FileNameIPv6HexBlocks");
}
if (!file_exists($FileNameIPv4HexBlocks) || !file_exists($FileNameIPv6HexBlocks)) {
error('Convert maxmind CSV to Hex failed');
}
View::show_header(t('server.tools.update_geoip'), '', 'PageToolUpdateGeoIP');
?>
@@ -61,42 +74,56 @@ SET `ID`=@ID, `Country`=@Country, `City`=@City;");
$DB->prepared_query("
CREATE TEMPORARY TABLE temp_geoip_blocks (
`Network` varchar(32) DEFAULT NULL,
`LocID` INT(10) NOT NULL
network_start varbinary(16) not null,
network_end varbinary(16) not null,
geoname_id INT(10) NOT NULL
)");
// Note: you cannot use a prepared query here for this
$DB->query("
LOAD DATA LOCAL INFILE '{$FileNameIPv4Blocks}' INTO TABLE temp_geoip_blocks
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(@Network, @LocID, @dummy, @dummy, @dummy, @dummy, @dummy, @dummy, @dummy, @dummy)
SET `Network`=@Network, `LocID`=@LocID;");
load data local infile '{$FileNameIPv4HexBlocks}' into table temp_geoip_blocks
fields terminated by ',' enclosed by '\"' lines terminated by '\n' ignore 1 rows
(@network_start, @network_end, @geoname_id, @dummy, @dummy,
@dummy, @dummy, @dummy, @dummy, @dummy, @dummy)
set network_start = unhex(@network_start),
network_end = unhex(@network_end),
geoname_id = nullif(@geoname_id, '');
");
// Note: you cannot use a prepared query here for this
$DB->query("
load data local infile '{$FileNameIPv6HexBlocks}'
into table temp_geoip_blocks
fields terminated by ',' enclosed by '\"' lines terminated by '\n' ignore 1 rows
(@network_start, @network_end, @geoname_id, @dummy, @dummy,
@dummy, @dummy, @dummy, @dummy, @dummy, @dummy)
set network_start = unhex(@network_start),
network_end = unhex(@network_end),
geoname_id = nullif(@geoname_id, '');
");
$DB->prepared_query("
INSERT INTO geoip_country (StartIP, EndIP, Code)
SELECT
INET_ATON( SUBSTRING_INDEX(Network, '/', 1)) & 0xffffffff ^ ((0x1 << ( 32 - SUBSTRING_INDEX(Network, '/', -1)) ) -1 ) as StartIP,
INET_ATON( SUBSTRING_INDEX(Network, '/', 1)) | ((0x100000000 >> SUBSTRING_INDEX(Network, '/', -1) ) -1 ) as EndIP,
network_start ,
network_end,
Country
FROM temp_geoip_blocks AS tgb
LEFT JOIN temp_geoip_locations AS tgl ON tgb.LocID = tgl.ID
LEFT JOIN temp_geoip_locations AS tgl ON tgb.geoname_id = tgl.ID
");
print "{$DB->affected_rows()} locations inserted";
print "{$DB->affected_rows()} locations inserted, ";
$DB->query("INSERT INTO users_geodistribution
(Code, Users)
SELECT g.Code, COUNT(u.ID) AS Users
FROM geoip_country AS g
JOIN users_main AS u ON INET_ATON(u.IP) BETWEEN g.StartIP AND g.EndIP
JOIN users_main AS u ON INET6_ATON(u.IP) BETWEEN g.StartIP AND g.EndIP
WHERE u.Enabled = '1'
GROUP BY g.Code
ORDER BY Users DESC");
print "{$DB->affected_rows()} users updated";
print "{$DB->affected_rows()} users updated.";
?>
</div>

View File

@@ -1,6 +1,6 @@
<?
include(CONFIG['SERVER_ROOT'] . '/sections/tools/managers/award_functions.php');
View::show_header(t('server.tools.work_statistical_graph'), '', 'PageToolAward');
View::show_header(t('server.pub.statistics'), '', 'PageToolAward');
$Year = isset($_GET['year']) ? intval($_GET['year']) : 0;
$Quarter = isset($_GET['quarter']) ? intval($_GET['quarter']) : 0;
$Month = isset($_GET['month']) ? intval($_GET['month']) : 0;
@@ -16,46 +16,54 @@ if ($Quarter && $Month) {
}
$QUARTER = array("", t('server.tools.quarter_1'), t('server.tools.quarter_2'), t('server.tools.quarter_3'), t('server.tools.quarter_4'));
?>
<h2><?= t('server.tools.statistical_settlement_time_dividing_query_panel') ?></h2>
<table style="width: auto;" id="table-select">
<?
printYearTR(2019, ($Month || $Quarter) ? 0 : $Year);
printQuarterTR($Year, $Quarter);
printMonthTR($Year, $Month);
?>
</table>
<div class="LayoutBody">
<div class="BodyHeader">
<h2 class="BodyHeader-nav"><?= t('server.pub.statistics') ?></h2>
</div>
<?
$Time = timeConvert($Year, $Quarter, $Month);
$AwardDatas = [
getAwardData("Sysop", $Time),
getAwardData("Administrator", $Time),
getAwardData("Developer", $Time),
getAwardData("Senior Moderator", $Time),
getAwardData("Moderator", $Time),
getAwardData("Torrent Moderator", $Time),
getAwardData("Forum Moderator", $Time),
getAwardData("Torrent Inspector", $Time),
getAwardData("First Line Support", $Time),
getAwardData("Interviewer", $Time),
getAwardData("Translators", $Time),
];
$MaxValue = [
'DownloadCount' => 0,
'UploadCount' => 0,
'CheckCount' => 0,
'RSReportCount' => 0,
'RPReportCount' => 0,
'EditCount' => 0,
'PostCount' => 0,
'SendJF' => 0,
'Point' => 0,
'ApplyCount' => 0,
];
makePoint($AwardDatas, $Bases, $PointRadios, $MaxValue);
//print_r ($AwardDatas);
?>
<!--
<h2 id="award-title" style="text-align: center;"><?= t('server.tools.year', ['Values' => [$Year]]) . ($Month ? t('server.tools.month', ['Values' => [$Month]]) : "") . ($Quarter ? "$QUARTER[$Quarter]" : "") ?></h2>
<div class="BoxBody">
<table id="table-select">
<?
printYearTR(2021, ($Month || $Quarter) ? 0 : $Year);
printQuarterTR($Year, $Quarter);
printMonthTR($Year, $Month);
?>
</table>
</div>
<?
$Time = timeConvert($Year, $Quarter, $Month);
$AwardDatas = [
getAwardData("Sysop", $Time),
getAwardData("Administrator", $Time),
getAwardData("Developer", $Time),
getAwardData("Senior Moderator", $Time),
getAwardData("Moderator", $Time),
getAwardData("Torrent Moderator", $Time),
getAwardData("Forum Moderator", $Time),
getAwardData("Torrent Inspector", $Time),
getAwardData("First Line Support", $Time),
getAwardData("Interviewer", $Time),
getAwardData("Translators", $Time),
];
$MaxValue = [
'DownloadCount' => 0,
'UploadCount' => 0,
'CheckCount' => 0,
'RSReportCount' => 0,
'RPReportCount' => 0,
'EditCount' => 0,
'PostCount' => 0,
'SendJF' => 0,
'Point' => 0,
'ApplyCount' => 0,
];
makePoint($AwardDatas, $Bases, $PointRadios, $MaxValue);
//print_r ($AwardDatas);
?>
<!--
<script>
$(document).ready(function() {
var top = $('#table-head-top').offset().top - parseFloat($('#table-head-top').css('marginTop').replace(/auto/, 0))
@@ -70,101 +78,101 @@ $(document).ready(function() {
})
</script>
-->
<h2 id="award-title" style="text-align: center;"><?= t('server.tools.year', ['Values' => [$Year]]) . ($Month ? t('server.tools.month', ['Values' => [$Month]]) : "") . ($Quarter ? "$QUARTER[$Quarter]" : "") ?></h2>
<p style="font-size: 14px;text-align: right;"><?= t('server.tools.explanation_thread') ?></p>
<div id="salary-table">
<div id="table-head-left">
<div class="row1 th-span1 row-span-2"><?= t('server.tools.group') ?></div>
<div class="row1 th-span1 row-span-2"><?= t('server.tools.id') ?></div>
<?
$row = 2;
$PutoutUsersIDs = [];
foreach ($AwardDatas as $data) {
$first = true;
$headLeftUsers = "";
$rowspan = 0;
foreach ($data['Users'] as $User) {
if (!in_array($User['UserID'], $PutoutUsersIDs)) {
if ($first) {
$first = false;
}
$row++;
$DivClassName = "row" . ($row % 2 ? "even" : "odd");
$PutoutUsersIDs[] = $User['UserID'];
$rowspan++;
$headLeftUsers .= "<div class=\"$DivClassName div-username\">" . Users::format_username($User['UserID'], false, false, false) . "</div>";
}
}
if (!$first) {
$GroupNameMap = ['Moderator' => 'Mod', 'Torrent Moderator' => 'TM', 'Forum Moderator' => 'FM', 'Torrent Inspector' => 'TI', 'First Line Support' => 'FLS', 'Interviewer' => 'IN', 'Translators' => 'TL', 'Senior Moderator' => 'SM', 'Developer' => 'Dev', 'Administrator' => 'AD'];
if (isset($GroupNameMap[$data['GroupName']])) {
echo "<div class=\"group-name\" style=\"grid-row-start: span $rowspan;\" data-tooltip=\"" . $data['GroupName'] . "\">" . $GroupNameMap[$data['GroupName']] . "</div>";
} else {
echo "<div class=\"group-name\" style=\"grid-row-start: span $rowspan;\">" . $data['GroupName'] . "</div>";
}
echo $headLeftUsers;
}
}
?>
</div>
<div id="table-right-scroll">
<div id="table-head-top" style="grid-template-columns: repeat(15, 1fr);">
<div class="row1 th-span2"><?= t('server.tools.data') ?></div>
<div class="row1 th-span4"><?= t('server.tools.torrent_management') ?></div>
<div class="row1 th-span4"><?= t('server.tools.site_activities') ?></div>
<div class="row1 th-span1"><?= t('server.tools.others') ?></div>
<div class="row1 col-tail th-span4"><?= t('server.tools.wage_statistics') ?></div>
<div class="row2 th-span1"><?= t('server.tools.snatches') ?></div>
<div class="row2 th-span1"><?= t('server.tools.uploads') ?></div>
<div class="row2 th-span1"><?= t('server.tools.checks') ?></div>
<div class="row2 th-span1"><?= t('server.tools.reports_submitted') ?></div>
<div class="row2 th-span1"><?= t('server.tools.reports_handled') ?></div>
<div class="row2 th-span1"><?= t('server.tools.edit_requests_handled') ?></div>
<div class="row2 th-span1"><?= t('server.tools.posts') ?></div>
<div class="row2 th-span1"><?= t('server.tools.rewarded_times') ?></div>
<div class="row2 th-span1"><?= t('server.tools.qq_group') ?></div>
<div class="row2 th-span1"><?= t('server.tools.tg_group') ?></div>
<div class="row2 th-span1"><?= t('server.tools.examined') ?></div>
<div class="row2 th-span1"><?= t('server.tools.total_points') ?></div>
<div class="row2 th-span1"><?= t('server.tools.floating_wage') ?></div>
<div class="row2 th-span1"><?= t('server.tools.base_salary') ?></div>
<div class="row2 th-span1 col-tail"><?= t('server.tools.total_wages') ?></div>
</div>
<div id="table-content" style="grid-template-columns: repeat(15, 1fr);">
<div id="salary-table">
<div id="table-head-left">
<div class="row1 th-span1 row-span-2"><?= t('server.tools.group') ?></div>
<div class="row1 th-span1 row-span-2"><?= t('server.tools.id') ?></div>
<?
$row = 2;
$PutoutUsersIDs = [];
$Gear = ["", t('server.tools.grade_1'), t('server.tools.grade_2'), t('server.tools.grade_3'), t('server.tools.grade_4'), t('server.tools.grade_5')];
foreach ($AwardDatas as $data) {
$first = true;
$headLeftUsers = "";
$rowspan = 0;
foreach ($data['Users'] as $User) {
if (!in_array($User['UserID'], $PutoutUsersIDs)) {
if ($first) {
$first = false;
}
$row++;
$DivClassName = "row$row row" . ($row % 2 ? "even" : "odd");
$DivClassName = "row" . ($row % 2 ? "even" : "odd");
$PutoutUsersIDs[] = $User['UserID'];
?>
<div class="<?= $DivClassName ?>" <?= $MaxValue['DownloadCount'] && $MaxValue['DownloadCount'] == $User['DownloadCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['DownloadCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['UploadCount'] && $MaxValue['UploadCount'] == $User['UploadCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['UploadCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['CheckCount'] && $MaxValue['CheckCount'] == $User['CheckCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['CheckCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['RPReportCount'] && $MaxValue['RPReportCount'] == $User['RPReportCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['RPReportCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['RSReportCount'] && $MaxValue['RSReportCount'] == $User['RSReportCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['RSReportCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['EditCount'] && $MaxValue['EditCount'] == $User['EditCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['EditCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['PostCount'] && $MaxValue['PostCount'] == $User['PostCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['PostCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['SendJF'] && $MaxValue['SendJF'] == $User['SendJF'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['SendJF'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['QQCount'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['TGCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['ApplyCount'] && $MaxValue['ApplyCount'] == $User['ApplyCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['ApplyCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['Point'] && $MaxValue['Point'] == $User['Point'] ? " style=\"color: #d39911;\"" : "" ?>><strong><?= $User['Point'] ?></strong></div>
<div class="<?= $DivClassName ?>"><?= $User['Brokerage'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['Base'] ?></div>
<div class="<?= $DivClassName ?> col-tail" data-tooltip="<?= $Gear[$User['Gear']] ?>"><strong><?= $User['Salary'] ?></strong></div>
<?
$rowspan++;
$headLeftUsers .= "<div class=\"$DivClassName div-username\">" . Users::format_username($User['UserID'], false, false, false) . "</div>";
}
}
if (!$first) {
$GroupNameMap = ['Moderator' => 'Mod', 'Torrent Moderator' => 'TM', 'Forum Moderator' => 'FM', 'Torrent Inspector' => 'TI', 'First Line Support' => 'FLS', 'Interviewer' => 'IN', 'Translators' => 'TL', 'Senior Moderator' => 'SM', 'Developer' => 'Dev', 'Administrator' => 'AD'];
if (isset($GroupNameMap[$data['GroupName']])) {
echo "<div class=\"group-name\" style=\"grid-row-start: span $rowspan;\" data-tooltip=\"" . $data['GroupName'] . "\">" . $GroupNameMap[$data['GroupName']] . "</div>";
} else {
echo "<div class=\"group-name\" style=\"grid-row-start: span $rowspan;\">" . $data['GroupName'] . "</div>";
}
echo $headLeftUsers;
}
}
?>
</div>
<div id="table-right-scroll">
<div id="table-head-top" style="grid-template-columns: repeat(15, 1fr);">
<div class="row1 th-span2"><?= t('server.tools.data') ?></div>
<div class="row1 th-span4"><?= t('server.tools.torrent_management') ?></div>
<div class="row1 th-span4"><?= t('server.tools.site_activities') ?></div>
<div class="row1 th-span1"><?= t('server.tools.others') ?></div>
<div class="row1 col-tail th-span4"><?= t('server.tools.wage_statistics') ?></div>
<div class="row2 th-span1"><?= t('server.tools.snatches') ?></div>
<div class="row2 th-span1"><?= t('server.tools.uploads') ?></div>
<div class="row2 th-span1"><?= t('server.tools.checks') ?></div>
<div class="row2 th-span1"><?= t('server.tools.reports_submitted') ?></div>
<div class="row2 th-span1"><?= t('server.tools.reports_handled') ?></div>
<div class="row2 th-span1"><?= t('server.tools.edit_requests_handled') ?></div>
<div class="row2 th-span1"><?= t('server.tools.posts') ?></div>
<div class="row2 th-span1"><?= t('server.tools.rewarded_times') ?></div>
<div class="row2 th-span1"><?= t('server.tools.qq_group') ?></div>
<div class="row2 th-span1"><?= t('server.tools.tg_group') ?></div>
<div class="row2 th-span1"><?= t('server.tools.examined') ?></div>
<div class="row2 th-span1"><?= t('server.tools.total_points') ?></div>
<div class="row2 th-span1"><?= t('server.tools.floating_wage') ?></div>
<div class="row2 th-span1"><?= t('server.tools.base_salary') ?></div>
<div class="row2 th-span1 col-tail"><?= t('server.tools.total_wages') ?></div>
</div>
<div id="table-content" style="grid-template-columns: repeat(15, 1fr);">
<?
$row = 2;
$PutoutUsersIDs = [];
$Gear = ["", t('server.tools.grade_1'), t('server.tools.grade_2'), t('server.tools.grade_3'), t('server.tools.grade_4'), t('server.tools.grade_5')];
foreach ($AwardDatas as $data) {
foreach ($data['Users'] as $User) {
if (!in_array($User['UserID'], $PutoutUsersIDs)) {
$row++;
$DivClassName = "row$row row" . ($row % 2 ? "even" : "odd");
$PutoutUsersIDs[] = $User['UserID'];
?>
<div class="<?= $DivClassName ?>" <?= $MaxValue['DownloadCount'] && $MaxValue['DownloadCount'] == $User['DownloadCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['DownloadCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['UploadCount'] && $MaxValue['UploadCount'] == $User['UploadCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['UploadCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['CheckCount'] && $MaxValue['CheckCount'] == $User['CheckCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['CheckCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['RPReportCount'] && $MaxValue['RPReportCount'] == $User['RPReportCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['RPReportCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['RSReportCount'] && $MaxValue['RSReportCount'] == $User['RSReportCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['RSReportCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['EditCount'] && $MaxValue['EditCount'] == $User['EditCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['EditCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['PostCount'] && $MaxValue['PostCount'] == $User['PostCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['PostCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['SendJF'] && $MaxValue['SendJF'] == $User['SendJF'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['SendJF'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['QQCount'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['TGCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['ApplyCount'] && $MaxValue['ApplyCount'] == $User['ApplyCount'] ? " style=\"color: #d39911;\"" : "" ?>><?= $User['ApplyCount'] ?></div>
<div class="<?= $DivClassName ?>" <?= $MaxValue['Point'] && $MaxValue['Point'] == $User['Point'] ? " style=\"color: #d39911;\"" : "" ?>><strong><?= $User['Point'] ?></strong></div>
<div class="<?= $DivClassName ?>"><?= $User['Brokerage'] ?></div>
<div class="<?= $DivClassName ?>"><?= $User['Base'] ?></div>
<div class="<?= $DivClassName ?> col-tail" data-tooltip="<?= $Gear[$User['Gear']] ?>"><strong><?= $User['Salary'] ?></strong></div>
<?
}
}
}
?>
</div>
</div>
</div>
<div class="floatright"><?= t('server.tools.explanation_thread') ?></div>
</div>
<script>
function setCookie(cname, cvalue, exdays = 0) {

View File

@@ -77,7 +77,7 @@ function getLittleID($UserID) {
return 0;
}
function printYearTR($StartYear = 2019, $focus) {
function printYearTR($StartYear = 2021, $focus) {
$now = date("Y");
echo "<tr><th>年份:</th><td>";
for ($y = $StartYear; $y <= $now; $y++) {

View File

@@ -6,13 +6,13 @@ if (!check_perms('admin_manage_ipbans')) {
if (isset($_POST['submit'])) {
authorize();
$IPA = substr($_POST['start'], 0, strcspn($_POST['start'], '.'));
$IP = db_string($_POST['start']);
if ($_POST['submit'] == 'Delete') { //Delete
if (!is_number($_POST['id']) || $_POST['id'] == '') {
error(0);
}
$DB->query('DELETE FROM ip_bans WHERE ID=' . $_POST['id']);
$Cache->delete_value('ip_bans_' . $IPA);
$Cache->delete_value('ip_bans_' . $IP);
} else { //Edit & Create, Shared Validation
$Val->SetFields('start', '1', 'regex', 'You must include the starting IP address.', array('regex' => '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
$Val->SetFields('end', '1', 'regex', 'You must include the ending IP address.', array('regex' => '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
@@ -23,8 +23,8 @@ if (isset($_POST['submit'])) {
}
$Notes = db_string($_POST['notes']);
$Start = Tools::ip_to_unsigned($_POST['start']); //Sanitized by Validation regex
$End = Tools::ip_to_unsigned($_POST['end']); //See above
$Start = db_string($_POST['start']); //Sanitized by Validation regex
$End = db_string($_POST['end']); //See above
if ($_POST['submit'] == 'Edit') { //Edit
if (empty($_POST['id']) || !is_number($_POST['id'])) {
@@ -33,8 +33,8 @@ if (isset($_POST['submit'])) {
$DB->query("
UPDATE ip_bans
SET
FromIP=$Start,
ToIP='$End',
FromIP=INET6_ATON('$Start'),
ToIP=INET6_ATON('$End'),
Reason='$Notes'
WHERE ID='" . $_POST['id'] . "'");
} else { //Create
@@ -42,9 +42,9 @@ if (isset($_POST['submit'])) {
INSERT INTO ip_bans
(FromIP, ToIP, Reason)
VALUES
('$Start','$End', '$Notes')");
(INET6_ATON('$Start'),INET6_ATON('$End'), '$Notes')");
}
$Cache->delete_value('ip_bans_' . $IPA);
$Cache->delete_value('ip_bans_' . $IP);
}
header('tools.php?action=ip_ban');
}
@@ -56,8 +56,8 @@ $sql = "
SELECT
SQL_CALC_FOUND_ROWS
ID,
FromIP,
ToIP,
INET6_NTOA(FromIP),
INET6_NTOA(ToIP),
Reason
FROM ip_bans ";
@@ -67,9 +67,9 @@ if (!empty($_REQUEST['notes'])) {
if (!empty($_REQUEST['ip']) && preg_match('/' . IP_REGEX . '/', $_REQUEST['ip'])) {
if (!empty($_REQUEST['notes'])) {
$sql .= "AND '" . Tools::ip_to_unsigned($_REQUEST['ip']) . "' BETWEEN FromIP AND ToIP ";
$sql .= "AND INET6_ATON('" . $_REQUEST['ip'] . "') BETWEEN FromIP AND ToIP ";
} else {
$sql .= "WHERE '" . Tools::ip_to_unsigned($_REQUEST['ip']) . "' BETWEEN FromIP AND ToIP ";
$sql .= "WHERE INET6_ATON('" . $_REQUEST['ip'] . "') BETWEEN FromIP AND ToIP ";
}
}
@@ -160,8 +160,6 @@ $DB->set_query_id($Bans);
$Row = 'a';
while (list($ID, $Start, $End, $Reason) = $DB->next_record()) {
$Row = $Row === 'a' ? 'b' : 'a';
$Start = long2ip($Start);
$End = long2ip($End);
?>
<tr class="row<?= $Row ?>">
<form class="manage_form" name="ban" action="" method="post">

View File

@@ -4,7 +4,7 @@ if (!check_perms('admin_manage_ipbans')) {
error(403);
}
if (isset($_GET['perform'])) {
$IPv4Man = new \Gazelle\Manager\IPv4;
$IPv4Man = new \Gazelle\Manager\IP;
if ($_GET['perform'] == 'delete') {
$IPv4Man->removeBan((int)$_GET['id']);
} elseif ($_GET['perform'] == 'create') {

View File

@@ -64,8 +64,8 @@ $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
<td class="Table-cell"><?= Users::format_username($UserID, true, true, true, true) ?></td>
<td class="Table-cell">
<?= Tools::get_host_by_ajax($IP) . " ($IP)" ?>
<a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets"><?= t('server.tools.history') ?></a>
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($IP) ?>" data-tooltip="" class="brackets"><?= t('server.common.search') ?></a>
<a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets">H</a>
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($IP) ?>" data-tooltip="" class="brackets">S</a>
</td>
<td class="Table-cell"><?= display_str($Uses) ?></td>
<td class="Table-cell"><?= time_diff($Joined) ?></td>

View File

@@ -4,19 +4,18 @@ if (!check_perms('admin_manage_ipbans')) {
error(403);
}
if (isset($_GET['perform'])) {
$IPA = substr($_GET['ip'], 0, strcspn($_GET['ip'], '.'));
$IP = db_string($_GET['ip']);
if ($_GET['perform'] == 'delete') {
if (!is_number($_GET['id']) || $_GET['id'] == '') {
error(0);
}
$DB->query('DELETE FROM ip_bans WHERE ID=' . $_GET['id']);
$Bans = $Cache->delete_value('ip_bans_' . $IPA);
$Bans = $Cache->delete_value('ip_bans_' . $IP);
} elseif ($_GET['perform'] == 'create') {
$Notes = db_string($_GET['notes']);
$IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
$DB->query("
INSERT INTO ip_bans (FromIP, ToIP, Reason)
VALUES ('$IP','$IP', '$Notes')");
$Cache->delete_value('ip_bans_' . $IPA);
VALUES (INET6_ATON('$IP'),INET6_ATON('$IP'), '$Notes')");
$Cache->delete_value('ip_bans_' . $IP);
}
}

View File

@@ -2,14 +2,7 @@
enforce_login();
if (!check_perms('site_top10')) {
View::show_header('', '', 'PageTop10Index');
?>
<div class="content_basiccontainer">
<?= t('server.top10.you_do_not_have_access_to_view_this_feature') ?>
</div>
<?
View::show_footer();
die();
error(403);
}
include(CONFIG['SERVER_ROOT'] . '/sections/torrents/functions.php'); //Has get_reports($TorrentID);
@@ -43,4 +36,3 @@ if (empty($_GET['type']) || $_GET['type'] == 'movies') {
break;
}
}
?>

View File

@@ -59,7 +59,7 @@ function gen_list($FileList, $Root = false) {
return;
}
?>
<ul class="TorrentDetailfileList-fileList">
<ul class="<?= $Root ? 'MenuList' : 'MenuList SubMenu' ?> TorrentDetailfileList-fileList">
<? foreach ($FileList as $Name => $File) {
?>
<li class="TorrentDetailfileListItem-fileListItem" variant="<?= $Root ? 'root' : '' ?>">

View File

@@ -247,7 +247,7 @@ if ((empty($_GET['search']) || trim($_GET['search']) === '') && $Order != 'Name'
Snatched int(10) unsigned,
Name mediumtext,
Size bigint(12) unsigned,
PRIMARY KEY (TorrentID)) CHARSET=utf8");
PRIMARY KEY (TorrentID)) CHARSET=utf8mb4");
$DB->query("
INSERT IGNORE INTO temp_sections_torrents_user
SELECT

View File

@@ -235,7 +235,7 @@ if ((empty($_GET['search']) || trim($_GET['search']) === '') && $Order != 'Name'
snatched bigint(20) unsigned,
active tinyint(1),
remaining bigint(20) unsigned,
PRIMARY KEY (TorrentID)) CHARSET=utf8");
PRIMARY KEY (TorrentID)) CHARSET=utf8mb4");
$DB->query("
INSERT IGNORE INTO temp_sections_torrents_user
SELECT

File diff suppressed because it is too large Load Diff

View File

@@ -58,56 +58,67 @@ $OverrideClass = $Override === 2 ? 'paranoia_override' : '';
</div>
<ul class="SidebarList SidebarItem-body Box-body">
<li class="SidebarList-item isForumTopicCount" id="forum-topic-count-value" data-value="<?= $ForumTopics ?>">
<span><?= t('server.user.community_topic') ?>: </span>
<?= number_format($ForumTopics) ?>
<span>
<?= t('server.user.community_topic') ?>
: </span>
<a class="brackets" href="userhistory.php?action=topics&amp;userid=<?= $UserID ?>">
<?= t('server.user.view') ?>
<?= number_format($ForumTopics) ?>
</a>
</li>
<li class="SidebarList-item isForumThreadCount" id="forum-thread-count-value" data-value="<?= $ForumPosts ?>">
<span><?= t('server.user.community_pots') ?>: </span>
<?= number_format($ForumPosts) ?>
<a class="brackets" href="userhistory.php?action=posts&amp;userid=<?= $UserID ?>">
<?= t('server.user.view') ?>
<span>
<?= t('server.user.community_pots') ?>
: </span>
<a class="brackets" href="userhistory.php?action=posts&amp;userid=<?= $UserID ?>&showunread=0&group=0">
<?= number_format($ForumPosts) ?>
</a>
</li>
<? if ($Override = check_paranoia_here('torrentcomments+')) { ?>
<li class="SidebarList-item isTorrentCommentCount <?= $OverrideClass ?>" id="torrent-comment-count-value" data-value="<?= $NumComments ?>">
<span><?= t('server.user.community_comms') ?>: </span>
<?= number_format($NumComments) ?>
<span>
<?= t('server.user.community_comms') ?>:
</span>
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
<a href="comments.php?id=<?= $UserID ?>" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumComments) ?>
</a>
<? } else { ?>
<?= number_format($NumComments) ?>
<? } ?>
</li>
<li class="SidebarList-item isArtistCommentCount <?= $OverrideClass ?>" id="artist-comment-count-value" data-value="<?= $NumArtistComments ?>">
<span><?= t('server.user.community_arts') ?>: </span>
<?= number_format($NumArtistComments) ?>
<span>
<?= t('server.user.community_arts') ?>:
</span>
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
<a href="comments.php?id=<?= $UserID ?>&amp;action=artist" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumArtistComments) ?>
</a>
<? } else { ?>
<?= number_format($NumArtistComments) ?>
<? } ?>
</li>
<? if (CONFIG['ENABLE_COLLAGES']) { ?>
<li class="SidebarList-item isCollageCommentCount <?= $OverrideClass ?>" id="collage-comment-count-value" data-value="<?= $NumCollageComments ?>">
<span><?= t('server.user.community_colls') ?>: </span>
<?= number_format($NumCollageComments) ?>
<span>
<?= t('server.user.community_colls') ?>: </span>
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
<a href="comments.php?id=<?= $UserID ?>&amp;action=collages" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumCollageComments) ?>
</a>
<? } else { ?>
<?= number_format($NumCollageComments) ?>
<? } ?>
</li>
<? } ?>
<li class="SidebarList-item isReqeustCommentCount <?= $OverrideClass ?>" id="request-comment-count-value" data-value="<?= $NumRequestComments ?>">
<span><?= t('server.user.community_reqs') ?>: </span>
<?= number_format($NumRequestComments) ?>
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
<a href="comments.php?id=<?= $UserID ?>&amp;action=requests" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumRequestComments) ?>
</a>
<? } else { ?>
<?= number_format($NumRequestComments) ?>
<? } ?>
</li>
<? } ?>
@@ -115,11 +126,12 @@ $OverrideClass = $Override === 2 ? 'paranoia_override' : '';
if (($Override = check_paranoia_here('collages+')) && CONFIG['ENABLE_COLLAGES']) { ?>
<li class="SidebarList-item isCollageCreateCount <?= $OverrideClass ?>" id="collage-create-count-value" data-value="<?= $NumCollages ?>">
<span><?= t('server.user.community_collstart') ?>: </span>
<?= number_format($NumCollages) ?>
<? if ($Override = check_paranoia_here('collages')) { ?>
<a href="collages.php?userid=<?= $UserID ?>" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumCollages) ?>
</a>
<? } else { ?>
<?= number_format($NumCollages) ?>
<? } ?>
</li>
<?
@@ -127,11 +139,12 @@ $OverrideClass = $Override === 2 ? 'paranoia_override' : '';
if (($Override = check_paranoia_here('collagecontribs+')) && CONFIG['ENABLE_COLLAGES']) { ?>
<li class="SidebarList-item isCollageContributeCount <?= $OverrideClass ?>" id="collage-countribute-count-value" data-value="<?= $NumCollageContribs ?>">
<span><?= t('server.user.community_collcontrib') ?>: </span>
<?= number_format($NumCollageContribs) ?>
<? if ($Override = check_paranoia_here('collagecontribs')) { ?>
<a href="collages.php?userid=<?= $UserID ?>&amp;contrib=1" class="brackets <?= $OverrideClass ?>">
<?= t('server.user.view') ?>
<?= number_format($NumCollageContribs) ?>
</a>
<? } else { ?>
<?= number_format($NumCollageContribs) ?>
<? } ?>
</li>
<? } ?>
@@ -164,15 +177,14 @@ $OverrideClass = $Override === 2 ? 'paranoia_override' : '';
<li class="SidebarList-item">
<span class="<?= ($ViewCount === 2 ? 'paranoia_override' : '') ?>">
<span><?= t('server.user.requestsfilled') ?>: </span>
<?= number_format($RequestsFilled) ?>
<a href="requests.php?type=filled&amp;userid=<?= $UserID ?>" class="brackets <?= (($ViewAll === 2) ? ' paranoia_override' : '') ?>">
<?= number_format($RequestsFilled) ?>
</a>
</span>
<span class="<?= ($ViewBounty === 2 ? 'paranoia_override' : '') ?>">
<?= t('server.user.for') ?>
<?= Format::get_size($TotalBounty) ?>
</span>
<a href="requests.php?type=filled&amp;userid=<?= $UserID ?>" class="brackets <?= (($ViewAll === 2) ? ' paranoia_override' : '') ?>">
<?= t('server.user.view') ?>
</a>
</li>
<? } ?>
@@ -193,34 +205,35 @@ $OverrideClass = $Override === 2 ? 'paranoia_override' : '';
<li class="SidebarList-item"><?= t('server.user.requestsvoted') ?> <?= number_format($RequestsVoted) ?> <?= t('server.user.for') ?> <?= Format::get_size($TotalSpent) ?></li>
<? } elseif ($ViewAll) { ?>
<li class="SidebarList-item">
<span class="<?= ($ViewCount === 2 ? 'paranoia_override' : '') ?>"><?= t('server.user.requestscreated') ?>: <?= number_format($RequestsCreated) ?></span>
<span class="<?= ($ViewCount === 2 ? 'paranoia_override' : '') ?>"><?= t('server.user.requestscreated') ?>:
<a href="requests.php?type=created&amp;userid=<?= $UserID ?>" class="brackets<?= ($ViewAll === 2 ? ' paranoia_override' : '') ?>">
<?= number_format($RequestsCreated) ?>
</a>
</span>
<span class="<?= ($ViewBounty === 2 ? 'paranoia_override' : '') ?>"> <?= t('server.user.for') ?> <?= Format::get_size($RequestsCreatedSpent) ?></span>
<a href="requests.php?type=created&amp;userid=<?= $UserID ?>" class="brackets<?= ($ViewAll === 2 ? ' paranoia_override' : '') ?>">
<?= t('server.user.view') ?>
</a>
</li>
<li class="SidebarList-item">
<span class="<?= ($ViewCount === 2 ? 'paranoia_override' : '') ?>"><?= t('server.user.requestsvoted') ?>: <?= number_format($RequestsVoted) ?></span>
<span class="<?= ($ViewCount === 2 ? 'paranoia_override' : '') ?>"><?= t('server.user.requestsvoted') ?>:
<a href="requests.php?type=voted&amp;userid=<?= $UserID ?>" class="brackets<?= ($ViewAll === 2 ? ' paranoia_override' : '') ?>">
<?= number_format($RequestsVoted) ?>
</a>
</span>
<span class="<?= ($ViewBounty === 2 ? 'paranoia_override' : '') ?>"><?= t('server.user.for') ?> <?= Format::get_size($TotalSpent) ?></span>
<a href="requests.php?type=voted&amp;userid=<?= $UserID ?>" class="brackets<?= ($ViewAll === 2 ? ' paranoia_override' : '') ?>">
<?= t('server.user.view') ?>
</a>
</li>
<? } ?>
<?
if ($CanViewUploads || $Override = check_paranoia_here('uploads+')) { ?>
<li class="SidebarList-item isUploadCount <?= $OverrideClass ?>" id="upload-count-value" data-value="<?= $Uploads ?>">
<?= t('server.user.comm_upload') ?>:
<?= number_format($Uploads) ?>
<? if ($TotalUploads) { ?>
<span data-tooltip="<?= t('server.user.total_uploads_title') ?>">
(<?= $TotalUploads ?>)
</span>
<? } ?>
<a class="brackets <?= $OverrideClass ?>" href="torrents.php?type=uploaded&amp;userid=<?= $UserID ?>">
<?= number_format($Uploads) ?>
<? if ($TotalUploads) { ?>
<span data-tooltip="<?= t('server.user.total_uploads_title') ?>">
(<?= $TotalUploads ?>)
</span>
<? } ?>
</a>
<? if ($CanViewUploads || $Override = check_paranoia_here('uploads')) { ?>
<a class="brackets <?= $OverrideClass ?>" href="torrents.php?type=uploaded&amp;userid=<?= $UserID ?>">
<?= t('server.user.view') ?>
</a>
<? if (check_perms('zip_downloader')) { ?>
<a class="brackets <?= $OverrideClass ?>" href="torrents.php?action=redownload&amp;type=uploads&amp;userid=<?= $UserID ?>" onclick="return confirm('<?= t('server.user.redownloading_confirm') ?>');">
<?= t('server.user.community_dl') ?>

View File

@@ -186,7 +186,7 @@ View::show_header(t('server.user.invites'), '', 'PageUserInvite');
</div>
<? } ?>
<div class="Form-row">
<input class="Button" type="submit" value="Invite" />
<button class="Button" type="submit" value="Invite"><?= t('server.common.submit') ?></button>
</div>
</div>
</form>
@@ -202,7 +202,7 @@ View::show_header(t('server.user.invites'), '', 'PageUserInvite');
<? if (!empty($Pending)) { ?>
<div class="Group">
<div class="Group-header">
<div class="Box-headerTitle" id="pending_invites_header"><?= t('server.user.pending_invites') ?></div>
<div class="Group-headerTitle" id="pending_invites_header"><?= t('server.user.pending_invites') ?></div>
</div>
<div class="Group-body" id="pending_invites_container">
<table class="TableInvite Table">

View File

@@ -31,8 +31,6 @@ View::show_header(t('server.user.tree'), '', 'PageUserInviteTree');
<div class="BodyHeader">
<h2 class="BodyHeader-nav"><?= t('server.user.tree') ?></h2>
</div>
<div class="BoxBody">
<? $Tree->make_tree(); ?>
</div>
<? $Tree->make_tree(); ?>
</div>
<? View::show_footer(); ?>

View File

@@ -44,9 +44,6 @@ if (isset($_GET['username'])) {
list($NumResults) = $DB->next_record();
if ($NumResults > 300) {
$NumResults = 300;
} elseif (intval($NumResults) === 1) {
list($UserID, $Username, $Enabled, $PermissionID, $Donor, $Warned) = $Results[0];
header("Location: user.php?id={$UserID}");
}
}
}
@@ -63,39 +60,50 @@ View::show_header(t('server.user.user_search'), '', 'PageUserSearch');
<? } ?>
<form class="Form SearchPage Box SearchUser" name="users" action="user.php" method="get">
<input type="hidden" name="action" value="search" />
<table class="Form-rowList">
<tr class="Form-row">
<td class="Form-label"><?= t('server.user.username') ?>:</td>
<td class="Form-inputs">
<input class="Input" type="text" name="username" size="60" value="<?= display_str($_GET['username']) ?>" />
</td>
</tr>
<tr class="Form-row">
<td class="Form-submit" colspan="2">
<input class="Button" type="submit" value="Search users" />
</td>
</tr>
</table>
</form>
<div class="TableContainer">
<table class="Table" style="width: 400px; margin: 0px auto;">
<tr class="Table-rowHeader">
<td class="Table-cell" width="50%"><?= t('server.user.username') ?></td>
<td class="Table-cell"><?= t('server.user.primary_class') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Enabled, $PermissionID, $Donor, $Warned) = $Result;
?>
<tr class="Table-row">
<td class="Table-cell"><?= Users::format_username($UserID, true, true, true, true); ?></td>
<td class="Table-cell"><?= Users::make_class_string($PermissionID); ?></td>
<div class="SearchPageBody">
<table class="Form-rowList">
<tr class="Form-row">
<td class="Form-label"><?= t('server.user.username') ?>:</td>
<td class="Form-inputs">
<input placeholder="<?= t('server.user.search_type_strict') ?>" class="Input" type="text" name="username" size="60" value="<?= display_str($_GET['username']) ?>" />
</td>
</tr>
<? } ?>
</table>
</div>
<div class="BodyNavLinks">
<?= $Pages ?>
</div>
</table>
</div>
<div class="SearchPageFooter">
<div class="SearchPageFooter-actions">
<input class="Button" type="submit" value="<?= t('server.common.search') ?>" />
</div>
</div>
</form>
<? if (count($Results) > 0) { ?>
<div class="BodyNavLinks">
<?= $Pages ?>
</div>
<div class="TableContainer">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell" width="50%"><?= t('server.user.username') ?></td>
<td class="Table-cell"><?= t('server.user.primary_class') ?></td>
</tr>
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Enabled, $PermissionID, $Donor, $Warned) = $Result;
?>
<tr class="Table-row">
<td class="Table-cell"><?= Users::format_username($UserID, true, true, true, true); ?></td>
<td class="Table-cell"><?= Users::make_class_string($PermissionID); ?></td>
</tr>
<? } ?>
</table>
</div>
<div class="BodyNavLinks">
<?= $Pages ?>
</div>
<? } else {
if (!empty($_GET['username'])) {
View::line(t('server.common.no_results'));
}
} ?>
</div>
<? View::show_footer(); ?>

View File

@@ -54,42 +54,41 @@ View::show_header($Username . t('server.user.space_bigger_than_sessions'), '', '
<div class="BoxBody">
<p><?= t('server.user.clearing_cookies_can_result_in_ghost_sessions') ?></p>
</div>
<div class="BoxBody">
<table class="TableUserSession Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.user.ip_address') ?></td>
<td class="Table-cell"><?= t('server.user.browser') ?></td>
<td class="Table-cell"><?= t('server.user.platform') ?></td>
<td class="Table-cell"><?= t('server.user.last_activity') ?></td>
<table class="TableUserSession Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.user.ip_address') ?></td>
<td class="Table-cell"><?= t('server.user.browser') ?></td>
<td class="Table-cell"><?= t('server.user.platform') ?></td>
<td class="Table-cell"><?= t('server.user.last_activity') ?></td>
<td class="Table-cell">
<form class="manage_form" name="sessions" action="" method="post">
<input type="hidden" name="action" value="sessions" />
<input type="hidden" name="auth" value="<?= $LoggedUser['AuthKey'] ?>" />
<input type="hidden" name="all" value="1" />
<input class="Button" type="submit" value="<?= t('server.user.logout_all') ?>" />
</form>
</td>
</tr>
<?
foreach ($UserSessions as $Session) {
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Session['IP'] ?></td>
<td class="Table-cell"><?= $Session['Browser'] ?></td>
<td class="Table-cell"><?= $Session['OperatingSystem'] ?></td>
<td class="Table-cell"><?= time_diff($Session['LastUpdate']) ?></td>
<td class="Table-cell">
<form class="manage_form" name="sessions" action="" method="post">
<form class="delete_form" name="session" action="" method="post">
<input type="hidden" name="action" value="sessions" />
<input type="hidden" name="auth" value="<?= $LoggedUser['AuthKey'] ?>" />
<input type="hidden" name="all" value="1" />
<input class="Button" type="submit" value="Log out all" />
<input type="hidden" name="session" value="<?= $Session['SessionID'] ?>" />
<buton class="Button" type="submit" value="<?= (($Session['SessionID'] === $SessionID) ? 'Current" disabled="disabled' : 'Log out') ?>"><?= t('server.common.logout') ?></button>
</form>
</td>
</tr>
<?
foreach ($UserSessions as $Session) {
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Session['IP'] ?></td>
<td class="Table-cell"><?= $Session['Browser'] ?></td>
<td class="Table-cell"><?= $Session['OperatingSystem'] ?></td>
<td class="Table-cell"><?= time_diff($Session['LastUpdate']) ?></td>
<td class="Table-cell">
<form class="delete_form" name="session" action="" method="post">
<input type="hidden" name="action" value="sessions" />
<input type="hidden" name="auth" value="<?= $LoggedUser['AuthKey'] ?>" />
<input type="hidden" name="session" value="<?= $Session['SessionID'] ?>" />
<input class="Button" type="submit" value="<?= (($Session['SessionID'] === $SessionID) ? 'Current" disabled="disabled' : 'Log out') ?>" />
</form>
</td>
</tr>
<? } ?>
</table>
</div>
<? } ?>
</table>
</div>
<?

View File

@@ -858,21 +858,21 @@ if (!empty($Summary)) {
// Build query
$SET = implode(', ', $UpdateSet);
$SQL = "
if (count($UpdateSet) > 0) {
$SET = implode(', ', $UpdateSet);
$SQL = "
UPDATE users_main AS m
JOIN users_info AS i ON m.ID = i.UserID
SET $SET
WHERE m.ID = '$UserID'";
// Perform update
//die($SQL);
$DB->query($SQL);
// Perform update
//die($SQL);
$DB->query($SQL);
if (isset($ClearStaffIDCache)) {
$Cache->delete_value('staff_ids');
if (isset($ClearStaffIDCache)) {
$Cache->delete_value('staff_ids');
}
}
// redirect to user page

View File

@@ -348,9 +348,6 @@ list($ThumbCount) = $DB->next_record();
<? if (check_perms('admin_reports')) { ?>
<a href="reportsv2.php?view=reporter&amp;id=<?= $UserID ?>"><?= t('server.user.reporter') ?></a>
<? } ?>
<? if (check_perms('users_mod')) { ?>
<a href="userhistory.php?action=token_history&amp;userid=<?= $UserID ?>"><?= t('server.user.token_history') ?></a>
<? } ?>
<? if (check_perms('admin_clear_cache') && check_perms('users_override_paranoia')) { ?>
<a href="user.php?action=clearcache&amp;id=<?= $UserID ?>"><?= t('server.user.clearcache') ?></a>
<? } ?>
@@ -503,7 +500,9 @@ list($ThumbCount) = $DB->next_record();
<?= number_format($BonusPoints) ?>
<?
if (check_perms('admin_bp_history')) {
printf('<a href="bonus.php?action=history&amp;id=%d" >View</a>', $UserID);
?>
<a href="bonus.php?action=history&id=<?= $UserID ?>"><?= t('server.user.consumed_history') ?></a>
<?
}
?>
</li>
@@ -539,10 +538,13 @@ list($ThumbCount) = $DB->next_record();
$TokensDisplay = $num == 0 ? number_format($FLTokens) : number_format($FLTokens - $num) . '+' . number_format($num);
?>
<li class="SidebarList-item is-flTokenCount <?= $OverrideClass ?>" id="fl-token-count-value" data-value="<?= $FLTokens ?>" data-tooltip="<?= $Title ?>">
<a href="userhistory.php?action=token_history&amp;userid=<?= $UserID ?>">
<?= t('server.user.token_number') ?></a>
<?= t('server.user.token_number') ?>
<span>: </span>
<?= $TokensDisplay ?>
<a href="userhistory.php?action=token_history&amp;userid=<?= $UserID ?>">
<?= t('server.user.consumed_history') ?>
</a>
</li>
<? } ?>
<? if (($OwnProfile || check_perms('users_mod')) && $Warned != '0000-00-00 00:00:00') { ?>
@@ -752,26 +754,49 @@ WHERE xs.uid =" . $UserID . " and xs.tstamp >= unix_timestamp(date_format(now(),
<?= t('server.user.history') ?></div>
<ul class="SidebarList SidebarItem-body Box-body">
<? if (check_perms('users_view_email', $Class)) { ?>
<li class="SidebarList-item"><?= t('server.user.emails') ?>: <?= number_format($EmailChanges) ?> <a href="userhistory.php?action=email2&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a><a href="userhistory.php?action=email&amp;userid=<?= $UserID ?>"> <?= t('server.user.legacy_view') ?></a></li>
<li class="SidebarList-item">
<a href="userhistory.php?action=email2&amp;userid=<?= $UserID ?>">
<?= t('server.user.emails') ?></a>: <?= number_format($EmailChanges) ?>
</li>
<?
}
if (check_perms('users_view_ips', $Class)) {
?>
<li class="SidebarList-item">IPs: <?= number_format($IPChanges) ?> <a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a><a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>&amp;usersonly=1"> <?= t('server.user.view_users') ?></a></li>
<li class="SidebarList-item">
<a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>">
IPs
</a>:
<?= number_format($IPChanges) ?>
<a href="userhistory.php?action=ips&amp;userid=<?= $UserID ?>&amp;usersonly=1"> <?= t('server.user.view_users') ?></a>
</li>
<? if (check_perms('users_view_ips', $Class) && check_perms('users_mod', $Class)) { ?>
<li class="SidebarList-item">Tracker IPs: <?= number_format($TrackerIPs) ?> <a href="userhistory.php?action=tracker_ips&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a></li>
<li class="SidebarList-item">
<a href="userhistory.php?action=tracker_ips&amp;userid=<?= $UserID ?>">
Tracker IPs
</a>:
<?= number_format($TrackerIPs) ?>
</li>
<?
}
}
if (check_perms('users_view_keys', $Class)) {
?>
<li class="SidebarList-item"><?= t('server.user.passkeys') ?>: <?= number_format($PasskeyChanges) ?> <a href="userhistory.php?action=passkeys&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a></li>
<li class="SidebarList-item">
<a href="userhistory.php?action=passkeys&amp;userid=<?= $UserID ?>">
<?= t('server.user.passkeys') ?>
</a>:
<?= number_format($PasskeyChanges) ?>
</li>
<?
}
if (check_perms('users_mod', $Class)) {
?>
<li class="SidebarList-item"><?= t('server.user.passwords') ?>: <?= number_format($PasswordChanges) ?> <a href="userhistory.php?action=passwords&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a></li>
<li class="SidebarList-item"><?= t('server.user.stats') ?>: N/A <a href="userhistory.php?action=stats&amp;userid=<?= $UserID ?>"><?= t('server.user.view') ?></a></li>
<li class="SidebarList-item">
<a href="userhistory.php?action=passwords&amp;userid=<?= $UserID ?>">
<?= t('server.user.passwords') ?>
</a>
: <?= number_format($PasswordChanges) ?>
</li>
<? } ?>
</ul>
</div>
@@ -870,7 +895,7 @@ WHERE xs.uid =" . $UserID . " and xs.tstamp >= unix_timestamp(date_format(now(),
</li>
<? } ?>
<? if (Applicant::user_is_applicant($UserID) && (check_perms('admin_manage_applicants') || $OwnProfile)) { ?>
<li class="SidebarList-item"><?= t('server.user.p_inviter') ?>: <a href="/apply.php?action=view"><?= t('server.user.view') ?></a></li>
<li class="SidebarList-item"><?= t('server.apply.apply') ?>: <a href="/apply.php?action=view"><?= t('server.user.view') ?></a></li>
<? } ?>
<?
if (!isset($SupportFor)) {
@@ -900,8 +925,7 @@ WHERE xs.uid =" . $UserID . " and xs.tstamp >= unix_timestamp(date_format(now(),
LEFT JOIN users_history_passwords uhp ON uhp.UserID = $UserID
WHERE ui.UserID = $UserID");
list($PasswordHistory, $JoinDate) = G::$DB->next_record();
$Age = (empty($PasswordHistory)) ? time_diff($JoinDate) : time_diff($PasswordHistory);
$PasswordAge = substr($Age, 0, strpos($Age, " ago"));
$PasswordAge = (empty($PasswordHistory)) ? time_diff($JoinDate, 2, false, false, false, true) : time_diff($PasswordHistory, 2, false, false, false, true);
?>
<li class="SidebarList-item"><?= t('server.user.p_passwordage') ?>: <?= $PasswordAge ?></li>
<? }
@@ -1097,8 +1121,11 @@ WHERE xs.uid =" . $UserID . " and xs.tstamp >= unix_timestamp(date_format(now(),
</script>
<div class="Group-header">
<div class="Group-headerTitle"><a href="/badges.php"><?= t('server.user.badge_center') ?></a></div>
<div class="Group-headerTitle"><?= t('server.user.badge_center') ?></div>
<div class="Group-headerActions">
<span>
<a href="badges.php"><?= t('server.common.see_full') ?></a>
</span> -
<span><a href="#" onclick="badgesDisplay()"><?= t('server.common.hide') ?></a></span>
</div>
</div>
@@ -1147,7 +1174,7 @@ WHERE xs.uid =" . $UserID . " and xs.tstamp >= unix_timestamp(date_format(now(),
<div class="Group">
<div class="Group-header">
<div class="Group-headerTitle">
<?= t('server.user.infotitle') ?>
<?= t('server.user.simple_info') ?>
</div>
</div>
<div class="Group-body">

View File

@@ -32,7 +32,7 @@ $DB->prepared_query("
u.IP,
c.Code
FROM users_main AS u
LEFT JOIN geoip_country AS c ON INET_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
WHERE u.ID = ?
UNION
SELECT
@@ -41,7 +41,7 @@ $DB->prepared_query("
h.IP,
c.Code
FROM users_history_emails AS h
LEFT JOIN geoip_country AS c ON INET_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
WHERE UserID = ? "
/*AND Time != '0000-00-00 00:00:00'*/ . "
ORDER BY Time DESC", sqltime(), $UserID, $UserID);

View File

@@ -47,7 +47,7 @@ if ($UsersOnly == 1) {
c.Code
FROM users_main AS u
LEFT JOIN users_main AS u2 ON u2.Email = u.Email AND u2.ID != '$UserID'
LEFT JOIN geoip_country AS c ON INET_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
WHERE u.ID = '$UserID'
AND u2.ID > 0
UNION
@@ -58,7 +58,7 @@ if ($UsersOnly == 1) {
c.Code
FROM users_history_emails AS h
LEFT JOIN users_history_emails AS h2 ON h2.email = h.email and h2.UserID != '$UserID'
LEFT JOIN geoip_country AS c ON INET_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
WHERE h.UserID = '$UserID'
AND h2.UserID > 0"
/*AND Time != '0000-00-00 00:00:00'*/ . "
@@ -71,7 +71,7 @@ if ($UsersOnly == 1) {
u.IP,
c.Code
FROM users_main AS u
LEFT JOIN geoip_country AS c ON INET_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(u.IP) BETWEEN c.StartIP AND c.EndIP
WHERE u.ID = '$UserID'
UNION
SELECT
@@ -80,7 +80,7 @@ if ($UsersOnly == 1) {
h.IP,
c.Code
FROM users_history_emails AS h
LEFT JOIN geoip_country AS c ON INET_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
LEFT JOIN geoip_country AS c ON INET6_ATON(h.IP) BETWEEN c.StartIP AND c.EndIP
WHERE UserID = '$UserID' "
/*AND Time != '0000-00-00 00:00:00'*/ . "
ORDER BY Time DESC");

View File

@@ -176,7 +176,7 @@ if ($Old) {
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.email_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]) ?>
</h2>
</div>
@@ -197,7 +197,7 @@ if ($Old) {
<?= display_str($Current['CurrentIP']) ?>
(<?= Tools::get_country_code_by_ajax($Current['CurrentIP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Current['CurrentIP']) ?>" class="brackets" data-tooltip="Search">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Current['CurrentIP']) ?>" class="brackets" data-tooltip="Search WIMIA.com">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Current['CurrentIP']) ?>" class="brackets" data-tooltip="Search WIMIA.com" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Current['CurrentIP']) ?>
</td>
@@ -205,7 +205,7 @@ if ($Old) {
<?= display_str($Current['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Current['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Current['IP']) ?>" class="brackets" data-tooltip="Search">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Current['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Current['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Current['IP']) ?>
</td>
@@ -224,17 +224,24 @@ if ($Old) {
<?= display_str($Match['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Match['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Match['IP']) ?>
</td>
</tr>
<?
<?
}
}
// Old emails
if ($Old) {
?>
?>
</table>
</div>
<?
// Old emails
if ($Old) {
?>
<div class="TableContainer">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.old_emails') ?></td>
<td class="Table-cell"><?= t('server.userhistory.start') ?></td>
@@ -265,7 +272,7 @@ if ($Old) {
<?= display_str($Match['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Match['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="Search WIMIA.com" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Match['IP']) ?>
</td>
@@ -288,12 +295,12 @@ if ($Old) {
<?= display_str($Record['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Record['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Record['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search') ?>">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Record['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Record['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Record['IP']) ?>
</td>
</tr>
<?
<?
if ($MatchCount > 0) {
if (isset($Matches)) {
echo $Matches;
@@ -302,9 +309,15 @@ if ($Old) {
}
}
}
}
// Invite email (always there)
?>
?>
</table>
</div>
<?
}
// Invite email (always there)
?>
<div class="TableContainer">
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.invite_email') ?></td>
<td class="Table-cell"><?= t('server.userhistory.start') ?></td>
@@ -331,7 +344,7 @@ if ($Old) {
<?= display_str($Match['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Match['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search') ?>">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>">WI</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Match['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Match['IP']) ?>
</td>
@@ -353,7 +366,7 @@ if ($Old) {
<?= display_str($Invite['IP']) ?>
(<?= Tools::get_country_code_by_ajax($Invite['IP']) ?>)
<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($Invite['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search') ?>">S</a>
<a href="http://whatismyipaddress.com/ip/<?= display_str($Invite['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>">WI</a>
<a target="_blank" href="http://whatismyipaddress.com/ip/<?= display_str($Invite['IP']) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>" target="_blank">WI</a>
<br />
<?= Tools::get_host_by_ajax($Invite['IP']) ?>
</td>

View File

@@ -89,7 +89,7 @@ if ($_GET['action']) {
users_history_ips:
id (auto_increment, index)
userid (index)
ip (stored using ip2long())
ip
timestamp
users_history_passwd:

View File

@@ -175,47 +175,59 @@ $Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.ip_address_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${UserInfo['Username']}</a>"
Users::format_username($UserID)
]]) ?>
</h2>
<div class="BodyNavLinks">
<?
if ($UsersOnly) { ?>
<a href="userhistory.php?<?= Format::get_url(array('usersonly')) ?>" class="brackets"><?= t('server.userhistory.view_all_ip_address') ?></a>
<? } else { ?>
<a href="userhistory.php?<?= Format::get_url() ?>&amp;usersonly=1" class="brackets"><?= t('server.userhistory.view_ip_addresses_with_users') ?></a>
<? } ?>
</div>
<?
if ($Pages) { ?>
<div class="BodyNavLinks pager"><?= $Pages ?></div>
<? } ?>
</div>
<table class="Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.ip_address_search') ?></td>
</tr>
<tr class="Table-row">
<td class="Table-cell">
<form class="Form SearchIP" name="ip_log" method="get" action="">
<input type="hidden" name="action" value="<?= $_GET['action'] ?>" />
<input type="hidden" name="userid" value="<?= $UserID ?>" />
<? if ($UsersOnly) { ?>
<input type="hidden" name="usersonly" value="1" />
<? } ?>
<input class="Input" type="text" name="ip" value="<?= Format::form('ip') ?>" />
<input class="Button" type="submit" value="Search" />
<?= t('server.userhistory.wildcard_search_examples') ?>
</form>
</td>
</tr>
</table>
<form class="Box Form SearchPage SearchIP" name="ip_log" method="get" action="">
<input type="hidden" name="action" value="<?= $_GET['action'] ?>" />
<input type="hidden" name="userid" value="<?= $UserID ?>" />
<? if ($UsersOnly) { ?>
<input type="hidden" name="usersonly" value="1" />
<? } ?>
<div class="SearchPageHeader">
<div class="SearchPageHeader-title">
<?
if ($UsersOnly) { ?>
<a href="userhistory.php?<?= Format::get_url(array('usersonly')) ?>" class="brackets"><?= t('server.userhistory.view_all_ip_address') ?></a>
/ <?= t('server.userhistory.view_ip_addresses_with_users') ?>
<? } else { ?>
<?= t('server.userhistory.view_all_ip_address') ?>
/ <a href="userhistory.php?<?= Format::get_url() ?>&amp;usersonly=1" class="brackets"><?= t('server.userhistory.view_ip_addresses_with_users') ?></a>
<? } ?>
</div>
<div class="SearchPageHeader-actions">
</div>
</div>
<div class="SearchPageBody">
<table class="Form-rowList">
<tr class="Form-row">
<td class="Form-label">
<?= t('server.torrents.search_for') ?>
</td>
<td class="Form-inputs">
<input placeholder="<?= t('server.userhistory.wildcard_search_examples') ?>" class="Input" type="text" name="ip" value="<?= Format::form('ip') ?>" />
</td>
</tr>
</table>
</div>
<div class="SearchPageFooter">
<div class="SearchPageFooter-actions">
<input class="Button" type="submit" value="<?= t('server.common.search') ?>" />
</div>
</div>
</form>
<?
if ($Pages) { ?>
<div class="BodyNavLinks pager"><?= $Pages ?></div>
<? } ?>
<div class="TableContainer">
<table class="TableUserIPHistory Table">
<table class="TableUserIPHistory Table" id="iphistory">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.ip_address') ?></td>
<td class="Table-cell"><?= t('server.userhistory.started') ?> <a href="#" onclick="$('#iphistory .reltime').gtoggle(); $('#iphistory .abstime').gtoggle(); return false;" class="brackets"><?= t('server.common.toggle') ?></a></td>
<td class="Table-cell"><?= t('server.userhistory.ip_address') ?> <a href="#" onclick="$('#iphistory .reltime').gtoggle(); $('#iphistory .abstime').gtoggle(); return false;" class="brackets"><?= t('server.common.time_format') ?></a></td>
<td class="Table-cell"><?= t('server.userhistory.started') ?> </td>
<td class="Table-cell"><?= t('server.userhistory.ended') ?></td>
<td class="Table-cell hidden"><?= t('server.userhistory.ended') ?></td>
<td class="Table-cell"><?= t('server.userhistory.elapsed') ?></td>
@@ -297,7 +309,7 @@ $Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
$OtherUser['EndTime'] = sqltime();
}
?>
<tr class="Table-row otherusers<?= $Index ?><?= ($HideMe ? ' hidden' : '') ?>">
<tr class="Table-row hidden otherusers<?= $Index ?><?= ($HideMe ? ' hidden' : '') ?>">
<td class="Table-cell">&nbsp;&nbsp;&#187;&nbsp;<?= Users::format_username($OtherUser['UserID'], true, true, true) ?></td>
<td class="Table-cell">
<span class="reltime"><?= time_diff($OtherUser['StartTime']) ?></span>

View File

@@ -65,40 +65,45 @@ $Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.tracker_ip_address_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]) ?>
</h2>
</div>
<div class="BodyNavLinks"><?= $Pages ?></div>
<div class="TableContainer">
<table class="TableUserTrakcerIPHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.ip_address') ?></td>
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><?= t('server.userhistory.time') ?></td>
</tr>
<?
$Results = $DB->to_array();
foreach ($Results as $Index => $Result) {
list($IP, $TorrentID, $Time) = $Result;
?>
<tr class="Table-row">
<td class="Table-cell">
<?= $IP ?> (<?= Tools::get_country_code_by_ajax($IP) ?>)<br /><?= Tools::get_host_by_ajax($IP) ?>
<a href="http://whatismyipaddress.com/ip/<?= display_str($IP) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>">WI</a>
</td>
<td class="Table-cell"><a href="torrents.php?torrentid=<?= $TorrentID ?>"><?= $TorrentID ?></a></td>
<td class="Table-cell"><?= date('Y-m-d g:i:s', $Time) ?></td>
<? if ($NumResults > 0) { ?>
<div class="BodyNavLinks"><?= $Pages ?></div>
<div class="TableContainer">
<table class="TableUserTrakcerIPHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.ip_address') ?></td>
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><?= t('server.userhistory.time') ?></td>
</tr>
<?
}
?>
</table>
</div>
<div class="BodyNavLinks">
<?= $Pages ?>
</div>
<?
$Results = $DB->to_array();
foreach ($Results as $Index => $Result) {
list($IP, $TorrentID, $Time) = $Result;
?>
<tr class="Table-row">
<td class="Table-cell">
<?= $IP ?> (<?= Tools::get_country_code_by_ajax($IP) ?>)<br /><?= Tools::get_host_by_ajax($IP) ?>
<a href="http://whatismyipaddress.com/ip/<?= display_str($IP) ?>" class="brackets" data-tooltip="<?= t('server.userhistory.search_wimia_com') ?>" target="_blank">WI</a>
</td>
<td class="Table-cell"><a href="torrents.php?torrentid=<?= $TorrentID ?>"><?= $TorrentID ?></a></td>
<td class="Table-cell"><?= date('Y-m-d g:i:s', $Time) ?></td>
</tr>
<?
}
?>
</table>
</div>
<div class="BodyNavLinks">
<?= $Pages ?>
</div>
<? } else {
VIew::line(t('server.common.no_results'));
}
?>
</div>
<?

View File

@@ -42,29 +42,31 @@ $DB->query("
ORDER BY ChangeTime DESC");
?>
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.passkey_history_for', ['Values' => [
"<a href='/user.php?id=${UserID}'>${Username}</a>"
]]) ?>
</h2>
</div>
<div class="TableContainer">
<table class="TableUserPasskeyHihstory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.old') ?></td>
<td class="Table-cell"><?= t('server.userhistory.new') ?></td>
<td class="Table-cell"><?= t('server.userhistory.changed') ?></td>
<td class="Table-cell">IP <a href="/userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets">H</a></td>
</tr>
<? while (list($OldPassKey, $NewPassKey, $ChangeTime, $ChangerIP) = $DB->next_record()) { ?>
<tr class="Table-row">
<td class="Table-cell"><?= display_str($OldPassKey) ?></td>
<td class="Table-cell"><?= display_str($NewPassKey) ?></td>
<td class="Table-cell"><?= time_diff($ChangeTime) ?></td>
<td class="Table-cell"><?= display_str($ChangerIP) ?> <a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($ChangerIP) ?>" class="brackets" data-tooltip="Search">S</a><br /><?= display_str(Tools::get_host_by_ip($ChangerIP)) ?></td>
<div class="LayoutPage">
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.passkey_history_for', ['Values' => [
Users::format_username($UserID)
]]) ?>
</h2>
</div>
<div class="TableContainer">
<table class="TableUserPasskeyHihstory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.old') ?></td>
<td class="Table-cell"><?= t('server.userhistory.new') ?></td>
<td class="Table-cell"><?= t('server.userhistory.changed') ?></td>
<td class="Table-cell">IP <a href="/userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets">H</a></td>
</tr>
<? } ?>
</table>
<? while (list($OldPassKey, $NewPassKey, $ChangeTime, $ChangerIP) = $DB->next_record()) { ?>
<tr class="Table-row">
<td class="Table-cell"><?= display_str($OldPassKey) ?></td>
<td class="Table-cell"><?= display_str($NewPassKey) ?></td>
<td class="Table-cell"><?= time_diff($ChangeTime) ?></td>
<td class="Table-cell"><?= display_str($ChangerIP) ?> <a href="user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($ChangerIP) ?>" class="brackets" data-tooltip="Search">S</a><br /><?= display_str(Tools::get_host_by_ip($ChangerIP)) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<? View::show_footer(); ?>

View File

@@ -40,25 +40,27 @@ $DB->query("
ORDER BY ChangeTime DESC");
?>
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.password_reset_history_for', ['Values' => [
"<a href='/user.php?id=${UserID}'>${Username}</a>"
]]) ?>
</h2>
</div>
<div class="TableContainer">
<table class="TableUserPasswordHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.changed') ?></td>
<td class="Table-cell">IP <a href="/userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets">H</a></td>
</tr>
<? while (list($ChangeTime, $ChangerIP) = $DB->next_record()) { ?>
<tr class="Table-row">
<td class="Table-cell"><?= time_diff($ChangeTime) ?></td>
<td class="Table-cell"><?= display_str($ChangerIP) ?> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($ChangerIP) ?>" class="brackets" data-tooltip="Search">S</a><br /><?= Tools::get_host_by_ajax($ChangerIP) ?></td>
<div class="LayoutBody">
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.password_reset_history_for', ['Values' => [
"<a href='/user.php?id=${UserID}'>${Username}</a>"
]]) ?>
</h2>
</div>
<div class="TableContainer">
<table class="TableUserPasswordHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.userhistory.changed') ?></td>
<td class="Table-cell">IP <a href="/userhistory.php?action=ips&amp;userid=<?= $UserID ?>" class="brackets">H</a></td>
</tr>
<? } ?>
</table>
<? while (list($ChangeTime, $ChangerIP) = $DB->next_record()) { ?>
<tr class="Table-row">
<td class="Table-cell"><?= time_diff($ChangeTime) ?></td>
<td class="Table-cell"><?= display_str($ChangerIP) ?> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?= display_str($ChangerIP) ?>" class="brackets" data-tooltip="Search">S</a><br /><?= Tools::get_host_by_ajax($ChangerIP) ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
<? View::show_footer(); ?>

View File

@@ -163,15 +163,15 @@ if ($ShowGrouped) {
echo t('server.userhistory.grouped')
. ($ShowUnread ? t('server.userhistory.unread') : '')
. t('server.userhistory.post_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]);
} elseif ($ShowUnread) {
echo t('server.userhistory.unread_post_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]);
} else {
echo t('server.userhistory.post_history_for', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]);
}
?>

View File

@@ -90,53 +90,58 @@ $Pages = Format::get_pages($Page, $NumResults, 25);
</h2>
</div>
<div class="BodyNavLinks"><?= $Pages ?></div>
<div class="TableContainer">
<table class="TableUserTokenHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><?= t('server.userhistory.time') ?></td>
<td class="Table-cell"><?= t('server.userhistory.expired') ?></td>
<? if (check_perms('users_mod')) { ?>
<td class="Table-cell"><?= t('server.userhistory.downloaded') ?></td>
<td class="Table-cell"><?= t('server.userhistory.tokens_used') ?></td>
<? } ?>
</tr>
<?
foreach ($Tokens as $Token) {
$GroupIDs[] = $Token['GroupID'];
}
$Artists = Artists::get_artists($GroupIDs);
$i = true;
foreach ($Tokens as $Token) {
$i = !$i;
list($TorrentID, $GroupID, $Time, $Expired, $Downloaded, $Uses, $Name) = $Token;
if ($Name != '') {
$Name = "<a href=\"torrents.php?torrentid=$TorrentID\">$Name</a>";
} else {
$Name = "(<i>Deleted torrent <a href=\"log.php?search=Torrent+$TorrentID\">$TorrentID</a></i>)";
}
$ArtistName = Artists::display_artists($Artists[$GroupID]);
if ($ArtistName) {
$Name = $ArtistName . $Name;
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Name ?></td>
<td class="Table-cell"><?= time_diff($Time) ?></td>
<td class="Table-cell"><?= ($Expired ? t('server.userhistory.yes') : t('server.userhistory.no')) ?><?= (check_perms('users_mod') && !$Expired) ? " <a href=\"userhistory.php?action=token_history&amp;expire=1&amp;userid=$UserID&amp;torrentid=$TorrentID\">" . t('server.userhistory.expire_button') . "</a>" : ''; ?></td>
<? if (count($Tokens) > 0) { ?>
<div class="TableContainer">
<table class="TableUserTokenHistory Table">
<tr class="Table-rowHeader">
<td class="Table-cell"><?= t('server.common.torrent') ?></td>
<td class="Table-cell"><?= t('server.userhistory.time') ?></td>
<td class="Table-cell"><?= t('server.userhistory.expired') ?></td>
<? if (check_perms('users_mod')) { ?>
<td class="Table-cell"><?= Format::get_size($Downloaded) ?></td>
<td class="Table-cell"><?= $Uses ?></td>
<? } ?>
<td class="Table-cell"><?= t('server.userhistory.downloaded') ?></td>
<td class="Table-cell"><?= t('server.userhistory.tokens_used') ?></td>
<? } ?>
</tr>
<?
}
?>
</table>
</div>
<?
foreach ($Tokens as $Token) {
$GroupIDs[] = $Token['GroupID'];
}
$Artists = Artists::get_artists($GroupIDs);
$i = true;
foreach ($Tokens as $Token) {
$i = !$i;
list($TorrentID, $GroupID, $Time, $Expired, $Downloaded, $Uses, $Name) = $Token;
if ($Name != '') {
$Name = "<a href=\"torrents.php?torrentid=$TorrentID\">$Name</a>";
} else {
$Name = "(<i>Deleted torrent <a href=\"log.php?search=Torrent+$TorrentID\">$TorrentID</a></i>)";
}
$ArtistName = Artists::display_artists($Artists[$GroupID]);
if ($ArtistName) {
$Name = $ArtistName . $Name;
}
?>
<tr class="Table-row">
<td class="Table-cell"><?= $Name ?></td>
<td class="Table-cell"><?= time_diff($Time) ?></td>
<td class="Table-cell"><?= ($Expired ? t('server.userhistory.yes') : t('server.userhistory.no')) ?><?= (check_perms('users_mod') && !$Expired) ? " <a href=\"userhistory.php?action=token_history&amp;expire=1&amp;userid=$UserID&amp;torrentid=$TorrentID\">" . t('server.userhistory.expire_button') . "</a>" : ''; ?></td>
<? if (check_perms('users_mod')) { ?>
<td class="Table-cell"><?= Format::get_size($Downloaded) ?></td>
<td class="Table-cell"><?= $Uses ?></td>
<? } ?>
</tr>
<?
}
?>
</table>
</div>
</div>
<? } else {
VIew::line(t('server.common.no_results'));
} ?>
<div class="BodyNavLinks"><?= $Pages ?></div>
<?
View::show_footer();

View File

@@ -45,7 +45,7 @@ $DB->set_query_id($QueryID);
<div class="BodyHeader">
<h2 class="BodyHeader-nav">
<?= t('server.userhistory.threads_started_by', ['Values' => [
"<a href='user.php?id=${UserID}'>${Username}</a>"
Users::format_username($UserID)
]]) ?>
</h2>
</div>

View File

@@ -109,9 +109,6 @@ FormOneLine Search<Name>
}
}
@media (max-width: 767px) {
.SearchUserAdvanced .Form-row {
flex-wrap: wrap;
}
.Form.is-longLabel .Form-row {
flex-direction: column;
}
@@ -133,9 +130,6 @@ FormOneLine Search<Name>
.LayoutMainSidebar-main .Form-label {
width: 18%;
}
.SearchUserAdvanced .Form-label {
width: 8%;
}
}
@media (max-width: 767px) {
.Form.is-longLabel .Form-label {
@@ -177,10 +171,6 @@ FormOneLine Search<Name>
:is(.LayoutMainSidebar-main, .TorrentNotifyForm) .Form-inputs {
width: 78%;
}
.SearchUserAdvanced .Form-inputs {
width: 24%;
align-items: start;
}
}
/* input */

View File

@@ -1,10 +1,29 @@
.List {
list-style-type: unset;
list-style-position: inside;
.MenuList {
list-style: none;
}
.List li {
padding-top: var(--global-space-sm);
padding-left: var(--global-space-lg);
padding-right: 0;
padding-bottom: 0;
.MenuList.SubMenu {
position: relative;
margin-left: 20px;
padding-top: 5px;
}
.MenuList li {
position: relative;
padding: 5px;
}
.MenuList.SubMenu li::before {
content: '';
height: 100%;
width: 12px;
border-bottom: 2px solid var(--global-color-border);
border-left: 2px solid var(--global-color-border);
position: absolute;
bottom: 12px;
left: -10px;
}
.MenuList.SubMenu li:first-child::before {
height: 70%;
}

View File

@@ -128,10 +128,6 @@ TorrentDetail
margin-left: auto;
}
.TorrentDetailfileListItem-fileListItem {
padding: 0px 0px 0px 12px;
}
.TorrentDetailfileListItem-fileListItem[variant='root'] {
padding-left: 0px;
}

View File

@@ -1078,11 +1078,11 @@ server.common.error: |-
server.common.error_403_description: |-
You just tried to go to a page that you don't have enough permission to view.
server.common.error_403_title: |-
Error 403
Permission denied
server.common.error_404_description: |-
You just tried to go to a page that doesn't exist.
server.common.error_404_title: |-
Error 404
Page not found
server.common.external_subtitles: |-
External
server.common.feature_film: |-
@@ -7598,9 +7598,9 @@ server.userhistory.unread: |-
server.userhistory.unread_post_history_for: |-
Unread post history for %s
server.userhistory.view_all_ip_address: |-
View all IP addresses
All
server.userhistory.view_ip_addresses_with_users: |-
View IP addresses with users
Users only
server.userhistory.wildcard_search_examples: |-
Wildcard (*) search examples: 127.0.* or 1*2.0.*.1 or *.*.*.*
server.userhistory.with_new_additions: |-
@@ -8318,4 +8318,16 @@ server.tools.total_value: |-
server.tools.timestamps: |-
Timestamps
server.common.see_full: |-
See full
See full
server.user.simple_info: |-
Profile
server.user.consumed_history: |-
History
server.user.user_basic: |-
Basic info
server.user.account_info: |-
Account info
server.common.time_format: |-
Time format
server.user.logout_all: |-
Logout all

View File

@@ -1046,11 +1046,11 @@ server.common.error: |-
server.common.error_403_description: |-
你刚刚试图查看你无权访问的页面。
server.common.error_403_title: |-
错误 403
无权限
server.common.error_404_description: |-
你刚刚试图查看不存在的页面。
server.common.error_404_title: |-
错误 404
页面不存在
server.common.external_subtitles: |-
外挂
server.common.feature_film: |-
@@ -2225,7 +2225,7 @@ server.pub.space_new_torrent_notification_one: |-
server.pub.space_new_torrent_notification_other: |-
&nbsp;条新种推送
server.pub.statistics: |-
统计面板
工资统计
server.pub.toolbox: |-
管理面板
server.pub.user_manage: |-
@@ -2337,7 +2337,7 @@ server.register.you_did_not_select_wiki: |-
server.register.your_passwords_do_not_match: |-
两次输入的密码不一致
server.reports.active_reports: |-
未处理的报告
其他报告
server.reports.body: |-
内容
server.reports.claim: |-
@@ -2483,7 +2483,7 @@ server.reports.sth_was_reported_by_user_sometime: |-
server.reports.subject: |-
主题
server.reports.threads_trashed_since_the_beginning_of_time: |-
所有被删除的主题
所有被删除的帖子
server.reports.title: |-
标题
server.reports.toggle_notes: |-
@@ -6200,7 +6200,7 @@ server.user.community_topic: |-
server.user.compose: |-
发送私信
server.user.copypaste: |-
复制访问日志
复制用户信息
server.user.country_code: |-
国家代码
server.user.country_code_title: |-
@@ -6626,7 +6626,7 @@ server.user.p_host: |-
server.user.p_inviter: |-
邀请人
server.user.p_invites: |-
邀请数
邀请数
server.user.p_ip: |-
IP
server.user.p_irc: |-
@@ -6846,7 +6846,7 @@ server.user.send_hacked_account_email_to: |-
server.user.session: |-
访问终端
server.user.sessions: |-
访问终端列表
登录记录
server.user.setting: |-
设置
server.user.show_bounty: |-
@@ -6868,7 +6868,7 @@ server.user.space_and_space: |-
server.user.space_are: |-
&nbsp;的
server.user.space_bigger_than_sessions: |-
&nbsp;> 访问记录
的登录记录
server.user.space_expired: |-
&nbsp;到期)
server.user.space_is: |-
@@ -7130,7 +7130,7 @@ server.user.to_fuzzy_search_for_a_block_of_addresses_title: |-
server.user.token: |-
令牌
server.user.token_history: |-
免费令牌历史
令牌消费历史
server.user.token_number: |-
令牌
server.user.too_paranoid_to_have_their_stats_shown_here_and: |-
@@ -7462,9 +7462,9 @@ server.userhistory.unread: |-
server.userhistory.unread_post_history_for: |-
未读的 %s 的发帖历史
server.userhistory.view_all_ip_address: |-
查看所有 IP 地址
所有
server.userhistory.view_ip_addresses_with_users: |-
查看有用户使用的 IP 地址
用户使用
server.userhistory.wildcard_search_examples: |-
通配符(*搜索示例127.0.* 或 1*2.0.*.1 或 *.*.*.*
server.userhistory.with_new_additions: |-
@@ -8183,3 +8183,15 @@ server.tool.timestamps: |-
时间戳
server.common.see_full: |-
查看全部
server.user.simple_info: |-
简介
server.user.consumed_history: |-
消费历史
server.user.user_basic: |-
基本信息
server.user.account_info: |-
账号情况
server.common.time_format: |-
时间格式
server.user.logout_all: |-
注销所有