mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-18 06:37:28 +08:00
seedBox icon display with location no
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.19');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-07-23');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-07-24');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -948,6 +948,7 @@ tr_small($lang_usercp['row_karma_points'], $CURUSER['seedbonus']." [<a href=\"my
|
||||
tr_small($lang_usercp['row_written_comments'], $commentcount." [<a href=\"userhistory.php?action=viewcomments&id=".$CURUSER['id']."\" title=\"".$lang_usercp['link_view_comments']."\">".$lang_usercp['text_view']."</a>]", 1);
|
||||
|
||||
//start seed box
|
||||
if (get_setting('seed_box.enabled') == 'yes') {
|
||||
$seedBox = '';
|
||||
$columnOperator = nexus_trans('label.seed_box_record.operator');
|
||||
$columnBandwidth = nexus_trans('label.seed_box_record.bandwidth');
|
||||
@@ -1065,6 +1066,7 @@ jQuery('#seed-box-table').on('click', '.remove-seed-box-btn', function () {
|
||||
JS;
|
||||
\Nexus\Nexus::js($seedBoxJs, 'footer', false);
|
||||
\Nexus\Nexus::css($seedBoxCss, 'footer', false);
|
||||
}
|
||||
//end seed box
|
||||
|
||||
if ($forumposts)
|
||||
|
||||
+37
-11
@@ -15,8 +15,8 @@ $seedBoxRep = new \App\Repositories\SeedBoxRepository();
|
||||
function get_location_column($e, $isStrongPrivacy, $canView): string
|
||||
{
|
||||
global $enablelocation_tweak, $seedBoxRep, $lang_functions, $lang_viewpeerlist;
|
||||
if ($enablelocation_tweak == 'yes') {
|
||||
$address = $ips = [];
|
||||
if ($enablelocation_tweak == 'yes') {
|
||||
if (!empty($e['ipv4'])) {
|
||||
list($loc_pub, $loc_mod) = get_ip_location($e['ipv4']);
|
||||
$seedBoxIcon = $seedBoxRep->renderIcon($e['ipv4'], $e['userid']);
|
||||
@@ -33,7 +33,13 @@ function get_location_column($e, $isStrongPrivacy, $canView): string
|
||||
$addressStr = implode('<br/>', $address);
|
||||
$location = "<div title='" . $title . "'>" . $addressStr . "</div>";
|
||||
} else {
|
||||
$location = implode(', ', array_filter([$e['ipv4'], $e['ipv6']]));
|
||||
if (!empty($e['ipv4'])) {
|
||||
$ips[] = $e['ipv4'] . $seedBoxRep->renderIcon($e['ipv4'], $e['userid']);
|
||||
}
|
||||
if (!empty($e['ipv6'])) {
|
||||
$ips[] = $e['ipv6'] . $seedBoxRep->renderIcon($e['ipv6'], $e['userid']);
|
||||
}
|
||||
$location = '<div>'.implode('<br/>', $ips).'</div>';
|
||||
}
|
||||
|
||||
if ($isStrongPrivacy) {
|
||||
@@ -48,6 +54,18 @@ function get_location_column($e, $isStrongPrivacy, $canView): string
|
||||
return "<td class=rowfollow align=left width=1%><div style='display: flex;white-space: nowrap;align-items: center'>" . $result . "</div></td>\n";
|
||||
}
|
||||
|
||||
function get_username_seed_box_icon($e): string
|
||||
{
|
||||
global $seedBoxRep;
|
||||
foreach (array_filter([$e['ipv4'], $e['ipv6']]) as $ip) {
|
||||
$icon = $seedBoxRep->renderIcon($ip, $e['userid']);
|
||||
if (!empty($icon)) {
|
||||
return $icon;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
if(isset($CURUSER))
|
||||
{
|
||||
@@ -85,24 +103,32 @@ function dltable($name, $arr, $torrent)
|
||||
$highlight = $CURUSER["id"] == $e['userid'] ? " bgcolor=#BBAF9B" : "";
|
||||
$s .= "<tr$highlight>\n";
|
||||
$secs = max(1, ($e["la"] - $e["st"]));
|
||||
$columnLocation = $usernameSeedBoxIcon = '';
|
||||
if ($privacy == "strong" || ($torrent['anonymous'] == 'yes' && $e['userid'] == $torrent['owner'])) {
|
||||
if (get_user_class() >= $viewanonymous_class || $e['userid'] == $CURUSER['id']) {
|
||||
$s .= "<td class=rowfollow align=left width=1%><i>".$lang_viewpeerlist['text_anonymous']."</i><br />(" . get_username($e['userid']) . ")";
|
||||
if ($showLocationColumn) {
|
||||
$s .= get_location_column($e, true, true);
|
||||
$columnLocation = get_location_column($e, true, true);
|
||||
} else {
|
||||
$usernameSeedBoxIcon = get_username_seed_box_icon($e);
|
||||
}
|
||||
$columnUsername = "<td class=rowfollow align=left width=1%><i>".$lang_viewpeerlist['text_anonymous']."</i>".$usernameSeedBoxIcon."<br />(" . get_username($e['userid']) . ")</td>\n";
|
||||
} else {
|
||||
if ($showLocationColumn) {
|
||||
$columnLocation = get_location_column($e, true, false);
|
||||
} else {
|
||||
$usernameSeedBoxIcon = get_username_seed_box_icon($e);
|
||||
}
|
||||
$columnUsername = "<td class=rowfollow align=left width=1%><i>".$lang_viewpeerlist['text_anonymous']."</i>".$usernameSeedBoxIcon."</td>\n";
|
||||
}
|
||||
} else {
|
||||
$s .= "<td class=rowfollow align=left width=1%><i>".$lang_viewpeerlist['text_anonymous']."</i></a></td>\n";
|
||||
if ($showLocationColumn) {
|
||||
$s .= get_location_column($e, true, false);
|
||||
}
|
||||
}
|
||||
$columnLocation = get_location_column($e, false, false);
|
||||
} else {
|
||||
$s .= "<td class=rowfollow align=left width=1%>" . get_username($e['userid']);
|
||||
if ($showLocationColumn) {
|
||||
$s .= get_location_column($e, false, false);
|
||||
$usernameSeedBoxIcon = get_username_seed_box_icon($e);
|
||||
}
|
||||
$columnUsername = "<td class=rowfollow align=left width=1%>" . get_username($e['userid']).$usernameSeedBoxIcon."</td>\n";
|
||||
}
|
||||
$s .= $columnUsername . $columnLocation;
|
||||
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . ($e['connectable'] == "yes" ? $lang_viewpeerlist['text_yes'] : "<font color=red>".$lang_viewpeerlist['text_no']."</font>") . "</nobr></td>\n";
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize($e["uploaded"]) . "</nobr></td>\n";
|
||||
|
||||
Reference in New Issue
Block a user