mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-25 12:37:23 +08:00
Merge branch 'php8' into section
This commit is contained in:
@@ -123,3 +123,11 @@ function consumeBenefit($params)
|
||||
$rep = new \App\Repositories\UserRepository();
|
||||
return $rep->consumeBenefit($CURUSER['id'], $params);
|
||||
}
|
||||
|
||||
function clearShoutBox($params)
|
||||
{
|
||||
global $CURUSER;
|
||||
user_can('sbmanage', true);
|
||||
\Nexus\Database\NexusDB::table('shoutbox')->delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
+6
-5
@@ -121,7 +121,7 @@ if (!$az) err("Invalid passkey! Re-download the .torrent from $BASEURL");
|
||||
$userid = intval($az['id'] ?? 0);
|
||||
unset($GLOBALS['CURUSER']);
|
||||
$CURUSER = $GLOBALS["CURUSER"] = $az;
|
||||
$isDonor = $az['donor'] == 'yes' && ($az['donoruntil'] === null || $az['donoruntil'] == '0000-00-00 00:00:00' || $az['donoruntil'] > date('Y-m-d H:i:s'));
|
||||
$isDonor = is_donor($az);
|
||||
$az['__is_donor'] = $isDonor;
|
||||
$log = "user: $userid, isDonor: $isDonor, seeder: $seeder, ip: $ip, ipv4: $ipv4, ipv6: $ipv6";
|
||||
|
||||
@@ -156,7 +156,7 @@ elseif ($az['showclienterror'] == 'yes'){
|
||||
}
|
||||
|
||||
// check torrent based on info_hash
|
||||
$checkTorrentSql = "SELECT id, size, owner, sp_state, seeders, leechers, UNIX_TIMESTAMP(added) AS ts, banned, hr, approval_status FROM torrents WHERE " . hash_where("info_hash", $info_hash);
|
||||
$checkTorrentSql = "SELECT torrents.id, size, owner, sp_state, seeders, leechers, UNIX_TIMESTAMP(added) AS ts, added, banned, hr, approval_status, categories.mode FROM torrents left join categories on torrents.category = categories.id WHERE " . hash_where("info_hash", $info_hash);
|
||||
if (!$torrent = $Cache->get_value('torrent_hash_'.$info_hash.'_content')){
|
||||
$res = sql_query($checkTorrentSql);
|
||||
$torrent = mysql_fetch_array($res);
|
||||
@@ -405,7 +405,7 @@ else // continue an existing session
|
||||
$upSpeedMbps = number_format(($trueupthis / $self['announcetime'] / 1024 / 1024) * 8);
|
||||
do_log("notSeedBoxMaxSpeedMbps: $notSeedBoxMaxSpeedMbps, upSpeedMbps: $upSpeedMbps");
|
||||
if ($upSpeedMbps > $notSeedBoxMaxSpeedMbps) {
|
||||
(new \App\Repositories\UserRepository())->updateDownloadPrivileges(null, $userid, 'no');
|
||||
(new \App\Repositories\UserRepository())->updateDownloadPrivileges(null, $userid, 'no', 'upload_over_speed');
|
||||
do_log("user: $userid downloading privileges have been disabled! (over speed), notSeedBoxMaxSpeedMbps: $notSeedBoxMaxSpeedMbps > upSpeedMbps: $upSpeedMbps", 'error');
|
||||
err("Your downloading privileges have been disabled! (over speed)");
|
||||
}
|
||||
@@ -553,9 +553,10 @@ elseif(isset($self))
|
||||
if (!empty($snatchInfo)) {
|
||||
sql_query("UPDATE snatched SET uploaded = uploaded + $trueupthis, downloaded = downloaded + $truedownthis, to_go = $left, $announcetime, last_action = ".$dt." $finished_snatched WHERE torrentid = $torrentid AND userid = $userid") or err("SL Err 2");
|
||||
do_action('snatched_saved', $torrent, $snatchInfo);
|
||||
if ($event == 'completed' && $az['class'] < \App\Models\HitAndRun::MINIMUM_IGNORE_USER_CLASS && !$isDonor) {
|
||||
if ($event == 'completed' && $az['class'] < \App\Models\HitAndRun::MINIMUM_IGNORE_USER_CLASS && !$isDonor && isset($torrent['mode'])) {
|
||||
//think about H&R
|
||||
$hrMode = get_setting('hr.mode');
|
||||
// $hrMode = get_setting('hr.mode');
|
||||
$hrMode = \App\Models\HitAndRun::getConfig('mode', $torrent['mode']);
|
||||
if ($hrMode == \App\Models\HitAndRun::MODE_GLOBAL || ($hrMode == \App\Models\HitAndRun::MODE_MANUAL && $torrent['hr'] == \App\Models\Torrent::HR_YES)) {
|
||||
$sql = "insert into hit_and_runs (uid, torrent_id, snatched_id) values ($userid, $torrentid, {$snatchInfo['id']}) on duplicate key update updated_at = " . sqlesc(date('Y-m-d H:i:s'));
|
||||
$affectedRows = sql_query($sql);
|
||||
|
||||
@@ -784,6 +784,7 @@ elseif($action == 'submit')
|
||||
$updateset[] = "name=".sqlesc($name);
|
||||
$updateset[] = "image=".sqlesc($image);
|
||||
$updateset[] = "class_name=".sqlesc($class_name);
|
||||
$updateset[] = "source=".sqlesc($source);
|
||||
$updateset[] = "medium=".sqlesc($medium);
|
||||
$updateset[] = "codec=".sqlesc($codec);
|
||||
$updateset[] = "standard=".sqlesc($standard);
|
||||
|
||||
+12
-3
@@ -18,7 +18,11 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
$email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
|
||||
$body = filter_input(INPUT_POST, 'body', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
if(empty($email) || empty($body)) stderr($lang_functions['std_error'], $lang_complains['text_new_failure']);
|
||||
sql_query(sprintf('INSERT INTO complains (uuid, email, body, added) VALUES (UUID(), %s, %s, NOW())', sqlesc($email), sqlesc($body))) or sqlerr(__FILE__, __LINE__);
|
||||
$user = \App\Models\User::query()->where('email', $email)->first();
|
||||
if (!$user) {
|
||||
stderr($lang_functions['std_error'], $lang_complains['text_new_failure']);
|
||||
}
|
||||
sql_query(sprintf('INSERT INTO complains (uuid, email, body, added, ip) VALUES (UUID(), %s, %s, NOW(), %s)', sqlesc($email), sqlesc($body), sqlesc(getip()))) or sqlerr(__FILE__, __LINE__);
|
||||
$Cache->delete_value('COMPLAINTS_COUNT_CACHE');
|
||||
nexus_redirect(sprintf('complains.php?action=view&id=%s', get_single_value('complains', 'uuid', 'WHERE id = ' . mysql_insert_id())));
|
||||
break;
|
||||
@@ -27,7 +31,7 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
$body = filter_input(INPUT_POST, 'body', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
$complain = \App\Models\Complain::query()->findOrFail($id);
|
||||
if(empty($id) || empty($body)) stderr($lang_functions['std_error'], $lang_complains['text_new_failure']);
|
||||
sql_query(sprintf('INSERT INTO complain_replies (complain, userid, added, body) VALUES (%u, %u, NOW(), %s)', $id, $uid, sqlesc($body))) or sqlerr(__FILE__, __LINE__);
|
||||
sql_query(sprintf('INSERT INTO complain_replies (complain, userid, added, body, ip) VALUES (%u, %u, NOW(), %s, %s)', $id, $uid, sqlesc($body), sqlesc(getip()))) or sqlerr(__FILE__, __LINE__);
|
||||
if ($uid > 0) {
|
||||
try {
|
||||
$toolRep = new \App\Repositories\ToolRepository();
|
||||
@@ -110,6 +114,7 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
if ($user) {
|
||||
printf(' [<a href="user-ban-log.php?q=%s" class="faqlink" target="_blank">%s</a>]', urlencode($user->username), $lang_complains['text_view_band_log']);
|
||||
}
|
||||
printf('<br />IP: ' . htmlspecialchars($complain['ip']));
|
||||
}
|
||||
echo '<hr />', format_comment($complain['body']);
|
||||
end_frame();
|
||||
@@ -118,7 +123,11 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
$res = sql_query(sprintf('SELECT * FROM `complain_replies` WHERE complain = %u ORDER BY id DESC', $complain['id'])) or sqlerr(__FILE__, __LINE__);
|
||||
if(mysql_num_rows($res)){
|
||||
while($row = mysql_fetch_assoc($res)){
|
||||
printf('<b>%s @ %s</b>: ', $row['userid'] ? get_plain_username($row['userid']) : $lang_complains['text_complainer'], gettime($row['added']));
|
||||
printf('<b>%s @ %s', $row['userid'] ? get_plain_username($row['userid']) : $lang_complains['text_complainer'], gettime($row['added']));
|
||||
if ($isAdmin) {
|
||||
printf(' (%s)', htmlspecialchars($row['ip']));
|
||||
}
|
||||
echo ': </b>';
|
||||
echo format_comment($row['body']) . '<hr />';
|
||||
}
|
||||
}else{
|
||||
|
||||
+17
-7
@@ -70,7 +70,7 @@ if (!$row) {
|
||||
$banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : "");
|
||||
$sp_torrent = get_torrent_promotion_append($row['sp_state'],'word', false, '', 0, '', $row['__ignore_global_sp_state'] ?? false);
|
||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);
|
||||
$hrImg = get_hr_img($row);
|
||||
$hrImg = get_hr_img($row, $row['search_box_id']);
|
||||
$approvalStatusIcon = $torrentRep->renderApprovalStatus($row["approval_status"]);
|
||||
$s=htmlspecialchars($row["name"]).$banned_torrent.($sp_torrent ? " ".$sp_torrent : "").($sp_torrent_sub) . $hrImg . $approvalStatusIcon;
|
||||
print("<h1 align=\"center\" id=\"top\">".$s."</h1>\n");
|
||||
@@ -101,7 +101,7 @@ if (!$row) {
|
||||
|
||||
// ------------- start upped by block ------------------//
|
||||
if($row['anonymous'] == 'yes') {
|
||||
if (!user_can('viewanonymous'))
|
||||
if (!user_can('viewanonymous') && $row['owner'] != $CURUSER['id'])
|
||||
$uprow = "<i>".$lang_details['text_anonymous']."</i>";
|
||||
else
|
||||
$uprow = "<i>".$lang_details['text_anonymous']."</i> (" . get_username($row['owner'], false, true, true, false, false, true) . ")";
|
||||
@@ -126,6 +126,13 @@ if (!$row) {
|
||||
if ($smalldescription_main == 'yes')
|
||||
tr($lang_details['row_small_description'],htmlspecialchars(trim($row["small_descr"])),true);
|
||||
|
||||
//tag
|
||||
$torrentTags = \App\Models\TorrentTag::query()->where('torrent_id', $row['id'])->get();
|
||||
if ($torrentTags->isNotEmpty()) {
|
||||
$tagRep = new \App\Repositories\TagRepository();
|
||||
tr($lang_details['row_tags'], $tagRep->renderSpan($torrentTags->pluck('tag_id')->toArray()),true);
|
||||
}
|
||||
|
||||
$size_info = "<b>".$lang_details['text_size']."</b>" . mksize($row["size"]);
|
||||
$type_info = " <b>".$lang_details['row_type'].":</b> ".$row["cat_name"];
|
||||
$source_info = $medium_info = $codec_info = $audiocodec_info = $standard_info = $processing_info = $team_info = '';
|
||||
@@ -267,8 +274,11 @@ JS;
|
||||
print("</td></tr>\n");
|
||||
// ---------------- end subtitle block -------------------//
|
||||
|
||||
//hook before desc
|
||||
do_action('torrent_detail_before_desc', $row['id'], $CURUSER['id']);
|
||||
|
||||
/**************start custom fields****************/
|
||||
echo $customField->renderOnTorrentDetailsPage($id);
|
||||
echo $customField->renderOnTorrentDetailsPage($id, $row['search_box_id']);
|
||||
|
||||
/**************end custom fields****************/
|
||||
|
||||
@@ -290,10 +300,10 @@ JS;
|
||||
|
||||
if (user_can('viewnfo') && $CURUSER['shownfo'] != 'no' && $row["nfosz"] > 0){
|
||||
if (!$nfo = $Cache->get_value('nfo_block_torrent_id_'.$id)){
|
||||
$nfo = code($row["nfo"], $view == "magic");
|
||||
$nfo = code_new($row["nfo"], get_setting('torrent.nfo_view_style_default'));
|
||||
$Cache->cache_value('nfo_block_torrent_id_'.$id, $nfo, 604800);
|
||||
}
|
||||
tr("<a href=\"javascript: klappe_news('nfo')\"><img class=\"plus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picnfo\" title=\"".$lang_details['title_show_or_hide']."\" /> ".$lang_details['text_nfo']."</a><br /><a href=\"viewnfo.php?id=".$row['id']."\" class=\"sublink\">". $lang_details['text_view_nfo']. "</a>", "<div id='knfo' style=\"display: none;\"><pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">".$nfo."</pre></div>\n", 1);
|
||||
tr("<a href=\"javascript: klappe_news('nfo')\"><img class=\"plus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picnfo\" title=\"".$lang_details['title_show_or_hide']."\" /> ".$lang_details['text_nfo']."</a><br /><a href=\"viewnfo.php?id=".$row['id']."\" class=\"sublink\">". $lang_details['text_view_nfo']. "</a>", "<div id='knfo' style=\"display: none;\"><pre style=\"font-size:10pt; font-family: 'Courier New', monospace;white-space: break-spaces\">".$nfo."</pre></div>\n", 1);
|
||||
}
|
||||
|
||||
if ($imdb_id && $showextinfo['imdb'] == 'yes' && $CURUSER['showimdb'] != 'no')
|
||||
@@ -376,7 +386,7 @@ JS;
|
||||
{
|
||||
// $where_area = " url = " . sqlesc((int)$imdb_id) ." AND torrents.id != ".sqlesc($id);
|
||||
$where_area = sprintf('torrents.id in (%s)', implode(',', $otherCopiesIdArr));
|
||||
$copies_res = sql_query("SELECT torrents.id, torrents.name, torrents.sp_state, torrents.size, torrents.added, torrents.seeders, torrents.leechers, torrents.hr,categories.id AS catid, categories.name AS catname, categories.image AS catimage, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name FROM torrents LEFT JOIN categories ON torrents.category=categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id WHERE " . $where_area . " ORDER BY torrents.id DESC") or sqlerr(__FILE__, __LINE__);
|
||||
$copies_res = sql_query("SELECT torrents.id, torrents.name, torrents.sp_state, torrents.size, torrents.added, torrents.seeders, torrents.leechers, torrents.hr,categories.id AS catid, categories.name AS catname, categories.image AS catimage, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, categories.mode as search_box_id FROM torrents LEFT JOIN categories ON torrents.category=categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id WHERE " . $where_area . " ORDER BY torrents.id DESC") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
$copies_count = mysql_num_rows($copies_res);
|
||||
if($copies_count > 0)
|
||||
@@ -406,7 +416,7 @@ JS;
|
||||
|
||||
$sphighlight = get_torrent_bg_color($copy_row['sp_state']);
|
||||
$sp_info = get_torrent_promotion_append($copy_row['sp_state'], '', false, '', 0, '', $copy_row['__ignore_global_sp_state'] ?? false);
|
||||
$hrImg = get_hr_img($copy_row);
|
||||
$hrImg = get_hr_img($copy_row, $copy_row['search_box_id']);
|
||||
|
||||
$s .= "<tr". $sphighlight."><td class=\"rowfollow nowrap\" valign=\"middle\" style='padding: 0px'>".return_category_image($copy_row["catid"], "torrents.php?allsec=1&")."</td><td class=\"rowfollow\" align=\"left\"><a href=\"" . htmlspecialchars(get_protocol_prefix() . $BASEURL . "/details.php?id=" . $copy_row["id"]. "&hit=1")."\">" . $dispname ."</a>". $sp_info. $hrImg ."</td>" .
|
||||
"<td class=\"rowfollow\" align=\"left\">" . rtrim(trim($other_source_info . $other_medium_info . $other_codec_info . $other_standard_info . $other_processing_info), ","). "</td>" .
|
||||
|
||||
+29
-10
@@ -17,6 +17,7 @@ if (!$row) die();
|
||||
* @since v1.6
|
||||
*/
|
||||
$customField = new \Nexus\Field\Field();
|
||||
$hitAndRunRep = new \App\Repositories\HitAndRunRepository();
|
||||
|
||||
$tagIdArr = \App\Models\TorrentTag::query()->where('torrent_id', $id)->get()->pluck('tag_id')->toArray();
|
||||
$searchBoxRep = new \App\Repositories\SearchBoxRepository();
|
||||
@@ -68,8 +69,6 @@ else {
|
||||
echo $ptGen->renderUploadPageFormInput($row['pt_gen']);
|
||||
}
|
||||
|
||||
$customField->renderOnUploadPage($id);
|
||||
|
||||
if ($enablenfo_main=='yes')
|
||||
tr($lang_edit['row_nfo_file'], "<font class=\"medium\"><input type=\"radio\" name=\"nfoaction\" value=\"keep\" checked=\"checked\" />".$lang_edit['radio_keep_current'].
|
||||
"<input type=\"radio\" name=\"nfoaction\" value=\"remove\" />".$lang_edit['radio_remove'].
|
||||
@@ -82,7 +81,7 @@ else {
|
||||
tr($lang_functions['text_technical_info'], '<textarea name="technical_info" rows="8" style="width: 99%;">' . $row['technical_info'] . '</textarea><br/>' . $lang_functions['text_technical_info_help_text'], 1);
|
||||
}
|
||||
|
||||
$s = "<select name=\"type\" id=\"oricat\">";
|
||||
$s = "<select name=\"type\" id=\"oricat\" data-mode='$sectionmode'>";
|
||||
|
||||
$cats = genrelist($sectionmode);
|
||||
foreach ($cats as $subrow) {
|
||||
@@ -94,7 +93,7 @@ else {
|
||||
|
||||
$s .= "</select>\n";
|
||||
if ($allowmove){
|
||||
$s2 = "<select name=\"type\" id=newcat disabled>\n";
|
||||
$s2 = "<select name=\"type\" id=newcat disabled data-mode='$othermode'>\n";
|
||||
$cats2 = genrelist($othermode);
|
||||
foreach ($cats2 as $subrow) {
|
||||
$s2 .= "<option value=\"" . $subrow["id"] . "\"";
|
||||
@@ -153,10 +152,14 @@ else {
|
||||
|
||||
$sectionCurrent = $searchBoxRep->renderQualitySelect($sectionmode);
|
||||
tr($lang_edit['row_quality'], $sectionCurrent, 1, "hide mode mode_$sectionmode");
|
||||
echo $customField->renderOnUploadPage($id, $sectionmode);
|
||||
echo $hitAndRunRep->renderOnUploadPage($row['hr'], $sectionmode);
|
||||
|
||||
if ($allowmove && $othermode) {
|
||||
$selectOther = $searchBoxRep->renderQualitySelect($othermode);
|
||||
tr($lang_edit['row_quality'], $selectOther, 1, "hide mode mode_$othermode");
|
||||
echo $customField->renderOnUploadPage($id, $othermode);
|
||||
echo $hitAndRunRep->renderOnUploadPage($row['hr'], $othermode);
|
||||
}
|
||||
|
||||
tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox($tagIdArr), 1);
|
||||
@@ -194,7 +197,8 @@ else {
|
||||
foreach (\App\Models\Torrent::listPosStates() as $key => $value) {
|
||||
$options[] = "<option" . (($row["pos_state"] == $key) ? " selected=\"selected\"" : "" ) . " value=\"" . $key . "\">".$value['text']."</option>";
|
||||
}
|
||||
$pickcontent .= "<b>".$lang_edit['row_torrent_position'].": </b>"."<select name=\"sel_posstate\" style=\"width: 100px;\">" . implode('', $options) . "</select> ";
|
||||
$pickcontent .= "<b>".$lang_edit['row_torrent_position'].": </b>"."<select name=\"pos_state\" style=\"width: 100px;\">" . implode('', $options) . "</select> ";
|
||||
$pickcontent .= datetimepicker_input('pos_state_until', $row['pos_state_until'], nexus_trans('label.deadline') . ": ");
|
||||
}
|
||||
if(user_can('torrentmanage') && ($CURUSER["picker"] == 'yes' || get_user_class() >= \App\Models\User::CLASS_SYSOP))
|
||||
{
|
||||
@@ -208,11 +212,6 @@ else {
|
||||
}
|
||||
tr($lang_edit['row_pick'], $pickcontent, 1);
|
||||
}
|
||||
if (get_setting('hr.mode') == \App\Models\HitAndRun::MODE_MANUAL && user_can('torrent_hr')) {
|
||||
$hrRadio = sprintf('<label><input type="radio" name="hr" value="0"%s />NO</label>', (string)$row['hr'] === '0' ? ' checked' : '');
|
||||
$hrRadio .= sprintf('<label><input type="radio" name="hr" value="1"%s />YES</label>', (string)$row['hr'] === '1' ? ' checked' : '');
|
||||
tr('H&R', $hrRadio, 1);
|
||||
}
|
||||
|
||||
print("<tr><td class=\"toolbox\" colspan=\"2\" align=\"center\"><input id=\"qr\" type=\"submit\" value=\"".$lang_edit['submit_edit_it']."\" /> <input type=\"reset\" value=\"".$lang_edit['submit_revert_changes']."\" /></td></tr>\n");
|
||||
print("</table>\n");
|
||||
@@ -293,6 +292,26 @@ EOT;
|
||||
}
|
||||
\Nexus\Nexus::js('vendor/jquery-loading/jquery.loading.min.js', 'footer', true);
|
||||
\Nexus\Nexus::js('js/ptgen.js', 'footer', true);
|
||||
$customFieldJs = <<<JS
|
||||
jQuery("#movecheck").on("change", function () {
|
||||
let _this = jQuery(this);
|
||||
let checked = _this.prop("checked");
|
||||
let activeSelect
|
||||
if (checked) {
|
||||
activeSelect = jQuery("#newcat");
|
||||
} else {
|
||||
activeSelect = jQuery("#oricat");
|
||||
}
|
||||
let mode = activeSelect.attr("data-mode");
|
||||
console.log(mode)
|
||||
jQuery("tr[relation]").hide();
|
||||
jQuery("tr[relation=mode_" + mode +"]").show();
|
||||
})
|
||||
jQuery("tr[relation]").hide();
|
||||
jQuery("tr[relation=mode_{$sectionmode}]").show();
|
||||
|
||||
JS;
|
||||
\Nexus\Nexus::js($customFieldJs, 'footer', false);
|
||||
stdfoot();
|
||||
function getAddedTimeOption($timeStamp, $addSeconds) {
|
||||
$timeStamp += $addSeconds;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
require "../include/bittorrent.php";
|
||||
dbconn();
|
||||
require_once(get_langfile_path());
|
||||
require_once(get_langfile_path('catmanage.php'));
|
||||
loggedinorreturn();
|
||||
if (get_user_class() < UC_ADMINISTRATOR) {
|
||||
permissiondenied();
|
||||
|
||||
@@ -11,6 +11,7 @@ header("Pragma: no-cache" );
|
||||
|
||||
$torrentRep = new \App\Repositories\TorrentRepository();
|
||||
$claimRep = new \App\Repositories\ClaimRepository();
|
||||
$seedBoxRep = new \App\Repositories\SeedBoxRepository();
|
||||
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
|
||||
$id = intval($_GET['userid'] ?? 0);
|
||||
$type = $_GET['type'];
|
||||
@@ -22,8 +23,8 @@ if(!user_can('torrenthistory') && $id != $CURUSER["id"])
|
||||
function maketable($res, $mode = 'seeding')
|
||||
{
|
||||
global $lang_getusertorrentlistajax,$CURUSER,$smalldescription_main, $lang_functions, $id;
|
||||
global $torrentRep, $claimRep, $claimTorrentTTL;
|
||||
$showActionClaim = false;
|
||||
global $torrentRep, $claimRep, $claimTorrentTTL, $seedBoxRep;
|
||||
$showActionClaim = $showClient = false;
|
||||
switch ($mode)
|
||||
{
|
||||
case 'uploaded': {
|
||||
@@ -55,6 +56,7 @@ function maketable($res, $mode = 'seeding')
|
||||
$showtotalsize = true;
|
||||
$columncount = 8;
|
||||
$showActionClaim = true;
|
||||
$showClient = true;
|
||||
break;
|
||||
}
|
||||
case 'leeching': {
|
||||
@@ -69,6 +71,7 @@ function maketable($res, $mode = 'seeding')
|
||||
$showcotime = false;
|
||||
$showanonymous = false;
|
||||
$showtotalsize = true;
|
||||
$showClient = true;
|
||||
$columncount = 8;
|
||||
break;
|
||||
}
|
||||
@@ -105,6 +108,10 @@ function maketable($res, $mode = 'seeding')
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
$shouldShowClient = false;
|
||||
if ($showClient && (user_can('userprofile') || $CURUSER['id'] == $id)) {
|
||||
$shouldShowClient = true;
|
||||
}
|
||||
$results = $torrentIdArr = [];
|
||||
while ($row = mysql_fetch_assoc($res)) {
|
||||
$results[] = $row;
|
||||
@@ -129,6 +136,9 @@ function maketable($res, $mode = 'seeding')
|
||||
|
||||
$ret = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td class=\"colhead\" style=\"padding: 0px\">".$lang_getusertorrentlistajax['col_type']."</td><td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_name']."</td><td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_added']."</td>".
|
||||
($showsize ? "<td class=\"colhead\" align=\"center\"><img class=\"size\" src=\"pic/trans.gif\" alt=\"size\" title=\"".$lang_getusertorrentlistajax['title_size']."\" /></td>" : "").($showsenum ? "<td class=\"colhead\" align=\"center\"><img class=\"seeders\" src=\"pic/trans.gif\" alt=\"seeders\" title=\"".$lang_getusertorrentlistajax['title_seeders']."\" /></td>" : "").($showlenum ? "<td class=\"colhead\" align=\"center\"><img class=\"leechers\" src=\"pic/trans.gif\" alt=\"leechers\" title=\"".$lang_getusertorrentlistajax['title_leechers']."\" /></td>" : "").($showuploaded ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_uploaded']."</td>" : "") . ($showdownloaded ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_downloaded']."</td>" : "").($showratio ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_ratio']."</td>" : "").($showsetime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_se_time']."</td>" : "").($showletime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_le_time']."</td>" : "").($showcotime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_time_completed']."</td>" : "").($showanonymous ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_anonymous']."</td>" : "");
|
||||
if ($shouldShowClient) {
|
||||
$ret .= sprintf('<td class="colhead" align="center">%s</td><td class="colhead" align="center">IP</td>', $lang_getusertorrentlistajax['col_client']);
|
||||
}
|
||||
$ret .= sprintf('<td class="colhead" align="center">%s</td>', $lang_functions['std_action']);
|
||||
$ret .= "</tr>";
|
||||
$total_size = 0;
|
||||
@@ -150,7 +160,7 @@ function maketable($res, $mode = 'seeding')
|
||||
$total_size += $arr['size'];
|
||||
}
|
||||
|
||||
$hrImg = get_hr_img($arr);
|
||||
$hrImg = get_hr_img($arr, $arr['search_box_id']);
|
||||
$approvalStatusIcon = $torrentRep->renderApprovalStatus($arr["approval_status"]);
|
||||
//torrent name
|
||||
$dispname = $nametitle = htmlspecialchars($arr["torrentname"]);
|
||||
@@ -212,6 +222,17 @@ function maketable($res, $mode = 'seeding')
|
||||
$ret .= "<td class=\"rowfollow\" align=\"center\">"."". str_replace(" ", "<br />", gettime($arr['completedat'],false)). "</td>";
|
||||
if ($showanonymous)
|
||||
$ret .= "<td class=\"rowfollow\" align=\"center\">".$arr['anonymous']."</td>";
|
||||
if ($shouldShowClient) {
|
||||
$ipArr = array_filter([$arr['ipv4'], $arr['ipv6']]);
|
||||
foreach ($ipArr as &$_ip) {
|
||||
$_ip = sprintf('<span class="nowrap">%s</span>', $_ip . $seedBoxRep->renderIcon($_ip, $arr['userid']));
|
||||
}
|
||||
$ret .= sprintf(
|
||||
'<td class="rowfollow" align="center">%s<br/>%s</td><td class="rowfollow" align="center">%s</td>',
|
||||
get_agent($arr['peer_id'], $arr['agent']), $arr['port'],
|
||||
implode('<br/>', $ipArr)
|
||||
);
|
||||
}
|
||||
$claimButton = '';
|
||||
if (
|
||||
$showActionClaim
|
||||
@@ -245,7 +266,7 @@ switch ($type)
|
||||
{
|
||||
// $res = sql_query("SELECT torrents.id AS torrent, torrents.name as torrentname, small_descr, seeders, leechers, anonymous, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, snatched.seedtime, snatched.uploaded FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories ON torrents.category = categories.id WHERE torrents.owner=$id AND snatched.userid=$id " . (($CURUSER["id"] != $id)?((get_user_class() < $viewanonymous_class) ? " AND anonymous = 'no'":""):"") ." ORDER BY torrents.added DESC") or sqlerr(__FILE__, __LINE__);
|
||||
// $res = sql_query("SELECT torrents.id AS torrent, torrents.name as torrentname, small_descr, seeders, leechers, anonymous, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added FROM torrents LEFT JOIN categories ON torrents.category = categories.id WHERE torrents.owner=$id " . (($CURUSER["id"] != $id)?((!user_can('viewanonymous')) ? " AND anonymous = 'no'":""):"") ." ORDER BY torrents.id DESC") or sqlerr(__FILE__, __LINE__);
|
||||
$fields = "torrents.id AS torrent, torrents.name as torrentname, small_descr, seeders, leechers, anonymous, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,torrents.owner as userid";
|
||||
$fields = "torrents.id AS torrent, torrents.name as torrentname, small_descr, seeders, leechers, anonymous, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,torrents.owner as userid, categories.mode as search_box_id";
|
||||
$tableWhere = "torrents LEFT JOIN categories ON torrents.category = categories.id WHERE torrents.owner=$id";
|
||||
if ($CURUSER['id'] != $id && !user_can('viewanonymous')) {
|
||||
$tableWhere .= " AND anonymous = 'no'";
|
||||
@@ -258,7 +279,7 @@ switch ($type)
|
||||
case 'seeding':
|
||||
{
|
||||
// $res = sql_query("SELECT torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='yes' ORDER BY torrents.id DESC") or sqlerr();
|
||||
$fields = "torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers,snatched.seedtime,snatched.uploaded,snatched.userid";
|
||||
$fields = "torrent,added,snatched.uploaded,snatched.downloaded,snatched.seedtime,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers,snatched.userid, categories.mode as search_box_id, peers.peer_id, peers.agent, peers.port, peers.ipv4, peers.ipv6";
|
||||
$tableWhere = "peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='yes'";
|
||||
$order = "torrents.id DESC";
|
||||
break;
|
||||
@@ -268,7 +289,7 @@ switch ($type)
|
||||
case 'leeching':
|
||||
{
|
||||
// $res = sql_query("SELECT torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='no' ORDER BY torrents.id DESC") or sqlerr();
|
||||
$fields = "torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added,snatched.seedtime,snatched.uploaded,snatched.userid";
|
||||
$fields = "torrent,snatched.uploaded,snatched.downloaded,snatched.seedtime,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added,snatched.userid, categories.mode as search_box_id, peers.peer_id, peers.agent, peers.port, peers.ipv4, peers.ipv6";
|
||||
$tableWhere = "peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='no'";
|
||||
$order = "torrents.id DESC";
|
||||
break;
|
||||
@@ -278,7 +299,7 @@ switch ($type)
|
||||
case 'completed':
|
||||
{
|
||||
// $res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime, snatched.leechtime, snatched.completedat FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='yes' AND torrents.owner != $id AND userid=$id ORDER BY snatched.id DESC") or sqlerr();
|
||||
$fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime,snatched.uploaded, snatched.leechtime, snatched.completedat,snatched.userid";
|
||||
$fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime,snatched.uploaded, snatched.leechtime, snatched.completedat,snatched.userid, categories.mode as search_box_id";
|
||||
$tableWhere = "torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='yes' AND userid=$id AND torrents.owner != $id";
|
||||
$order = "snatched.id DESC";
|
||||
break;
|
||||
@@ -288,7 +309,7 @@ switch ($type)
|
||||
case 'incomplete':
|
||||
{
|
||||
// $res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='no' AND userid=$id AND torrents.owner != $id ORDER BY snatched.id DESC") or sqlerr();
|
||||
$fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime,snatched.seedtime,snatched.uploaded,snatched.userid";
|
||||
$fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime,snatched.seedtime,snatched.userid, categories.mode as search_box_id";
|
||||
$tableWhere = "torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='no' AND userid=$id AND torrents.owner != $id";
|
||||
$order = "snatched.id DESC";
|
||||
break;
|
||||
|
||||
@@ -64,7 +64,7 @@ $classes = array_chunk(\App\Models\User::$classes, 4, true);
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<?php do_action('increment_bulk_form_filters') ?>
|
||||
<?php do_action('form_role_filter', 'Add to Role') ?>
|
||||
<tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr>
|
||||
<tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body ?? ''?></textarea></td></tr>
|
||||
<tr>
|
||||
|
||||
+25
-2
@@ -137,10 +137,33 @@ if ($showfunbox_main == "yes" && (!isset($CURUSER) || $CURUSER['showfb'] == "yes
|
||||
// ------------- start: shoutbox ------------------//
|
||||
if ($showshoutbox_main == "yes") {
|
||||
?>
|
||||
<h2><?php echo $lang_index['text_shoutbox'] ?> - <font class="small"><?php echo $lang_index['text_auto_refresh_after']?></font><font class='striking' id="countdown"></font><font class="small"><?php echo $lang_index['text_seconds']?></font></h2>
|
||||
<h2>
|
||||
<?php echo $lang_index['text_shoutbox'] ?> - <font class="small"><?php echo $lang_index['text_auto_refresh_after']?></font>
|
||||
<font class='striking' id="countdown"></font><font class="small"><?php echo $lang_index['text_seconds']?></font>
|
||||
<?php
|
||||
if (user_can('sbmanage')) {
|
||||
echo ' - <font class="small" id="clear-shout-box">[<a class="altlink" href="javascript:;"><b>'.$lang_index['clear_shout_box'].'</b></a>]</font>';
|
||||
$clearShoutBoxJs = <<<JS
|
||||
jQuery('#clear-shout-box').on("click", function () {
|
||||
layer.confirm("{$lang_index['sure_to_clear_shout_box']}", {title: "Info", btn: ['Yes', "Cancel"], btnAlign: 'c'}, function (layerIndex) {
|
||||
jQuery.post("ajax.php", {"action": "clearShoutBox"}, function (response) {
|
||||
layer.close(layerIndex)
|
||||
if (response.ret != 0) {
|
||||
layer.alert(response.msg, {title: "Info", btn: ['OK', 'Cancel'], btnAlign: 'c'})
|
||||
} else {
|
||||
document.getElementById('iframe-shout-box').src='shoutbox.php?type=shoutbox';
|
||||
}
|
||||
}, "json")
|
||||
})
|
||||
})
|
||||
JS;
|
||||
\Nexus\Nexus::js($clearShoutBoxJs, 'footer', false);
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
<?php
|
||||
print("<table width=\"100%\"><tr><td class=\"text\">\n");
|
||||
print("<iframe src='shoutbox.php?type=shoutbox' width='100%' height='180' frameborder='0' name='sbox' marginwidth='0' marginheight='0'></iframe><br /><br />\n");
|
||||
print("<iframe id='iframe-shout-box' src='shoutbox.php?type=shoutbox' width='100%' height='180' frameborder='0' name='sbox' marginwidth='0' marginheight='0'></iframe><br /><br />\n");
|
||||
print("<form action='shoutbox.php' method='get' target='sbox' name='shbox'>\n");
|
||||
print('<div style="display: flex">');
|
||||
print("<label for='shbox_text'>".$lang_index['text_message']."</label><input type='text' name='shbox_text' id='shbox_text' size='100' style='flex-grow: 1; border: 1px solid gray;' /> <input type='submit' id='hbsubmit' class='btn' name='shout' value=\"".$lang_index['sumbit_shout']."\" />");
|
||||
|
||||
+13
-6
@@ -10,19 +10,19 @@ $menuSelected = $_REQUEST['menu'] ?? 'invitee';
|
||||
$pageSize = 50;
|
||||
|
||||
function inviteMenu ($selected = "invitee") {
|
||||
global $lang_invite, $id, $CURUSER;
|
||||
global $lang_invite, $id, $CURUSER, $invitesystem;
|
||||
begin_main_frame("", false, "100%");
|
||||
print ("<div id=\"invitenav\" style='position: relative'><ul id=\"invitemenu\" class=\"menu\">");
|
||||
print ("<li" . ($selected == "invitee" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=invitee\">".$lang_invite['text_invite_status']."</a></li>");
|
||||
print ("<li" . ($selected == "sent" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=sent\">".$lang_invite['text_sent_invites_status']."</a></li>");
|
||||
print ("</ul><form style='position: absolute;top:0;right:0' method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".($CURUSER['invites'] <= 0 ? "disabled " : "")." value='".$lang_invite['sumbit_invite_someone']."'></form></div>");
|
||||
if (user_can('sendinvite') && $invitesystem == 'yes') {
|
||||
print ("</ul><form style='position: absolute;top:0;right:0' method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".($CURUSER['invites'] <= 0 ? "disabled " : "")." value='".$lang_invite['sumbit_invite_someone']."'></form></div>");
|
||||
}
|
||||
end_main_frame();
|
||||
}
|
||||
|
||||
if (($CURUSER['id'] != $id && !user_can('viewinvite')) || !is_valid_id($id))
|
||||
stderr($lang_invite['std_sorry'],$lang_invite['std_permission_denied']);
|
||||
if (!user_can('sendinvite'))
|
||||
stderr($lang_invite['std_sorry'],$lang_invite['std_only'].get_user_class_name($sendinvite_class,false,true,true).$lang_invite['std_or_above_can_invite'],false);
|
||||
$res = sql_query("SELECT username FROM users WHERE id = ".mysql_real_escape_string($id)) or sqlerr();
|
||||
$user = mysql_fetch_assoc($res);
|
||||
stdhead($lang_invite['head_invites']);
|
||||
@@ -46,6 +46,8 @@ if ($inv["invites"] != 1){
|
||||
}
|
||||
|
||||
if ($type == 'new'){
|
||||
if (!user_can('sendinvite'))
|
||||
stderr($lang_invite['std_sorry'],$lang_invite['std_only'].get_user_class_name($sendinvite_class,false,true,true).$lang_invite['std_or_above_can_invite'],false, false);
|
||||
registration_check('invitesystem',true,false);
|
||||
if ($CURUSER['invites'] <= 0) {
|
||||
stdmsg($lang_invite['std_sorry'],$lang_invite['std_no_invites_left'].
|
||||
@@ -164,12 +166,17 @@ if ($type == 'new'){
|
||||
for ($i = 0; $i < $num1; ++$i)
|
||||
{
|
||||
$arr1 = mysql_fetch_assoc($rer);
|
||||
$isHashValid = $arr1['valid'] == \App\Models\Invite::VALID_YES;
|
||||
$registerLink = '';
|
||||
if ($isHashValid) {
|
||||
$registerLink = sprintf(' <a href="signup.php?type=invite&invitenumber=%s" title="%s" target="_blank"><small>[%s]</small></a>', $arr1['hash'], $lang_invite['signup_link_help'], $lang_invite['signup_link']);
|
||||
}
|
||||
$tr = "<tr>";
|
||||
$tr .= "<td class=rowfollow>{$arr1['invitee']}</td>";
|
||||
$tr .= "<td class=rowfollow>{$arr1['hash']}</td>";
|
||||
$tr .= sprintf('<td class="rowfollow">%s%s</td>', $arr1['hash'], $registerLink);
|
||||
$tr .= "<td class=rowfollow>{$arr1['time_invited']}</td>";
|
||||
$tr .= "<td class=rowfollow>".\App\Models\Invite::$validInfo[$arr1['valid']]['text']."</td>";
|
||||
if ($arr1['valid'] == \App\Models\Invite::VALID_NO) {
|
||||
if (!$isHashValid) {
|
||||
$tr .= "<td class=rowfollow><a href=userdetails.php?id={$arr1['invitee_register_uid']}><font color=#1f7309>".$arr1['invitee_register_username']."</font></a></td>";
|
||||
} else {
|
||||
$tr .= "<td class='rowfollow'></td>";
|
||||
|
||||
+18
-5
@@ -5,8 +5,21 @@ loggedinorreturn();
|
||||
|
||||
if (get_user_class() < UC_MODERATOR)
|
||||
stderr("Sorry", "Access denied.");
|
||||
stdhead("Duplicate IP users");
|
||||
begin_frame("Duplicate IP users:", true);
|
||||
|
||||
$tabs = ['users', 'peers'];
|
||||
$tab = 'users';
|
||||
if (!empty($_REQUEST['tab']) && in_array($_REQUEST['tab'], $tabs)) {
|
||||
$tab = $_REQUEST['tab'];
|
||||
}
|
||||
$page = $_REQUEST['page'] ?? 0;
|
||||
$title = 'Duplicate IP users';
|
||||
stdhead($title);
|
||||
print '<h1>'.$title.'</h1>';
|
||||
//print '<ul class="menu" style="padding-inline-start: 0">';
|
||||
//foreach ($tabs as $item) {
|
||||
// echo sprintf('<li class="%s"><a href="?tab=%s&page=%s">%s</a></li>', $tab == $item ? 'selected' : '', $item, $page, $item);
|
||||
//}
|
||||
//print '</ul>';
|
||||
begin_table();
|
||||
|
||||
if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
|
||||
@@ -44,7 +57,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
|
||||
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
|
||||
else
|
||||
$ratio="---";
|
||||
|
||||
|
||||
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
|
||||
$uploaded = mksize($arr["uploaded"]);
|
||||
$downloaded = mksize($arr["downloaded"]);
|
||||
@@ -54,7 +67,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
|
||||
$utc = "";
|
||||
else
|
||||
$utc = " bgcolor=\"ECE9D8\"";
|
||||
|
||||
|
||||
$peer_res = sql_query("SELECT count(*) FROM peers WHERE ip = " . sqlesc($ras['ip']) . " AND userid = " . $arr['id']);
|
||||
$peer_row = mysql_fetch_row($peer_res);
|
||||
print("<tr$utc><td align=left>" . get_username($arr["id"])."</td>
|
||||
@@ -64,7 +77,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
|
||||
<td align=center>$downloaded</td>
|
||||
<td align=center>$uploaded</td>
|
||||
<td align=center>$ratio</td>
|
||||
<td align=center><a href=\"http://www.whois.sc/$arr[ip]\" target=\"_blank\">$arr[ip]</a></td>\n<td align=center>" .
|
||||
<td align=center><a href=\"http://www.whois.sc/$arr[ip]\" target=\"_blank\">$arr[ip]</a></td>\n<td align=center>" .
|
||||
($peer_row[0] ? "ja" : "nein") . "</td></tr>\n");
|
||||
$ip = $arr["ip"];
|
||||
}
|
||||
|
||||
+70
-65
@@ -39,6 +39,33 @@ function bonusarray($option = 0){
|
||||
$bonus['description'] = $lang_mybonus['text_uploaded_note'];
|
||||
$results[] = $bonus;
|
||||
|
||||
//100.0 GB Uploaded
|
||||
$bonus = array();
|
||||
$bonus['points'] = get_setting('bonus.hundredgbupload');
|
||||
$bonus['art'] = 'traffic';
|
||||
$bonus['menge'] = 107374182400;
|
||||
$bonus['name'] = $lang_mybonus['text_uploaded_four'];
|
||||
$bonus['description'] = $lang_mybonus['text_uploaded_note'];
|
||||
$results[] = $bonus;
|
||||
|
||||
//10.0 GB Downloaded
|
||||
$bonus = array();
|
||||
$bonus['points'] = get_setting('bonus.tengbdownload');
|
||||
$bonus['art'] = 'traffic_downloaded';
|
||||
$bonus['menge'] = 10737418240;
|
||||
$bonus['name'] = $lang_mybonus['text_downloaded_ten_gb'];
|
||||
$bonus['description'] = $lang_mybonus['text_download_note'];
|
||||
$results[] = $bonus;
|
||||
|
||||
//100.0 GB Downloaded
|
||||
$bonus = array();
|
||||
$bonus['points'] = get_setting('bonus.hundredgbdownload');
|
||||
$bonus['art'] = 'traffic_downloaded';
|
||||
$bonus['menge'] = 107374182400;
|
||||
$bonus['name'] = $lang_mybonus['text_downloaded_hundred_gb'];
|
||||
$bonus['description'] = $lang_mybonus['text_download_note'];
|
||||
$results[] = $bonus;
|
||||
|
||||
//Invite
|
||||
$bonus = array();
|
||||
$bonus['points'] = $oneinvite_bonus;
|
||||
@@ -69,7 +96,7 @@ function bonusarray($option = 0){
|
||||
|
||||
//Bonus Gift
|
||||
$bonus = array();
|
||||
$bonus['points'] = 25;
|
||||
$bonus['points'] = 100;
|
||||
$bonus['art'] = 'gift_1';
|
||||
$bonus['menge'] = 0;
|
||||
$bonus['name'] = $lang_mybonus['text_bonus_gift'];
|
||||
@@ -246,6 +273,8 @@ unset($msg);
|
||||
if (isset($do)) {
|
||||
if ($do == "upload")
|
||||
$msg = $lang_mybonus['text_success_upload'];
|
||||
if ($do == "download")
|
||||
$msg = $lang_mybonus['text_success_download'];
|
||||
elseif ($do == "invite")
|
||||
$msg = $lang_mybonus['text_success_invites'];
|
||||
elseif ($do == "vip")
|
||||
@@ -310,8 +339,8 @@ for ($i=0; $i < count($allBonus); $i++)
|
||||
print("<td class=\"rowfollow\" align='left'><h1>".$bonusarray['name']."</h1>".$bonusarray['description']."<br /><br />".$lang_mybonus['text_enter_titile'].$otheroption_title.$lang_mybonus['text_click_exchange']."</td><td class=\"rowfollow\" align='center'>".number_format($bonusarray['points'])."</td>");
|
||||
}
|
||||
elseif ($bonusarray['art'] == 'gift_1'){ //for Give A Karma Gift
|
||||
$otheroption = "<table width=\"100%\"><tr><td class=\"embedded\"><b>".$lang_mybonus['text_username']."</b><input type=\"text\" name=\"username\" style=\"width: 200px\" maxlength=\"24\" /></td><td class=\"embedded\"><b>".$lang_mybonus['text_to_be_given']."</b><select name=\"bonusgift\" id=\"giftselect\" onchange=\"customgift();\"> <option value=\"25\"> 25</option><option value=\"50\"> 50</option><option value=\"100\"> 100</option> <option value=\"200\"> 200</option> <option value=\"300\"> 300</option> <option value=\"400\"> 400</option><option value=\"500\"> 500</option><option value=\"1000\" selected=\"selected\"> 1,000</option><option value=\"5000\"> 5,000</option><option value=\"10000\"> 10,000</option><option value=\"0\">".$lang_mybonus['text_custom']."</option></select><input type=\"text\" name=\"bonusgift\" id=\"giftcustom\" style='width: 80px' disabled=\"disabled\" />".$lang_mybonus['text_karma_points']."</td></tr><tr><td class=\"embedded\" colspan=\"2\"><b>".$lang_mybonus['text_message']."</b><input type=\"text\" name=\"message\" style=\"width: 400px\" maxlength=\"100\" /></td></tr></table>";
|
||||
print("<td class=\"rowfollow\" align='left'><h1>".$bonusarray['name']."</h1>".$bonusarray['description']."<br /><br />".$lang_mybonus['text_enter_receiver_name']."<br />$otheroption</td><td class=\"rowfollow nowrap\" align='center'>".$lang_mybonus['text_min']."25<br />".$lang_mybonus['text_max']."10,000</td>");
|
||||
$otheroption = "<table width=\"100%\"><tr><td class=\"embedded\"><b>".$lang_mybonus['text_username']."</b><input type=\"text\" name=\"username\" style=\"width: 200px\" maxlength=\"24\" /></td><td class=\"embedded\"><b>".$lang_mybonus['text_to_be_given']."</b><input type=\"number\" name=\"bonusgift\" id=\"giftcustom\" style='width: 80px' min='100' />".$lang_mybonus['text_karma_points']."</td></tr><tr><td class=\"embedded\" colspan=\"2\"><b>".$lang_mybonus['text_message']."</b><input type=\"text\" name=\"message\" style=\"width: 400px\" maxlength=\"100\" /></td></tr></table>";
|
||||
print("<td class=\"rowfollow\" align='left'><h1>".$bonusarray['name']."</h1>".$bonusarray['description']."<br /><br />".$lang_mybonus['text_enter_receiver_name']."<br />$otheroption</td><td class=\"rowfollow nowrap\" align='center'>".$lang_mybonus['text_min']."100</td>");
|
||||
}
|
||||
elseif ($bonusarray['art'] == 'gift_2'){ //charity giving
|
||||
$otheroption = "<table width=\"100%\"><tr><td class=\"embedded\">".$lang_mybonus['text_ratio_below']."<select name=\"ratiocharity\"> <option value=\"0.1\"> 0.1</option><option value=\"0.2\"> 0.2</option><option value=\"0.3\" selected=\"selected\"> 0.3</option> <option value=\"0.4\"> 0.4</option> <option value=\"0.5\"> 0.5</option> <option value=\"0.6\"> 0.6</option><option value=\"0.7\"> 0.7</option><option value=\"0.8\"> 0.8</option></select>".$lang_mybonus['text_and_downloaded_above']." 10 GB</td><td class=\"embedded\"><b>".$lang_mybonus['text_to_be_given']."</b><select name=\"bonuscharity\" id=\"charityselect\" > <option value=\"1000\"> 1,000</option><option value=\"2000\"> 2,000</option><option value=\"3000\" selected=\"selected\"> 3000</option> <option value=\"5000\"> 5,000</option> <option value=\"8000\"> 8,000</option> <option value=\"10000\"> 10,000</option><option value=\"20000\"> 20,000</option><option value=\"50000\"> 50,000</option></select>".$lang_mybonus['text_karma_points']."</td></tr></table>";
|
||||
@@ -391,74 +420,44 @@ print("<h1>".$lang_mybonus['text_get_by_seeding']."</h1>");
|
||||
print("<ul>");
|
||||
if ($perseeding_bonus > 0)
|
||||
print("<li>".$perseeding_bonus.$lang_mybonus['text_point'].add_s($perseeding_bonus).$lang_mybonus['text_for_seeding_torrent'].$maxseeding_bonus.$lang_mybonus['text_torrent'].add_s($maxseeding_bonus).")</li>");
|
||||
print("<li>".$lang_mybonus['text_bonus_formula_one'].$tzero_bonus.$lang_mybonus['text_bonus_formula_two'].$nzero_bonus.$lang_mybonus['text_bonus_formula_three'].$bzero_bonus.$lang_mybonus['text_bonus_formula_four'].$l_bonus.$lang_mybonus['text_bonus_formula_five']."</li>");
|
||||
print("<li>".$lang_mybonus['text_bonus_formula_one'].$tzero_bonus.$lang_mybonus['text_bonus_formula_two'].$nzero_bonus.$lang_mybonus['text_bonus_formula_wi'].get_setting('bonus.zero_bonus_factor').$lang_mybonus['text_bonus_formula_three'].$bzero_bonus.$lang_mybonus['text_bonus_formula_four'].$l_bonus.$lang_mybonus['text_bonus_formula_five']."</li>");
|
||||
if ($donortimes_bonus)
|
||||
print("<li>".$lang_mybonus['text_donors_always_get'].$donortimes_bonus.$lang_mybonus['text_times_of_bonus']."</li>");
|
||||
|
||||
print("</ul>");
|
||||
|
||||
// $sqrtof2 = sqrt(2);
|
||||
// $logofpointone = log(0.1);
|
||||
// $valueone = $logofpointone / $tzero_bonus;
|
||||
// $pi = 3.141592653589793;
|
||||
// $valuetwo = $bzero_bonus * ( 2 / $pi);
|
||||
// $valuethree = $logofpointone / ($nzero_bonus - 1);
|
||||
// $timenow = strtotime(date("Y-m-d H:i:s"));
|
||||
// $sectoweek = 7*24*60*60;
|
||||
// $A = 0;
|
||||
// $count = 0;
|
||||
// $torrentres = sql_query("select torrents.id, torrents.added, torrents.size, torrents.seeders from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $CURUSER[id] AND peers.seeder ='yes' GROUP BY torrents.id") or sqlerr(__FILE__, __LINE__);
|
||||
// while ($torrent = mysql_fetch_array($torrentres))
|
||||
// {
|
||||
// $weeks_alive = ($timenow - strtotime($torrent['added'])) / $sectoweek;
|
||||
// $gb_size = $torrent['size'] / 1073741824;
|
||||
// $temp = (1 - exp($valueone * $weeks_alive)) * $gb_size * (1 + $sqrtof2 * exp($valuethree * ($torrent['seeders'] - 1)));
|
||||
// $A += $temp;
|
||||
// $count++;
|
||||
// }
|
||||
// if ($count > $maxseeding_bonus)
|
||||
// $count = $maxseeding_bonus;
|
||||
// $all_bonus = $valuetwo * atan($A / $l_bonus) + ($perseeding_bonus * $count);
|
||||
|
||||
$seedBonusResult = calculate_seed_bonus($CURUSER['id']);
|
||||
$all_bonus = $seedBonusResult['all_bonus'];
|
||||
$A = $seedBonusResult['A'];
|
||||
|
||||
$percent = $all_bonus * 100 / ($bzero_bonus + $perseeding_bonus * $maxseeding_bonus);
|
||||
print("<div align=\"center\">".$lang_mybonus['text_you_are_currently_getting'].round($all_bonus,3).$lang_mybonus['text_point'].add_s($all_bonus).$lang_mybonus['text_per_hour']." (A = ".round($A,1).")</div><table align=\"center\" border=\"0\" width=\"400\"><tr><td class=\"loadbarbg\" style='border: none; padding: 0px;'>");
|
||||
$bonusTableResult = build_bonus_table($CURUSER, $seedBonusResult, ['table_style' => 'width: 50%']);
|
||||
|
||||
if ($percent <= 30) $loadpic = "loadbarred";
|
||||
elseif ($percent <= 60) $loadpic = "loadbaryellow";
|
||||
else $loadpic = "loadbargreen";
|
||||
$width = $percent * 4;
|
||||
print("<img class=\"".$loadpic."\" src=\"pic/trans.gif\" style=\"width: ".$width."px;\" alt=\"".$percent."%\" /></td></tr></table>");
|
||||
$percent = $seedBonusResult['seed_bonus'] * 100 / ($bzero_bonus + $perseeding_bonus * $maxseeding_bonus);
|
||||
print("<div align=\"center\">".$lang_mybonus['text_you_are_currently_getting'].round($seedBonusResult['seed_bonus'],3).$lang_mybonus['text_point'].add_s($seedBonusResult['seed_bonus']).$lang_mybonus['text_per_hour']." (A = ".round($A,1).")</div><table align=\"center\" border=\"0\" width=\"400\"><tr><td class=\"loadbarbg\" style='border: none; padding: 0px;'>");
|
||||
|
||||
$factor = get_setting('bonus.harem_addition');
|
||||
$addition = calculate_harem_addition($CURUSER['id']);
|
||||
$totalBonus = number_format($all_bonus + $addition * $factor, 3);
|
||||
$summaryTable = '<table cellspacing="4" cellpadding="4" style="width: 50%"><tbody>';
|
||||
$summaryTable .= '<tr style="font-weight: bold"><td>'.$lang_mybonus['reward_type'].'</td><td>'.$lang_mybonus['bonus_base'].'</td><td>'.$lang_mybonus['addition'].'</td><td>'.$lang_mybonus['got_bonus'].'</td><td>'.$lang_mybonus['total'].'</td></tr>';
|
||||
$summaryTable .= sprintf(
|
||||
'<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td rowspan="2">%s</td></tr>',
|
||||
$lang_mybonus['reward_type_basic'],
|
||||
round($all_bonus,3),
|
||||
'-',
|
||||
round($all_bonus,3),
|
||||
$totalBonus
|
||||
);
|
||||
if ($factor > 0) {
|
||||
$summaryTable .= sprintf(
|
||||
'<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
|
||||
$lang_mybonus['reward_type_harem_addition'],
|
||||
number_format($addition, 3),
|
||||
number_format($factor * 100, 2) . '%',
|
||||
number_format($addition * $factor, 3)
|
||||
);
|
||||
if ($percent <= 30) $loadpic = "loadbarred";
|
||||
elseif ($percent <= 60) $loadpic = "loadbaryellow";
|
||||
else $loadpic = "loadbargreen";
|
||||
$width = $percent * 4;
|
||||
print("<img class=\"".$loadpic."\" src=\"pic/trans.gif\" style=\"width: ".$width."px;\" alt=\"".$percent."%\" /></td></tr></table>");
|
||||
|
||||
if ($bonusTableResult['has_official_addition']) {
|
||||
print("<h1>".$lang_mybonus['text_get_by_seeding_official']."</h1>");
|
||||
print("<ul>");
|
||||
print("<li>".$lang_mybonus['official_calculate_method']."</li>");
|
||||
print("<li>".$lang_mybonus['official_tag_bonus_additional_factor'].$bonusTableResult['official_addition_factor']."</li>");
|
||||
print("</ul>");
|
||||
}
|
||||
|
||||
$summaryTable .= '</tbody></table>';
|
||||
if ($bonusTableResult['has_harem_addition']) {
|
||||
print("<h1>".$lang_mybonus['text_get_by_harem']."</h1>");
|
||||
print("<ul>");
|
||||
print("<li>".sprintf($lang_mybonus['harem_additional_desc'], $CURUSER['id'])."</li>");
|
||||
print("<li>".$lang_mybonus['harem_additional_factor'].$bonusTableResult['harem_addition_factor']."</li>");
|
||||
print("</ul>");
|
||||
}
|
||||
|
||||
print '<div style="display: flex;justify-content: center;margin-top: 20px;">'.$summaryTable.'</div>';
|
||||
print("<h1>".$lang_mybonus['text_bonus_summary']."</h1>");
|
||||
print '<div style="display: flex;justify-content: center;margin-top: 20px;">'.$bonusTableResult['table'].'</div>';
|
||||
|
||||
print("<h1>".$lang_mybonus['text_other_things_get_bonus']."</h1>");
|
||||
print("<ul>");
|
||||
@@ -534,10 +533,16 @@ if ($action == "exchange") {
|
||||
$up = $upload + $bonusarray['menge'];
|
||||
// $bonuscomment = date("Y-m-d") . " - " .$points. " Points for upload bonus.\n " .$bonuscomment;
|
||||
// sql_query("UPDATE users SET uploaded = ".sqlesc($up).", seedbonus = seedbonus - $points, bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
|
||||
$bonusRep->consumeUserBonus($CURUSER['id'], $points, \App\Models\BonusLogs::BUSINESS_TYPE_EXCHANGE_UPLOAD, $points. " Points for upload bonus.", ['uploaded' => $up]);
|
||||
$bonusRep->consumeUserBonus($CURUSER['id'], $points, \App\Models\BonusLogs::BUSINESS_TYPE_EXCHANGE_UPLOAD, $points. " Points for uploaded.", ['uploaded' => $up]);
|
||||
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=upload");
|
||||
}
|
||||
}
|
||||
if($art == "traffic_downloaded") {
|
||||
$downloaded = $CURUSER['downloaded'];
|
||||
$down = $downloaded + $bonusarray['menge'];
|
||||
$bonusRep->consumeUserBonus($CURUSER['id'], $points, \App\Models\BonusLogs::BUSINESS_TYPE_EXCHANGE_DOWNLOAD, $points. " Points for downloaded.", ['downloaded' => $down]);
|
||||
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=download");
|
||||
}
|
||||
//=== trade for one month VIP status ***note "SET class = '10'" change "10" to whatever your VIP class number is
|
||||
elseif($art == "class") {
|
||||
if (get_user_class() >= UC_VIP) {
|
||||
@@ -628,10 +633,15 @@ if ($action == "exchange") {
|
||||
$usernamegift = sqlesc(trim($_POST["username"]));
|
||||
$res = sql_query("SELECT id, bonuscomment FROM users WHERE username=" . $usernamegift);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if (empty($arr)) {
|
||||
stdmsg($lang_mybonus['text_error'], $lang_mybonus['text_receiver_not_exists'], 0);
|
||||
stdfoot();
|
||||
die;
|
||||
}
|
||||
$useridgift = $arr['id'];
|
||||
$userseedbonus = $arr['seedbonus'];
|
||||
$receiverbonuscomment = $arr['bonuscomment'];
|
||||
if ($points < 25 || $points > 10000) {
|
||||
if (!is_numeric($points) || $points < $bonusarray['points']) {
|
||||
//write_log("User " . $CURUSER["username"] . "," . $CURUSER["ip"] . " is hacking bonus system",'mod');
|
||||
stdmsg($lang_mybonus['text_error'], $lang_mybonus['bonus_amount_not_allowed']);
|
||||
stdfoot();
|
||||
@@ -654,11 +664,6 @@ if ($action == "exchange") {
|
||||
stdfoot();
|
||||
die;
|
||||
}
|
||||
if (!$useridgift){
|
||||
stdmsg($lang_mybonus['text_error'], $lang_mybonus['text_receiver_not_exists'], 0);
|
||||
stdfoot();
|
||||
die;
|
||||
}
|
||||
|
||||
// sql_query("UPDATE users SET seedbonus = seedbonus - $points, bonuscomment = ".sqlesc($bonuscomment)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
|
||||
$bonusRep->consumeUserBonus($CURUSER['id'], $points, \App\Models\BonusLogs::BUSINESS_TYPE_GIFT_TO_SOMEONE, $points2 . " Points as gift to ".htmlspecialchars(trim($_POST["username"])));
|
||||
|
||||
+8
-6
@@ -67,7 +67,8 @@ if ($rescount) {
|
||||
|
||||
$query = (clone $baseQuery)
|
||||
->with([
|
||||
'torrent' => function ($query) {$query->select(['id', 'size', 'name']);},
|
||||
'torrent' => function ($query) {$query->select(['id', 'size', 'name', 'category']);},
|
||||
'torrent.basic_category',
|
||||
'snatch',
|
||||
'user' => function ($query) {$query->select(['id', 'lang']);},
|
||||
'user.language',
|
||||
@@ -81,20 +82,21 @@ if ($rescount) {
|
||||
$list = $query->get();
|
||||
$hasActionRemove = false;
|
||||
foreach($list as $row) {
|
||||
$columnAction = '';
|
||||
if ($row->uid == $CURUSER['id'] && $row->status == \App\Models\HitAndRun::STATUS_INSPECTING) {
|
||||
$columnAction = '<td class="rowfollow nowrap" align="center">';
|
||||
if ($row->uid == $CURUSER['id'] && in_array($row->status, \App\Models\HitAndRun::CAN_PARDON_STATUS)) {
|
||||
$hasActionRemove = true;
|
||||
$columnAction = sprintf('<td class="rowfollow nowrap" align="center"><input class="remove-hr" type="button" value="%s" data-id="%s"></td>', $lang_myhr['action_remove'], $row->id);
|
||||
$columnAction .= sprintf('<input class="remove-hr" type="button" value="%s" data-id="%s">', $lang_myhr['action_remove'], $row->id);
|
||||
}
|
||||
$columnAction .= '</td>';
|
||||
print("<tr>
|
||||
<td class='rowfollow nowrap' align='center'>" . $row->id . "</td>
|
||||
<td class='rowfollow' align='left'><a href='details.php?id=" . $row->torrent_id . "'>" . optional($row->torrent)->name . "</a></td>
|
||||
<td class='rowfollow nowrap' align='center'>" . mksize($row->snatch->uploaded) . "</td>
|
||||
<td class='rowfollow nowrap' align='center'>" . mksize($row->snatch->downloaded) . "</td>
|
||||
<td class='rowfollow nowrap' align='center'>" . get_hr_ratio($row->snatch->uploaded, $row->snatch->downloaded) . "</td>
|
||||
<td class='rowfollow nowrap' align='center'>" . ($row->status == \App\Models\HitAndRun::STATUS_INSPECTING ? mkprettytime(3600 * get_setting('hr.seed_time_minimum') - $row->snatch->seedtime) : '---') . "</td>
|
||||
<td class='rowfollow nowrap' align='center'>" . $row->seedTimeRequired . "</td>
|
||||
<td class='rowfollow nowrap' align='center'>" . format_datetime($row->snatch->completedat) . "</td>
|
||||
<td class='rowfollow nowrap' align='center' >" . ($row->status == \App\Models\HitAndRun::STATUS_INSPECTING ? mkprettytime(\Carbon\Carbon::now()->diffInSeconds($row->snatch->completedat->addHours(get_setting('hr.inspect_time')))) : '---') . "</td>
|
||||
<td class='rowfollow nowrap' align='center' >" . $row->inspectTimeLeft . "</td>
|
||||
<td class='rowfollow nowrap' align='left' style='padding-left: 10px'>" . nl2br(trim($row->comment)) . "</td>
|
||||
{$columnAction}
|
||||
</tr>");
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
require_once("../include/bittorrent.php");
|
||||
dbconn(true);
|
||||
require_once(get_langfile_path('torrents.php'));
|
||||
loggedinorreturn();
|
||||
parked();
|
||||
|
||||
$search = $_REQUEST['search'] ?? '';
|
||||
$searchArea = $_REQUEST['search_area'] ?? \App\Repositories\SearchRepository::SEARCH_AREA_TITLE;
|
||||
|
||||
//approval status
|
||||
$approvalStatusNoneVisible = get_setting('torrent.approval_status_none_visible');
|
||||
$approvalStatus = null;
|
||||
if ($approvalStatusNoneVisible == 'no' && !user_can('torrent-approval')) {
|
||||
$approvalStatus = \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
$rows = [];
|
||||
if ($search) {
|
||||
$search = str_replace(".", " ", $search);
|
||||
$searchArr = preg_split("/[\s]+/", $search, 10,PREG_SPLIT_NO_EMPTY);
|
||||
$tableTorrent = "torrents";
|
||||
$tableUser = "users";
|
||||
$tableCategory = "categories";
|
||||
$torrentQuery = \Nexus\Database\NexusDB::table($tableTorrent)->join($tableCategory, "$tableTorrent.category", "=", "$tableCategory.id");
|
||||
if (get_setting('main.spsct') == 'yes' && !user_can('view_special_torrent')) {
|
||||
$torrentQuery->where("$tableCategory.mode", get_setting('main.browsecat'));
|
||||
}
|
||||
if ($searchArea == \App\Repositories\SearchRepository::SEARCH_AREA_TITLE) {
|
||||
foreach ($searchArr as $queryString) {
|
||||
$q = "%{$queryString}%";
|
||||
$torrentQuery->where(function (\Illuminate\Database\Query\Builder $query) use ($q, $tableTorrent) {
|
||||
return $query->where("$tableTorrent.name", 'like', $q)->orWhere("$tableTorrent.small_descr", "like", $q);
|
||||
});
|
||||
}
|
||||
} elseif ($searchArea == \App\Repositories\SearchRepository::SEARCH_AREA_DESC) {
|
||||
foreach ($searchArr as $queryString) {
|
||||
$q = "%{$queryString}%";
|
||||
$torrentQuery->where("$tableTorrent.descr", "like", $q);
|
||||
}
|
||||
} elseif ($searchArea == \App\Repositories\SearchRepository::SEARCH_AREA_OWNER) {
|
||||
$torrentQuery->join($tableUser, "$tableTorrent.owner", "=", "$tableUser.id");
|
||||
foreach ($searchArr as $queryString) {
|
||||
$q = "%{$queryString}%";
|
||||
$torrentQuery->where("$tableUser.username", "like", $q);
|
||||
}
|
||||
} elseif ($searchArea == \App\Repositories\SearchRepository::SEARCH_AREA_IMDB) {
|
||||
foreach ($searchArr as $queryString) {
|
||||
$q = "%{$queryString}%";
|
||||
$torrentQuery->where("$tableTorrent.url", "like", $q);
|
||||
}
|
||||
} else {
|
||||
foreach ($searchArr as $queryString) {
|
||||
$q = "%{$queryString}%";
|
||||
$torrentQuery->where("$tableTorrent.name", "like", $q);
|
||||
}
|
||||
write_log("User " . $CURUSER["username"] . "," . $CURUSER["ip"] . " is hacking search_area field in" . $_SERVER['SCRIPT_NAME'], 'mod');
|
||||
}
|
||||
if ($approvalStatus !== null) {
|
||||
$torrentQuery->where("$tableTorrent.approval_status", $approvalStatus);
|
||||
}
|
||||
$torrentQuery->where("$tableTorrent.visible", 'yes');
|
||||
|
||||
$count = $torrentQuery->count();
|
||||
}
|
||||
|
||||
if ($CURUSER["torrentsperpage"])
|
||||
$torrentsperpage = (int)$CURUSER["torrentsperpage"];
|
||||
elseif ($torrentsperpage_main)
|
||||
$torrentsperpage = $torrentsperpage_main;
|
||||
else $torrentsperpage = 50;
|
||||
|
||||
// sorting by MarkoStamcar
|
||||
$column = 'id';
|
||||
$ascdesc = 'desc';
|
||||
$addparam = "?search=$search&search_area=$searchArea&";
|
||||
if (isset($_GET['sort']) && $_GET['sort'] && isset($_GET['type']) && $_GET['type']) {
|
||||
|
||||
switch($_GET['sort']) {
|
||||
case '1': $column = "name"; break;
|
||||
case '2': $column = "numfiles"; break;
|
||||
case '3': $column = "comments"; break;
|
||||
case '4': $column = "added"; break;
|
||||
case '5': $column = "size"; break;
|
||||
case '6': $column = "times_completed"; break;
|
||||
case '7': $column = "seeders"; break;
|
||||
case '8': $column = "leechers"; break;
|
||||
case '9': $column = "owner"; break;
|
||||
default: $column = "id"; break;
|
||||
}
|
||||
|
||||
switch($_GET['type']) {
|
||||
case 'asc': $ascdesc = "ASC"; $linkascdesc = "asc"; break;
|
||||
case 'desc': $ascdesc = "DESC"; $linkascdesc = "desc"; break;
|
||||
default: $ascdesc = "DESC"; $linkascdesc = "desc"; break;
|
||||
}
|
||||
|
||||
$addparam .= "sort=" . intval($_GET['sort']) . "&type=" . $linkascdesc . "&";
|
||||
|
||||
}
|
||||
|
||||
list($pagertop, $pagerbottom, $limit, $offset, $size, $page) = pager($torrentsperpage, $count, $addparam);
|
||||
|
||||
stdhead(nexus_trans('search.global_search'));
|
||||
print("<table width=\"97%\" class=\"main\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td class=\"embedded\">");
|
||||
if ($search && $count > 0) {
|
||||
$fieldsStr = implode(', ', \App\Models\Torrent::getFieldsForList(true));
|
||||
$rows = $torrentQuery->selectRaw("$fieldsStr, categories.mode as search_box_id")
|
||||
->forPage($page + 1, $torrentsperpage)
|
||||
->orderBy("$tableTorrent.$column", $ascdesc)
|
||||
->get()
|
||||
->toArray();
|
||||
print($pagertop);
|
||||
torrenttable(json_decode(json_encode($rows), true));
|
||||
print($pagerbottom);
|
||||
} else {
|
||||
stdmsg($lang_torrents['std_search_results_for'] . $search . "\"",$lang_torrents['std_try_again']);
|
||||
}
|
||||
print("</td></tr></table>");
|
||||
stdfoot();
|
||||
|
||||
|
||||
|
||||
+52
-8
@@ -41,7 +41,8 @@ if ($action == 'savesettings_main') // save main
|
||||
'showpolls','showstats','showlastxtorrents', 'showtrackerload','showshoutbox','showfunbox','showoffer','sptime','showhelpbox','enablebitbucket',
|
||||
'smalldescription','altname','extforum','extforumurl','defaultlang','defstylesheet', 'donation','spsct','browsecat','specialcat','waitsystem',
|
||||
'maxdlsystem','bitbucket','torrentnameprefix', 'showforumstats','verification','invite_count','invite_timeout', 'seeding_leeching_time_calc_start',
|
||||
'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', 'imdb_language', 'offer_skip_approved_count'
|
||||
'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', 'imdb_language', 'offer_skip_approved_count',
|
||||
'upload_deny_approval_deny_count'
|
||||
);
|
||||
GetVar($validConfig);
|
||||
$MAIN = [];
|
||||
@@ -97,7 +98,7 @@ elseif ($action == 'savesettings_bonus') // save bonus
|
||||
'addcomment','pollvote','offervote', 'funboxvote','saythanks','receivethanks','funboxreward','onegbupload','fivegbupload',
|
||||
'tengbupload', 'ratiolimit','dlamountlimit','oneinvite','customtitle','vipstatus','bonusgift', 'basictax', 'taxpercentage',
|
||||
'prolinkpoint', 'prolinktime', 'attendance_initial', 'attendance_step', 'attendance_max', 'cancel_hr', 'attendance_card',
|
||||
'harem_addition'
|
||||
'harem_addition', 'hundredgbupload', 'tengbdownload', 'hundredgbdownload', 'official_addition', 'official_tag', 'zero_bonus_tag', 'zero_bonus_factor',
|
||||
);
|
||||
GetVar($validConfig);
|
||||
$BONUS = [];
|
||||
@@ -133,7 +134,7 @@ elseif ($action == 'savesettings_account') // save account
|
||||
'exutime', 'exudl', \App\Models\User::CLASS_EXTREME_USER . '_min_seed_points', 'exuprratio', 'exuderatio', \App\Models\User::CLASS_EXTREME_USER . '_alias',
|
||||
'uutime', 'uudl', \App\Models\User::CLASS_ULTIMATE_USER . '_min_seed_points', 'uuprratio', 'uuderatio', \App\Models\User::CLASS_ULTIMATE_USER . '_alias',
|
||||
'nmtime', 'nmdl', \App\Models\User::CLASS_NEXUS_MASTER . '_min_seed_points', 'nmprratio', 'nmderatio', \App\Models\User::CLASS_NEXUS_MASTER . '_alias',
|
||||
'getInvitesByPromotion'
|
||||
'getInvitesByPromotion', 'destroy_disabled'
|
||||
);
|
||||
GetVar($validConfig);
|
||||
$ACCOUNT = [];
|
||||
@@ -155,7 +156,8 @@ elseif($action == 'savesettings_torrent') // save account
|
||||
'twoupbecome','twoupfreebecome', 'twouphalfleechbecome','normalbecome','uploaderdouble','deldeadtorrent', 'randomthirtypercentdown',
|
||||
'thirtypercentleechbecome', 'expirethirtypercentleech', 'sticky_first_level_background_color', 'sticky_second_level_background_color',
|
||||
'download_support_passkey', 'claim_enabled', 'claim_torrent_ttl', 'claim_torrent_user_counts_up_limit', 'claim_user_torrent_counts_up_limit', 'claim_remove_deduct_user_bonus',
|
||||
'claim_give_up_deduct_user_bonus', 'claim_bonus_multiplier', 'claim_reach_standard_seed_time', 'claim_reach_standard_uploaded', 'approval_status_icon_enabled', 'approval_status_none_visible'
|
||||
'claim_give_up_deduct_user_bonus', 'claim_bonus_multiplier', 'claim_reach_standard_seed_time', 'claim_reach_standard_uploaded', 'approval_status_icon_enabled', 'approval_status_none_visible',
|
||||
'nfo_view_style_default',
|
||||
);
|
||||
$validConfig = apply_filter('setting_valid_config', $validConfig);
|
||||
GetVar($validConfig);
|
||||
@@ -222,7 +224,7 @@ elseif ($action == 'savesettings_authority') // save user authority
|
||||
'torrentstructure','sendinvite','viewhistory','topten','log','confilog','userprofile', 'torrenthistory','prfmanage', 'cruprfmanage',
|
||||
'uploadsub','delownsub','submanage','updateextinfo', 'viewanonymous','beanonymous','addoffer','offermanage', 'upload','uploadspecial',
|
||||
'view_special_torrent','movetorrent','chrmanage','viewinvite', 'buyinvite','seebanned','againstoffer','userbar', 'torrent-approval',
|
||||
'torrent-delete', 'user-delete', 'user-change-class',
|
||||
'torrent-delete', 'user-delete', 'user-change-class', 'torrent-set-special-tag', 'torrent-approval-allow-automatic'
|
||||
);
|
||||
GetVar($validConfig);
|
||||
$AUTHORITY = [];
|
||||
@@ -450,7 +452,10 @@ elseif ($action == 'authoritysettings') //Authority settings
|
||||
tr($lang_settings['row_torrent_sticky'], $lang_settings['text_minimum_class'].classlist('torrentsticky',$maxclass,$AUTHORITY['torrentsticky'],0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_sticky_note'],1);
|
||||
tr($lang_settings['row_torrent_on_promotion'], $lang_settings['text_minimum_class'].classlist('torrentonpromotion',$maxclass,$AUTHORITY['torrentonpromotion'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_promotion_note'],1);
|
||||
tr($lang_settings['row_torrent_hr'], $lang_settings['text_minimum_class'].classlist('torrent_hr',$maxclass,$AUTHORITY['torrent_hr'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_hr_note'],1);
|
||||
tr(nexus_trans('permission.torrent-set-special-tag.text'), $lang_settings['text_minimum_class'].classlist('torrent-set-special-tag',$maxclass,$AUTHORITY['torrent-set-special-tag'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).nexus_trans('permission.torrent-set-special-tag.desc'),1);
|
||||
tr(nexus_trans('permission.torrent-approval.text'), $lang_settings['text_minimum_class'].classlist('torrent-approval',$maxclass,$AUTHORITY['torrent-approval'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).nexus_trans('permission.torrent-approval.desc'),1);
|
||||
tr(nexus_trans('permission.torrent-approval-allow-automatic.text'), $lang_settings['text_minimum_class'].classlist('torrent-approval-allow-automatic',$maxclass,$AUTHORITY['torrent-approval-allow-automatic'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).nexus_trans('permission.torrent-approval-allow-automatic.desc'),1);
|
||||
|
||||
tr($lang_settings['row_ask_for_reseed'], $lang_settings['text_minimum_class'].classlist('askreseed',$maxclass,$AUTHORITY['askreseed'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_ask_for_reseed_note'],1);
|
||||
tr($lang_settings['row_view_nfo'], $lang_settings['text_minimum_class'].classlist('viewnfo',$maxclass,$AUTHORITY['viewnfo'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_view_nfo_note'],1);
|
||||
tr($lang_settings['row_view_torrent_structure'], $lang_settings['text_minimum_class'].classlist('torrentstructure',$maxclass,$AUTHORITY['torrentstructure'],0,true).$lang_settings['text_default'].get_user_class_name(UC_ULTIMATE_USER,false,true,true).$lang_settings['text_view_torrent_structure_note'],1);
|
||||
@@ -481,8 +486,12 @@ elseif ($action == 'authoritysettings') //Authority settings
|
||||
tr($lang_settings['row_see_banned_torrents'], $lang_settings['text_minimum_class'].classlist('seebanned',$maxclass,$AUTHORITY['seebanned'],0,true).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).$lang_settings['text_see_banned_torrents_note'],1);
|
||||
tr($lang_settings['row_vote_against_offers'], $lang_settings['text_minimum_class'].classlist('againstoffer',$maxclass,$AUTHORITY['againstoffer'],0,true).$lang_settings['text_default'].get_user_class_name(UC_USER,false,true,true).$lang_settings['text_vote_against_offers_note'],1);
|
||||
tr($lang_settings['row_allow_userbar'], $lang_settings['text_minimum_class'].classlist('userbar',$maxclass,$AUTHORITY['userbar'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_allow_userbar_note'],1);
|
||||
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
|
||||
print ("</form>");
|
||||
|
||||
// tr(nexus_trans('permission.not-counting-downloaded.text'), $lang_settings['text_minimum_class'].classlist('not-counting-downloaded',$maxclass,$AUTHORITY['not-counting-downloaded'] ?? '',0,true).nexus_trans('permission.not-counting-downloaded.desc'),1);
|
||||
// tr(nexus_trans('permission.not-counting-hit-and-run.text'), $lang_settings['text_minimum_class'].classlist('not-counting-hit-and-run',$maxclass,$AUTHORITY['not-counting-hit-and-run'] ?? '',0,true).nexus_trans('permission.not-counting-hit-and-run.desc'),1);
|
||||
|
||||
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
|
||||
print ("</form>");
|
||||
}
|
||||
elseif ($action == 'basicsettings') // basic settings
|
||||
{
|
||||
@@ -562,7 +571,18 @@ elseif ($action == 'bonussettings'){
|
||||
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_bonus_by_seeding']."</b></td></tr>");
|
||||
tr($lang_settings['row_donor_gets_double'], $lang_settings['text_donor_gets']."<input type='text' style=\"width: 50px\" name=donortimes value='".(isset($BONUS["donortimes"]) ? $BONUS["donortimes"] : 2 )."'>".$lang_settings['text_times_as_many'],1);
|
||||
tr($lang_settings['row_basic_seeding_bonus'], $lang_settings['text_user_would_get']."<input type='text' style=\"width: 50px\" name=perseeding value='".(isset($BONUS["perseeding"]) ? $BONUS["perseeding"] : 1 )."'>".$lang_settings['text_bonus_points']."<input type='text' style=\"width: 50px\" name=maxseeding value='".(isset($BONUS["maxseeding"]) ? $BONUS["maxseeding"] : 7 )."'>".$lang_settings['text_torrents_default'], 1);
|
||||
tr($lang_settings['row_seeding_formula'], $lang_settings['text_bonus_formula_one']."<br /> <img src=pic/bonusformulaa.png alt=\"A = sigma( ( 1 - 10 ^ ( - Ti / T0 ) ) * Si * ( 1 + sqrt( 2 ) * 10 ^ ( - ( Ni - 1 ) / ( N0 - 1 ) ) )\" title=\"A = sigma( ( 1 - 10 ^ ( - Ti / T0 ) ) * Si * ( 1 + sqrt( 2 ) * 10 ^ ( - ( Ni - 1 ) / ( N0 - 1 ) ) )\"><br /> <img src=pic/bonusformulab.png alt=\"B = B0 * 2 / pi * arctan( A / L )\" title=\"B = B0 * 2 / pi * arctan( A / L )\"><br />".$lang_settings['text_where']."<ul><li>".$lang_settings['text_bonus_formula_two']."</li><li>".$lang_settings['text_bonus_formula_three']."<input type='text' style=\"width: 50px\" name=tzero value='".(isset($BONUS["tzero"]) ? $BONUS["tzero"] : 4 )."'>".$lang_settings['text_bonus_formula_four']."</li><li>".$lang_settings['text_bonus_formula_five']."</li><li>".$lang_settings['text_bonus_formula_six']."<input type='text' style=\"width: 50px\" name=nzero value='".(isset($BONUS["nzero"]) ? $BONUS["nzero"] : 7 )."'>".$lang_settings['text_bonus_formula_seven']."</li><li>".$lang_settings['text_bonus_formula_eight']."</li><li>".$lang_settings['text_bonus_formula_nine']."<input type='text' style=\"width: 50px\" name=bzero value='".(isset($BONUS["bzero"]) ? $BONUS["bzero"] : 100 )."'>".$lang_settings['text_bonus_formula_ten']."</li><li>".$lang_settings['text_bonus_formula_eleven']."<input type='text' style=\"width: 50px\" name=l value='".(isset($BONUS["l"]) ? $BONUS["l"] : 300 )."'>".$lang_settings['text_bonus_formula_twelve']."</li></ul>\n", 1);
|
||||
|
||||
$formulaLiArr = [];
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_two']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_three']."<input type='text' style=\"width: 50px\" name=tzero value='".(isset($BONUS["tzero"]) ? $BONUS["tzero"] : 4 )."'>".$lang_settings['text_bonus_formula_four']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_five']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_six']."<input type='text' style=\"width: 50px\" name=nzero value='".(isset($BONUS["nzero"]) ? $BONUS["nzero"] : 7 )."'>".$lang_settings['text_bonus_formula_seven']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_zero_bonus_factor']."<input type='text' style=\"width: 50px\" name=zero_bonus_factor value='".(isset($BONUS["zero_bonus_factor"]) ? $BONUS["zero_bonus_factor"] : 0.2 )."'>".$lang_settings['zero_bonus_factor_default']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_eight']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_nine']."<input type='text' style=\"width: 50px\" name=bzero value='".(isset($BONUS["bzero"]) ? $BONUS["bzero"] : 100 )."'>".$lang_settings['text_bonus_formula_ten']."</li>";
|
||||
$formulaLiArr[] = "<li>".$lang_settings['text_bonus_formula_eleven']."<input type='text' style=\"width: 50px\" name=l value='".(isset($BONUS["l"]) ? $BONUS["l"] : 300 )."'>".$lang_settings['text_bonus_formula_twelve']."</li>";
|
||||
tr($lang_settings['row_seeding_formula'], $lang_settings['text_bonus_formula_one']."<br /><br /> <img src=pic/bonusformulaa.svg title=\"A = sigma( ( 1 - 10 ^ ( - Ti / T0 ) ) * Si * ( 1 + sqrt( 2 ) * 10 ^ ( - ( Ni - 1 ) / ( N0 - 1 ) ) ) * Wi\"><br /> <img src=pic/bonusformulab.png alt=\"B = B0 * 2 / pi * arctan( A / L )\" title=\"B = B0 * 2 / pi * arctan( A / L )\"><br />".$lang_settings['text_where']."<ul>".implode("", $formulaLiArr)."</ul>", 1);
|
||||
|
||||
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_misc_ways_get_bonus']."</b></td></tr>");
|
||||
tr($lang_settings['row_uploading_torrent'],$lang_settings['text_user_would_get']."<input type='text' style=\"width: 50px\" name=uploadtorrent value='".(isset($BONUS["uploadtorrent"]) ? $BONUS["uploadtorrent"] : 15 )."'>".$lang_settings['text_uploading_torrent_note'], 1);
|
||||
tr($lang_settings['row_uploading_subtitle'],$lang_settings['text_user_would_get']."<input type='text' style=\"width: 50px\" name=uploadsubtitle value='".(isset($BONUS["uploadsubtitle"]) ? $BONUS["uploadsubtitle"] : 5 )."'>".$lang_settings['text_uploading_subtitle_note'], 1);
|
||||
@@ -576,12 +596,21 @@ elseif ($action == 'bonussettings'){
|
||||
tr($lang_settings['row_funbox_stuff_reward'],$lang_settings['text_user_would_get']."<input type='text' style=\"width: 50px\" name=funboxreward value='".(isset($BONUS["funboxreward"]) ? $BONUS["funboxreward"] : 5 )."'>".$lang_settings['text_funbox_stuff_reward_note'], 1);
|
||||
tr($lang_settings['row_promotion_link_click'],$lang_settings['text_user_would_get']."<input type='text' style=\"width: 50px\" name=prolinkpoint value='".(isset($BONUS["prolinkpoint"]) ? $BONUS["prolinkpoint"] : 0 )."'>".$lang_settings['text_promotion_link_note_one']."<input type='text' style=\"width: 50px\" name=prolinktime value='".(isset($BONUS["prolinktime"]) ? $BONUS["prolinktime"] : 600 )."'>".$lang_settings['text_promotion_link_note_two'], 1);
|
||||
tr($lang_settings['row_harem_addition'],$lang_settings['text_user_would_get_by_harem']."<input type='text' style=\"width: 50px\" name=harem_addition value='".(isset($BONUS["harem_addition"]) ? $BONUS["harem_addition"] : 0 )."'>".$lang_settings['text_harem_addition_note'], 1);
|
||||
tr($lang_settings['row_official_addition'],$lang_settings['text_user_would_get_by_official']."<input type='text' style=\"width: 50px\" name=official_addition value='".(isset($BONUS["official_addition"]) ? $BONUS["official_addition"] : 0.5 )."'>".$lang_settings['text_addition_addition_note'], 1);
|
||||
|
||||
$tagRep = new \App\Repositories\TagRepository();
|
||||
tr($lang_settings['row_official_tag'], $tagRep->buildSelect('official_tag', $BONUS["official_tag"] ?? '') . $lang_settings['text_official_tag_note'], 1);
|
||||
tr($lang_settings['row_zero_bonus_tag'], $tagRep->buildSelect('zero_bonus_tag', $BONUS["zero_bonus_tag"] ?? '') . $lang_settings['text_zero_bonus_tag_note'], 1);
|
||||
|
||||
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_things_cost_bonus']."</b></td></tr>");
|
||||
tr($lang_settings['row_one_gb_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=onegbupload value='".(isset($BONUS["onegbupload"]) ? $BONUS["onegbupload"] : 300 )."'>".$lang_settings['text_one_gb_credit_note'], 1);
|
||||
tr($lang_settings['row_five_gb_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=fivegbupload value='".(isset($BONUS["fivegbupload"]) ? $BONUS["fivegbupload"] : 800 )."'>".$lang_settings['text_five_gb_credit_note'], 1);
|
||||
tr($lang_settings['row_ten_gb_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=tengbupload value='".(isset($BONUS["tengbupload"]) ? $BONUS["tengbupload"] : 1200 )."'>".$lang_settings['text_ten_gb_credit_note'], 1);
|
||||
tr($lang_settings['row_hundred_gb_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=hundredgbupload value='".(isset($BONUS["hundredgbupload"]) ? $BONUS["hundredgbupload"] : 10000 )."'>".$lang_settings['text_hundred_gb_credit_note'], 1);
|
||||
tr($lang_settings['row_ten_gb_download_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=tengbdownload value='".(isset($BONUS["tengbdownload"]) ? $BONUS["tengbdownload"] : 1000 )."'>".$lang_settings['text_ten_gb_download_credit_note'], 1);
|
||||
tr($lang_settings['row_hundred_gb_download_credit'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=hundredgbdownload value='".(isset($BONUS["hundredgbdownload"]) ? $BONUS["hundredgbdownload"] : 8000 )."'>".$lang_settings['text_hundred_gb_download_credit_note'], 1);
|
||||
|
||||
|
||||
tr($lang_settings['row_ratio_limit'],$lang_settings['text_user_with_ratio']."<input type='text' style=\"width: 50px\" name=ratiolimit value='".(isset($BONUS["ratiolimit"]) ? $BONUS["ratiolimit"] : 6 )."'>".$lang_settings['text_uploaded_amount_above']."<input type='text' style=\"width: 50px\" name=dlamountlimit value='".(isset($BONUS["dlamountlimit"]) ? $BONUS["dlamountlimit"] : 50 )."'>".$lang_settings['text_ratio_limit_default'], 1);
|
||||
tr($lang_settings['row_buy_an_invite'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=oneinvite value='".(isset($BONUS["oneinvite"]) ? $BONUS["oneinvite"] : 1000 )."'>".$lang_settings['text_buy_an_invite_note'], 1);
|
||||
tr($lang_settings['row_custom_title'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=customtitle value='".(isset($BONUS["customtitle"]) ? $BONUS["customtitle"] : 5000 )."'>".$lang_settings['text_custom_title_note'], 1);
|
||||
@@ -626,6 +655,9 @@ elseif ($action == 'accountsettings'){
|
||||
tr($lang_settings['row_delete_packed'],$lang_settings['text_delete_packed_note_one']."<input type='text' style=\"width: 50px\" name=deletepacked value='".(isset($ACCOUNT["deletepacked"]) ? $ACCOUNT["deletepacked"] : 400 )."'>".$lang_settings['text_delete_packed_note_two'], 1);
|
||||
tr($lang_settings['row_delete_unpacked'],$lang_settings['text_delete_unpacked_note_one']."<input type='text' style=\"width: 50px\" name=deleteunpacked value='".(isset($ACCOUNT["deleteunpacked"]) ? $ACCOUNT["deleteunpacked"] : 150 )."'>".$lang_settings['text_delete_unpacked_note_two'], 1);
|
||||
tr($lang_settings['row_delete_no_transfer'],$lang_settings['text_delete_transfer_note_one']."<input type='text' style=\"width: 50px\" name=deletenotransfer value='".(isset($ACCOUNT["deletenotransfer"]) ? $ACCOUNT["deletenotransfer"] : 60 )."'>".$lang_settings['text_delete_transfer_note_two']."<input type='text' style=\"width: 50px\" name=deletenotransfertwo value='".(isset($ACCOUNT["deletenotransfertwo"]) ? $ACCOUNT["deletenotransfertwo"] : 0 )."'>".$lang_settings['text_delete_transfer_note_three'], 1);
|
||||
tr($lang_settings['row_destroy_disabled'],$lang_settings['text_destroy_disabled_note_one']."<input type='text' style=\"width: 50px\" name=destroy_disabled value='".(isset($ACCOUNT["destroy_disabled"]) ? $ACCOUNT["destroy_disabled"] : 500 )."'>".$lang_settings['text_destroy_disabled_note_two'], 1);
|
||||
|
||||
|
||||
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_user_promotion_demotion']."</b></td></tr>");
|
||||
tr($lang_settings['row_ban_peasant_one'].get_user_class_name(UC_PEASANT,false,false,true).$lang_settings['row_ban_peasant_two'],get_user_class_name(UC_PEASANT,false,true,true).$lang_settings['text_ban_peasant_note_one']."<input type='text' style=\"width: 50px\" name=deletepeasant value='".(isset($ACCOUNT["deletepeasant"]) ? $ACCOUNT["deletepeasant"] : 30 )."'>".$lang_settings['text_ban_peasant_note_two'], 1);
|
||||
$inputAlias = "0_alias";
|
||||
@@ -689,6 +721,17 @@ elseif ($action == 'torrentsettings')
|
||||
yesorno($lang_settings['row_download_support_passkey'], 'download_support_passkey', $TORRENT["download_support_passkey"], $lang_settings['text_download_support_passkey_note']);
|
||||
yesorno($lang_settings['row_approval_status_icon_enabled'], 'approval_status_icon_enabled', $TORRENT["approval_status_icon_enabled"], $lang_settings['text_approval_status_icon_enabled_note']);
|
||||
yesorno($lang_settings['row_approval_status_none_visible'], 'approval_status_none_visible', $TORRENT["approval_status_none_visible"], $lang_settings['text_approval_status_none_visible_note']);
|
||||
|
||||
$nfoViewStyleRadio = '';
|
||||
$name = 'nfo_view_style_default';
|
||||
foreach (\App\Models\Torrent::$nfoViewStyles as $style => $info) {
|
||||
$nfoViewStyleRadio .= sprintf(
|
||||
'<label><input type="radio" name="%s" value="%s"%s>%s</label>',
|
||||
$name, $style, $TORRENT[$name] == $style ? ' checked' : '', $info['text']
|
||||
);
|
||||
}
|
||||
tr($lang_settings['row_' . $name], $nfoViewStyleRadio, 1);
|
||||
|
||||
yesorno($lang_settings['row_promotion_rules'], 'prorules', $TORRENT["prorules"], $lang_settings['text_promotion_rules_note']);
|
||||
tr($lang_settings['row_random_promotion'], $lang_settings['text_random_promotion_note_one']."<ul><li><input type='text' style=\"width: 50px\" name=randomhalfleech value='".(isset($TORRENT["randomhalfleech"]) ? $TORRENT["randomhalfleech"] : 5 )."'>".$lang_settings['text_halfleech_chance_becoming']."</li><li><input type='text' style=\"width: 50px\" name=randomfree value='".(isset($TORRENT["randomfree"]) ? $TORRENT["randomfree"] : 2 )."'>".$lang_settings['text_free_chance_becoming']."</li><li><input type='text' style=\"width: 50px\" name=randomtwoup value='".(isset($TORRENT["randomtwoup"]) ? $TORRENT["randomtwoup"] : 2 )."'>".$lang_settings['text_twoup_chance_becoming']."</li><li><input type='text' style=\"width: 50px\" name=randomtwoupfree value='".(isset($TORRENT["randomtwoupfree"]) ? $TORRENT["randomtwoupfree"] : 1 )."'>".$lang_settings['text_freetwoup_chance_becoming']."</li><li><input type='text' style=\"width: 50px\" name=randomtwouphalfdown value='".(isset($TORRENT["randomtwouphalfdown"]) ? $TORRENT["randomtwouphalfdown"] : 0 )."'>".$lang_settings['text_twouphalfleech_chance_becoming']."</li><li><input type='text' style=\"width: 50px\" name=randomthirtypercentdown value='".(isset($TORRENT["randomthirtypercentdown"]) ? $TORRENT["randomthirtypercentdown"] : 0 )."'>".$lang_settings['text_thirtypercentleech_chance_becoming']."</li></ul>".$lang_settings['text_random_promotion_note_two'], 1);
|
||||
tr($lang_settings['row_large_torrent_promotion'], $lang_settings['text_torrent_larger_than']."<input type='text' style=\"width: 50px\" name=largesize value='".(isset($TORRENT["largesize"]) ? $TORRENT["largesize"] : 20 )."'>".$lang_settings['text_gb_promoted_to']."<select name=largepro>".promotion_selection((isset($TORRENT['largepro']) ? $TORRENT['largepro'] : 2), 1)."</select>".$lang_settings['text_by_system_upon_uploading']."<br />".$lang_settings['text_large_torrent_promotion_note'], 1);
|
||||
@@ -851,6 +894,7 @@ JS;
|
||||
tr($lang_settings['row_offer_vote_timeout'],"<input type='text' style=\"width: 100px\" name=offervotetimeout value='".(isset($MAIN["offervotetimeout"]) ? $MAIN["offervotetimeout"] : 259200)."'> ".$lang_settings['text_offer_vote_timeout_note'], 1);
|
||||
tr($lang_settings['row_offer_upload_timeout'],"<input type='text' style=\"width: 100px\" name=offeruptimeout value='".(isset($MAIN["offeruptimeout"]) ? $MAIN["offeruptimeout"] : 86400)."'> ".$lang_settings['text_offer_upload_timeout_note'], 1);
|
||||
tr($lang_settings['row_offer_skip_approved_count'],"<input type='text' style=\"width: 100px\" name=offer_skip_approved_count value='".($MAIN["offer_skip_approved_count"] ?? '')."'> ".$lang_settings['text_offer_skip_approved_count_note'], 1);
|
||||
tr($lang_settings['row_upload_deny_approval_deny_count'],"<input type='text' style=\"width: 100px\" name=upload_deny_approval_deny_count value='".($MAIN["upload_deny_approval_deny_count"] ?? '')."'> ".$lang_settings['text_upload_deny_approval_deny_count_note'], 1);
|
||||
|
||||
tr($lang_settings['row_max_subtitle_size'],"<input type='text' style=\"width: 100px\" name=maxsubsize value='".(isset($MAIN["maxsubsize"]) ? $MAIN["maxsubsize"] : 3145728)."'> ". $lang_settings['text_max_subtitle_size_note'], 1);
|
||||
tr($lang_settings['row_posts_per_page'],"<input type='text' style=\"width: 100px\" name=postsperpage value='".($MAIN["postsperpage"] ? $MAIN["postsperpage"] : 10)."'> ".$lang_settings['text_posts_per_page_note'], 1);
|
||||
|
||||
@@ -239,6 +239,9 @@ header("Refresh: 0; url=staffbox.php?action=viewpm&pmid=$id");
|
||||
//////////////////////////
|
||||
|
||||
if ($action == "takecontactanswered") {
|
||||
if (empty($_POST['setanswered'])) {
|
||||
stderr($lang_staffbox['std_sorry'], nexus_trans('nexus.select_one_please'));
|
||||
}
|
||||
|
||||
if ($_POST['setdealt']){
|
||||
$res = sql_query ("SELECT * FROM staffmessages WHERE answered=0 AND id IN (" . implode(", ", $_POST['setanswered']) . ")");
|
||||
|
||||
+26
-18
@@ -24,35 +24,43 @@ if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"])
|
||||
<?php
|
||||
if ($_GET["sent"] == 1) {
|
||||
?>
|
||||
<tr><td colspan=2><font color=red><b>The message has ben sent.</font></b></tr></td>
|
||||
<tr><td colspan=2><font color=red><b>The message has ben sent.</b></font></td></tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><b>Send to:</b><br />
|
||||
<table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<?php
|
||||
foreach ($classes as $chunk) {
|
||||
printf('<tr>');
|
||||
foreach ($chunk as $class => $info) {
|
||||
printf('<td style="border: 0"><label><input type="checkbox" name="clases[]" value="%s" />%s</label></td>', $class, $info['text']);
|
||||
}
|
||||
printf('</tr>');
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
<td><b>Send to class:</b></td>
|
||||
<td>
|
||||
<table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<?php
|
||||
foreach ($classes as $chunk) {
|
||||
printf('<tr>');
|
||||
foreach ($chunk as $class => $info) {
|
||||
printf('<td style="border: 0"><label><input type="checkbox" name="classes[]" value="%s" />%s</label></td>', $class, $info['text']);
|
||||
}
|
||||
printf('</tr>');
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>Subject <input type=text name=subject size=75></tr></td>
|
||||
<tr><td><textarea name=msg cols=80 rows=15><?php echo $body?></textarea></td></tr>
|
||||
<?php do_action('form_role_filter', 'Send to Role:') ?>
|
||||
<tr>
|
||||
<td colspan=1><div align="center"><b>Sender: </b>
|
||||
<td class="rowhead">Subject</td>
|
||||
<td> <input type=text name=subject size=75></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rowhead">Message</td>
|
||||
<td><textarea name=msg cols=80 rows=15><?php echo $body?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2><div align="center"><b>Sender: </b>
|
||||
<?php echo $CURUSER['username']?>
|
||||
<input name="sender" type="radio" value="self" checked>
|
||||
System
|
||||
<input name="sender" type="radio" value="system">
|
||||
</div></td></tr>
|
||||
<tr><td colspan=1 align=center><input type=submit value="Send!" class=btn></td></tr>
|
||||
<tr><td colspan=2 align=center><input type=submit value="Send!" class=btn></td></tr>
|
||||
</table>
|
||||
<input type=hidden name=receiver value=<?php echo $receiver?>>
|
||||
</form>
|
||||
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
img.hitandrun {
|
||||
width: 35px;
|
||||
height: 12px;
|
||||
background: url(icons.gif) no-repeat -100px -171px;
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
.spoiler-title {
|
||||
line-height: 28px;
|
||||
color: #4d6c99;
|
||||
cursor: pointer;
|
||||
font-weight: 700;
|
||||
background-color: rgba(77, 108, 153, 0.1);
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.spoiler-content {
|
||||
display: inline-block;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
.layui-layer {
|
||||
color: black;
|
||||
}
|
||||
.layer-form {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.layer-form .form-control-row input{
|
||||
padding: 4px;
|
||||
}
|
||||
.layer-form .form-control-row .label{
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.rainbow {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
/*font-size: 32px;*/
|
||||
/*font-family: monospace;*/
|
||||
/*letter-spacing: 5px;*/
|
||||
background: linear-gradient(to right, #6666ff, #0099ff , #00ff00, #ff3399, #6666ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
animation: rainbow_animation 6s ease-in-out infinite;
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@keyframes rainbow_animation {
|
||||
0%,100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
.nexus-media-info-raw {
|
||||
padding: 0 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
.nexus-media-info-raw .spoiler-title-box{
|
||||
text-align: center;
|
||||
}
|
||||
.nexus-media-info-raw pre {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
Vendored
-59
@@ -474,62 +474,3 @@ img.sltbar
|
||||
height:10px;
|
||||
background:url(bar.gif) repeat-x 0 -116px;
|
||||
}
|
||||
img.hitandrun {
|
||||
width: 35px;
|
||||
height: 12px;
|
||||
background: url(icons.gif) no-repeat -100px -171px;
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
.spoiler-title {
|
||||
line-height: 40px;
|
||||
color: #4d6c99;
|
||||
cursor: pointer;
|
||||
font-weight: 700;
|
||||
background-color: rgba(77, 108, 153, 0.1);
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.spoiler-content {
|
||||
display: inline-block;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
.layui-layer {
|
||||
color: black;
|
||||
}
|
||||
.layer-form {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.layer-form .form-control-row input{
|
||||
padding: 4px;
|
||||
}
|
||||
.layer-form .form-control-row .label{
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.rainbow {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
/*font-size: 32px;*/
|
||||
/*font-family: monospace;*/
|
||||
/*letter-spacing: 5px;*/
|
||||
background: linear-gradient(to right, #6666ff, #0099ff , #00ff00, #ff3399, #6666ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
animation: rainbow_animation 6s ease-in-out infinite;
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@keyframes rainbow_animation {
|
||||
0%,100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ $conditions = [];
|
||||
if (!empty($_POST['classes'])) {
|
||||
$conditions[] = "class IN (" . implode(', ', $_POST['classes']) . ")";
|
||||
}
|
||||
$conditions = apply_filter("increment_bulk_query_conditions", $conditions, $_POST);
|
||||
$conditions = apply_filter("role_query_conditions", $conditions, $_POST);
|
||||
if (empty($conditions)) {
|
||||
stderr("Error","No valid filter");
|
||||
}
|
||||
|
||||
+29
-24
@@ -53,13 +53,6 @@ if (!empty($_POST['pt_gen'])) {
|
||||
|
||||
$updateset[] = "technical_info = " . sqlesc($_POST['technical_info'] ?? '');
|
||||
$torrentOperationLog = [];
|
||||
/**
|
||||
* hr
|
||||
* @since 1.6.0-beta12
|
||||
*/
|
||||
if (isset($_POST['hr']) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr']]) && user_can('torrent_hr')) {
|
||||
$updateset[] = "hr = " . sqlesc($_POST['hr']);
|
||||
}
|
||||
|
||||
|
||||
if ($enablenfo_main=='yes'){
|
||||
@@ -143,9 +136,22 @@ if(user_can('torrentonpromotion'))
|
||||
}
|
||||
}
|
||||
}
|
||||
if(user_can('torrentsticky') && isset($_POST['sel_posstate']) && isset(\App\Models\Torrent::$posStates[$_POST['sel_posstate']]))
|
||||
if(user_can('torrentsticky'))
|
||||
{
|
||||
$updateset[] = "pos_state = '" . $_POST['sel_posstate'] . "'";
|
||||
if (isset($_POST['pos_state']) && isset(\App\Models\Torrent::$posStates[$_POST['pos_state']])) {
|
||||
$posStateUntil = $_POST['pos_state_until'] ?: null;
|
||||
$posState = $_POST['pos_state'];
|
||||
if ($posState == \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = null;
|
||||
}
|
||||
if ($posStateUntil && \Carbon\Carbon::parse($posStateUntil)->lte(now())) {
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
$posStateUntil = null;
|
||||
}
|
||||
$updateset[] = sprintf("pos_state = %s", sqlesc($posState));
|
||||
$updateset[] = sprintf("pos_state_until = %s", sqlesc($posStateUntil));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$pick_info = "";
|
||||
@@ -202,7 +208,17 @@ $descriptionArr = format_description($descr);
|
||||
$cover = get_image_from_description($descriptionArr, true, false);
|
||||
$updateset[] = "cover = " . sqlesc($cover);
|
||||
|
||||
$affectedRows = sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
|
||||
/**
|
||||
* hr
|
||||
* @since 1.6.0-beta12
|
||||
*/
|
||||
if (isset($_POST['hr'][$newcatmode]) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr'][$newcatmode]]) && user_can('torrent_hr')) {
|
||||
$updateset[] = "hr = " . sqlesc($_POST['hr'][$newcatmode]);
|
||||
}
|
||||
|
||||
$sql = "UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id";
|
||||
do_log("[UPDATE_TORRENT]: $sql");
|
||||
$affectedRows = sql_query($sql) or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
$dateTimeStringNow = date("Y-m-d H:i:s");
|
||||
|
||||
@@ -210,20 +226,9 @@ $dateTimeStringNow = date("Y-m-d H:i:s");
|
||||
* add custom fields
|
||||
* @since v1.6
|
||||
*/
|
||||
if (!empty($_POST['custom_fields'])) {
|
||||
\Nexus\Database\NexusDB::delete('torrents_custom_field_values', "torrent_id = $id");
|
||||
foreach ($_POST['custom_fields'] as $customField => $customValue) {
|
||||
foreach ((array)$customValue as $value) {
|
||||
$customData = [
|
||||
'torrent_id' => $id,
|
||||
'custom_field_id' => $customField,
|
||||
'custom_field_value' => $value,
|
||||
'created_at' => $dateTimeStringNow,
|
||||
'updated_at' => $dateTimeStringNow,
|
||||
];
|
||||
\Nexus\Database\NexusDB::insert('torrents_custom_field_values', $customData);
|
||||
}
|
||||
}
|
||||
if (!empty($_POST['custom_fields'][$newcatmode])) {
|
||||
$customField = new \Nexus\Field\Field();
|
||||
$customField->saveFieldValues($newcatmode, $id, $_POST['custom_fields'][$newcatmode]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,11 +28,19 @@ $subject = trim($_POST['subject']);
|
||||
$size = 10000;
|
||||
$page = 1;
|
||||
set_time_limit(300);
|
||||
$classStr = implode(",", $updateset);
|
||||
$conditions = [];
|
||||
if (!empty($_POST['classes'])) {
|
||||
$conditions[] = "class IN (" . implode(', ', $_POST['classes']) . ")";
|
||||
}
|
||||
$conditions = apply_filter("role_query_conditions", $conditions, $_POST);
|
||||
if (empty($conditions)) {
|
||||
stderr("Error","No valid filter");
|
||||
}
|
||||
$whereStr = implode(' OR ', $conditions);
|
||||
while (true) {
|
||||
$msgValues = [];
|
||||
$offset = ($page - 1) * $size;
|
||||
$query = sql_query("SELECT id FROM users WHERE class IN ($classStr) and `enabled` = 'yes' and `status` = 'confirmed' limit $offset, $size");
|
||||
$query = sql_query("SELECT id FROM users WHERE ($whereStr) and `enabled` = 'yes' and `status` = 'confirmed' limit $offset, $size");
|
||||
while($dat=mysql_fetch_assoc($query))
|
||||
{
|
||||
$msgValues[] = sprintf('(%s, %s, %s, %s, %s)', $sender_id, $dat['id'], $dt, sqlesc($subject), sqlesc($msg));
|
||||
|
||||
+34
-16
@@ -339,9 +339,38 @@ $insert = [
|
||||
'technical_info' => $_POST['technical_info'] ?? '',
|
||||
'cover' => $cover,
|
||||
];
|
||||
if (isset($_POST['hr']) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr']]) && user_can('torrent_hr')) {
|
||||
$insert['hr'] = $_POST['hr'];
|
||||
if (isset($_POST['hr'][$catmod]) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr'][$catmod]]) && user_can('torrent_hr')) {
|
||||
$insert['hr'] = $_POST['hr'][$catmod];
|
||||
}
|
||||
if(user_can('torrentsticky')) {
|
||||
if (isset($_POST['pos_state']) && isset(\App\Models\Torrent::$posStates[$_POST['pos_state']])) {
|
||||
$posStateUntil = $_POST['pos_state_until'] ?: null;
|
||||
$posState = $_POST['pos_state'];
|
||||
if ($posState == \App\Models\Torrent::POS_STATE_STICKY_NONE) {
|
||||
$posStateUntil = null;
|
||||
}
|
||||
if ($posStateUntil && \Carbon\Carbon::parse($posStateUntil)->lte(now())) {
|
||||
$posState = \App\Models\Torrent::POS_STATE_STICKY_NONE;
|
||||
$posStateUntil = null;
|
||||
}
|
||||
$insert['pos_state'] = $posState;
|
||||
$insert['pos_state_until'] = $posStateUntil;
|
||||
}
|
||||
}
|
||||
if(user_can('torrentmanage') && ($CURUSER['picker'] == 'yes' || get_user_class() >= \App\Models\User::CLASS_SYSOP)) {
|
||||
if (isset($_POST['picktype']) && isset(\App\Models\Torrent::$pickTypes[$_POST['picktype']])) {
|
||||
$insert['picktype'] = $_POST['picktype'];
|
||||
if ($insert['picktype'] == \App\Models\Torrent::PICK_NORMAL) {
|
||||
$insert['picktime'] = null;
|
||||
} else {
|
||||
$insert['picktime'] = now()->toDateTimeString();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (user_can('torrent-approval-allow-automatic')) {
|
||||
$insert['approval_status'] = \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
||||
}
|
||||
do_log("[INSERT_TORRENT]: " . nexus_json_encode($insert));
|
||||
$id = \Nexus\Database\NexusDB::insert('torrents', $insert);
|
||||
|
||||
//$ret = sql_query("INSERT INTO torrents (filename, owner, visible, anonymous, name, size, numfiles, type, url, small_descr, descr, ori_descr, category, source, medium, codec, audiocodec, standard, processing, team, save_as, sp_state, added, last_action, nfo, info_hash, pt_gen, technical_info) VALUES (".sqlesc($fname).", ".sqlesc($CURUSER["id"]).", 'yes', ".sqlesc($anonymous).", ".sqlesc($torrent).", ".sqlesc($totallen).", ".count($filelist).", ".sqlesc($type).", ".sqlesc($url).", ".sqlesc($small_descr).", ".sqlesc($descr).", ".sqlesc($descr).", ".sqlesc($catid).", ".sqlesc($sourceid).", ".sqlesc($mediumid).", ".sqlesc($codecid).", ".sqlesc($audiocodecid).", ".sqlesc($standardid).", ".sqlesc($processingid).", ".sqlesc($teamid).", ".sqlesc($dname).", ".sqlesc($sp_state) .
|
||||
@@ -365,20 +394,9 @@ if ($saveResult === false) {
|
||||
* add custom fields
|
||||
* @since v1.6
|
||||
*/
|
||||
if (!empty($_POST['custom_fields'])) {
|
||||
$now = date('Y-m-d H:i:s');
|
||||
foreach ($_POST['custom_fields'] as $customField => $customValue) {
|
||||
foreach ((array)$customValue as $value) {
|
||||
$customData = [
|
||||
'torrent_id' => $id,
|
||||
'custom_field_id' => $customField,
|
||||
'custom_field_value' => $value,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
\Nexus\Database\NexusDB::insert('torrents_custom_field_values', $customData);
|
||||
}
|
||||
}
|
||||
if (!empty($_POST['custom_fields'][$catmod])) {
|
||||
$customField = new \Nexus\Field\Field();
|
||||
$customField->saveFieldValues($catmod, $id, $_POST['custom_fields'][$catmod]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ if ($ip)
|
||||
$banstable .= "<tr><td>$first</td><td>$last</td><td>$comment</td></tr>\n";
|
||||
}
|
||||
$banstable .= "</table>\n";
|
||||
stderr("Result", "<table border=0 cellspacing=0 cellpadding=0><tr><td class=embedded style='padding-right: 5px'><img src=pic/smilies/excl.gif></td><td class=embedded>The IP address <b>". htmlspecialchars($ip) ."</b> is banned:</td></tr></table><p>". htmlspecialchars($banstable) ."</p>");
|
||||
stderr("Result", "<table border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>The IP address <b>". $ip ."</b> is banned:</td></tr></table><p>". $banstable ."</p>", false);
|
||||
}
|
||||
}
|
||||
stdhead();
|
||||
|
||||
+9
-10
@@ -10,8 +10,7 @@ parked();
|
||||
* tags
|
||||
*/
|
||||
$tagRep = new \App\Repositories\TagRepository();
|
||||
$tagKeyById = $tagRep->createBasicQuery()->get()->keyBy('id');
|
||||
$renderKeyArr = $tagKeyById->keys()->toArray();
|
||||
$allTags = $tagRep->listAll();
|
||||
$elasticsearchEnabled = nexus_env('ELASTICSEARCH_ENABLED');
|
||||
|
||||
//check searchbox
|
||||
@@ -914,11 +913,11 @@ if ($count)
|
||||
|
||||
list($pagertop, $pagerbottom, $limit, $offset, $size, $page) = pager($torrentsperpage, $count, "?" . $addparam);
|
||||
$fieldsStr = implode(', ', \App\Models\Torrent::getFieldsForList(true));
|
||||
if ($allsec == 1 || $enablespecial != 'yes') {
|
||||
$query = "SELECT $fieldsStr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $tagFilter $where $orderby $limit";
|
||||
} else {
|
||||
$query = "SELECT $fieldsStr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $tagFilter $where $orderby $limit";
|
||||
}
|
||||
// if ($allsec == 1 || $enablespecial != 'yes') {
|
||||
// $query = "SELECT $fieldsStr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $tagFilter $where $orderby $limit";
|
||||
// } else {
|
||||
$query = "SELECT $fieldsStr, categories.mode as search_box_id FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $tagFilter $where $orderby $limit";
|
||||
// }
|
||||
do_log("[TORRENT_LIST_SQL] $query", 'debug');
|
||||
if (!$elasticsearchEnabled) {
|
||||
$res = sql_query($query);
|
||||
@@ -1130,7 +1129,7 @@ if (!$Cache->get_page()){
|
||||
$hotsearch = "";
|
||||
while ($searchrow = mysql_fetch_assoc($searchres))
|
||||
{
|
||||
$hotsearch .= "<a href=\"".htmlspecialchars("?search=" . rawurlencode($searchrow["keywords"]) . "¬newword=1")."\"><u>" . $searchrow["keywords"] . "</u></a> ";
|
||||
$hotsearch .= "<a href=\"".htmlspecialchars("?search=" . rawurlencode($searchrow["keywords"]) . "¬newword=1")."\"><u>" . htmlspecialchars($searchrow["keywords"]) . "</u></a> ";
|
||||
$hotcount += mb_strlen($searchrow["keywords"],"UTF-8");
|
||||
if ($hotcount > 60)
|
||||
break;
|
||||
@@ -1143,8 +1142,8 @@ if (!$Cache->get_page()){
|
||||
}
|
||||
echo $Cache->next_row();
|
||||
|
||||
if ($tagKeyById->isNotEmpty()) {
|
||||
echo '<tr><td colspan="3" class="embedded" style="padding-top: 4px">' . $tagRep->renderSpan($tagKeyById, $renderKeyArr, true) . '</td></tr>';
|
||||
if ($allTags->isNotEmpty()) {
|
||||
echo '<tr><td colspan="3" class="embedded" style="padding-top: 4px">' . $tagRep->renderSpan(['*'], true) . '</td></tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+53
-10
@@ -2,6 +2,7 @@
|
||||
require_once("../include/bittorrent.php");
|
||||
dbconn();
|
||||
require_once(get_langfile_path());
|
||||
require_once(get_langfile_path('edit.php'));
|
||||
loggedinorreturn();
|
||||
parked();
|
||||
$userInfo = \App\Models\User::query()->findOrFail($CURUSER['id']);
|
||||
@@ -13,10 +14,15 @@ if ($enableoffer == 'yes')
|
||||
else $has_allowed_offer = 0;
|
||||
$uploadfreely = user_can_upload("torrents");
|
||||
$offerSkipApprovedCount = get_setting('main.offer_skip_approved_count');
|
||||
do_log("uploadfreely: $uploadfreely, has_allowed_offer: $has_allowed_offer, offerSkipApprovedCount: $offerSkipApprovedCount");
|
||||
$uploadDenyApprovalDenyCount = get_setting('main.upload_deny_approval_deny_count');
|
||||
$approvalDenyCount = \App\Models\Torrent::query()->where('owner', $CURUSER['id'])->where('approval_status', \App\Models\Torrent::APPROVAL_STATUS_DENY)->count();
|
||||
do_log("uploadfreely: $uploadfreely, has_allowed_offer: $has_allowed_offer, offerSkipApprovedCount: $offerSkipApprovedCount, uploadDenyApprovalDenyCount: $uploadDenyApprovalDenyCount, approvalDenyCount: $approvalDenyCount");
|
||||
$allowtorrents = ($has_allowed_offer || $uploadfreely || ($userInfo->offer_allowed_count >= $offerSkipApprovedCount));
|
||||
$allowspecial = user_can_upload("music");
|
||||
|
||||
if ($uploadDenyApprovalDenyCount > 0 && $approvalDenyCount >= $uploadDenyApprovalDenyCount) {
|
||||
stderr($lang_upload['std_sorry'],sprintf($lang_upload['approval_deny_reach_upper_limit'], $uploadDenyApprovalDenyCount),false);
|
||||
}
|
||||
if (!$allowtorrents && !$allowspecial)
|
||||
stderr($lang_upload['std_sorry'],$lang_upload['std_please_offer'],false);
|
||||
$allowtwosec = ($allowtorrents && $allowspecial);
|
||||
@@ -71,8 +77,6 @@ stdhead($lang_upload['head_upload']);
|
||||
$ptGen = new \Nexus\PTGen\PTGen();
|
||||
echo $ptGen->renderUploadPageFormInput("");
|
||||
}
|
||||
$field = new \Nexus\Field\Field();
|
||||
$field->renderOnUploadPage();
|
||||
if ($enablenfo_main=='yes') {
|
||||
tr($lang_upload['row_nfo_file'], "<input type=\"file\" class=\"file\" name=\"nfo\" /><br /><font class=\"medium\">".$lang_upload['text_only_viewed_by'].get_user_class_name($viewnfo_class,false,true,true).$lang_upload['text_or_above']."</font>", 1);
|
||||
}
|
||||
@@ -86,7 +90,7 @@ stdhead($lang_upload['head_upload']);
|
||||
|
||||
if ($allowtorrents){
|
||||
$disablespecial = " onchange=\"disableother('browsecat','specialcat')\"";
|
||||
$s = "<select name=\"type\" id=\"browsecat\" data-mode='$browsecatmode'>\n<option value=\"0\">".$lang_upload['select_choose_one']."</option>\n";
|
||||
$s = "<select name=\"type\" id=\"browsecat\" data-mode='$browsecatmode' ".($allowtwosec ? $disablespecial : "").">\n<option value=\"0\">".$lang_upload['select_choose_one']."</option>\n";
|
||||
$cats = genrelist($browsecatmode);
|
||||
foreach ($cats as $row)
|
||||
$s .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
|
||||
@@ -95,7 +99,7 @@ stdhead($lang_upload['head_upload']);
|
||||
else $s = "";
|
||||
if ($allowspecial){
|
||||
$disablebrowse = " onchange=\"disableother('specialcat','browsecat')\"";
|
||||
$s2 = "<select name=\"type\" id=\"specialcat\" data-mode='$specialcatmode'>\n<option value=\"0\">".$lang_upload['select_choose_one']."</option>\n";
|
||||
$s2 = "<select name=\"type\" id=\"specialcat\" data-mode='$specialcatmode' ".$disablebrowse.">\n<option value=\"0\">".$lang_upload['select_choose_one']."</option>\n";
|
||||
$cats2 = genrelist($specialcatmode);
|
||||
foreach ($cats2 as $row)
|
||||
$s2 .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
|
||||
@@ -147,13 +151,19 @@ stdhead($lang_upload['head_upload']);
|
||||
tr($lang_upload['row_content'],$team_select,1);
|
||||
}
|
||||
*/
|
||||
$customField = new \Nexus\Field\Field();
|
||||
$hitAndRunRep = new \App\Repositories\HitAndRunRepository();
|
||||
if ($allowtorrents) {
|
||||
$selectNormal = $searchBoxRep->renderQualitySelect($browsecatmode);
|
||||
tr($lang_upload['row_quality'], $selectNormal, 1, "hide mode mode_$browsecatmode");
|
||||
echo $customField->renderOnUploadPage(0, $browsecatmode);
|
||||
echo $hitAndRunRep->renderOnUploadPage('', $browsecatmode);
|
||||
}
|
||||
if ($allowspecial) {
|
||||
$selectNormal = $searchBoxRep->renderQualitySelect($specialcatmode);
|
||||
tr($lang_upload['row_quality'], $selectNormal, 1, "hide mode mode_$specialcatmode");
|
||||
echo $customField->renderOnUploadPage(0, $specialcatmode);
|
||||
echo $hitAndRunRep->renderOnUploadPage('', $specialcatmode);
|
||||
}
|
||||
|
||||
//==== offer dropdown for offer mod from code by S4NE
|
||||
@@ -191,16 +201,35 @@ JS;
|
||||
}
|
||||
//===end
|
||||
|
||||
//pick
|
||||
$pickcontent = '';
|
||||
if(user_can('torrentsticky'))
|
||||
{
|
||||
$options = [];
|
||||
foreach (\App\Models\Torrent::listPosStates() as $key => $value) {
|
||||
$options[] = "<option" . (($row["pos_state"] == $key) ? " selected=\"selected\"" : "" ) . " value=\"" . $key . "\">".$value['text']."</option>";
|
||||
}
|
||||
$pickcontent .= "<b>".$lang_edit['row_torrent_position'].": </b>"."<select name=\"pos_state\" style=\"width: 100px;\">" . implode('', $options) . "</select> ";
|
||||
$pickcontent .= datetimepicker_input('pos_state_until', '', nexus_trans('label.deadline') . ": ");
|
||||
}
|
||||
if(user_can('torrentmanage') && ($CURUSER["picker"] == 'yes' || get_user_class() >= \App\Models\User::CLASS_SYSOP))
|
||||
{
|
||||
if ($pickcontent) $pickcontent .= '<br />';
|
||||
$pickcontent .= "<b>".$lang_edit['row_recommended_movie'].": </b>"."<select name=\"picktype\" style=\"width: 100px;\">";
|
||||
foreach (\App\Models\Torrent::listPickInfo(true) as $_pick_type => $_pick_type_text) {
|
||||
$pickcontent .= sprintf('<option value="%s">%s</option>', $_pick_type, $_pick_type_text);
|
||||
}
|
||||
$pickcontent .= '</select>';
|
||||
}
|
||||
if ($pickcontent) {
|
||||
tr($lang_edit['row_pick'], $pickcontent, 1);
|
||||
}
|
||||
|
||||
if(user_can('beanonymous'))
|
||||
{
|
||||
tr($lang_upload['row_show_uploader'], "<input type=\"checkbox\" name=\"uplver\" value=\"yes\" />".$lang_upload['checkbox_hide_uploader_note'], 1);
|
||||
}
|
||||
tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox(), 1);
|
||||
if (get_setting('hr.mode') == \App\Models\HitAndRun::MODE_MANUAL && user_can('torrent_hr')) {
|
||||
$hrRadio = sprintf('<label><input type="radio" name="hr" value="0"%s />NO</label>', '');
|
||||
$hrRadio .= sprintf('<label><input type="radio" name="hr" value="1"%s />YES</label>', '');
|
||||
tr('H&R', $hrRadio, 1);
|
||||
}
|
||||
?>
|
||||
<tr><td class="toolbox" align="center" colspan="2"><b><?php echo $lang_upload['text_read_rules']?></b> <input id="qr" type="submit" class="btn" value="<?php echo $lang_upload['submit_upload']?>" /></td></tr>
|
||||
</table>
|
||||
@@ -208,4 +237,18 @@ JS;
|
||||
<?php
|
||||
\Nexus\Nexus::js('vendor/jquery-loading/jquery.loading.min.js', 'footer', true);
|
||||
\Nexus\Nexus::js('js/ptgen.js', 'footer', true);
|
||||
$customFieldJs = <<<JS
|
||||
jQuery("#compose").on("change", "select[name=type]", function () {
|
||||
let _this = jQuery(this);
|
||||
let mode = _this.attr("data-mode");
|
||||
let value = _this.val();
|
||||
console.log(mode)
|
||||
jQuery("tr[relation]").hide();
|
||||
if (value > 0) {
|
||||
jQuery("tr[relation=mode_" + mode +"]").show();
|
||||
}
|
||||
})
|
||||
jQuery("tr[relation]").hide();
|
||||
JS;
|
||||
\Nexus\Nexus::js($customFieldJs, 'footer', false);
|
||||
stdfoot();
|
||||
|
||||
@@ -241,7 +241,7 @@ if (mysql_num_rows($res) > 0)
|
||||
$clientselect .= "<tr>";
|
||||
$clientselect .= sprintf('<td>%s</td>', get_agent($arr['peer_id'], $arr['agent']));
|
||||
if (user_can('userprofile') || $user["id"] == $CURUSER["id"]) {
|
||||
$clientselect .= sprintf('<td>%s</td><td>%s</td><td>%s</td>', $arr['ipv4'].$seedBoxRep->renderIcon($arr['ipv4'], $CURUSER['id']), $arr['ipv6'].$seedBoxRep->renderIcon($arr['ipv6'], $CURUSER['id']), $arr['port']);
|
||||
$clientselect .= sprintf('<td>%s</td><td>%s</td><td>%s</td>', $arr['ipv4'].$seedBoxRep->renderIcon($arr['ipv4'], $user['id']), $arr['ipv6'].$seedBoxRep->renderIcon($arr['ipv6'], $user['id']), $arr['port']);
|
||||
} else {
|
||||
$clientselect .= sprintf('<td>%s</td><td>%s</td><td>%s</td>', '---', '---', '---');
|
||||
}
|
||||
@@ -394,6 +394,10 @@ if ($user["id"] == $CURUSER["id"] || user_can('viewhistory')) {
|
||||
tr_small($lang_functions['text_seed_points'], number_format($user['seed_points'], 1), 1);
|
||||
}
|
||||
|
||||
if (user_can('prfmanage') && $user["class"] < get_user_class()) {
|
||||
$bonusTable = build_bonus_table($user);
|
||||
tr_small($lang_userdetails['text_bonus_table'], $bonusTable['table'], 1);
|
||||
}
|
||||
|
||||
if ($user["ip"] && (user_can('torrenthistory') || $user["id"] == $CURUSER["id"])){
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6
-4
@@ -27,12 +27,14 @@ if ($view == "latin-1" || $view == "fonthack") {
|
||||
// Do not convert from ibm-437, read bytes as is.
|
||||
// NOTICE: TBSource specifies Latin-1 encoding in include/bittorrent.php:
|
||||
// stdhead()
|
||||
$nfo = htmlspecialchars(($a["nfo"]));
|
||||
//$nfo = htmlspecialchars(($a["nfo"]));
|
||||
$nfo = code_new($a["nfo"], $view);
|
||||
}
|
||||
else {
|
||||
// Convert from ibm-437 to html unicode entities.
|
||||
// take special care of Swedish letters if in magic view.
|
||||
$nfo = code($a["nfo"], $view == "magic");
|
||||
//$nfo = code($a["nfo"], $view == "magic");
|
||||
$nfo = code_new($a["nfo"], $view);
|
||||
}
|
||||
|
||||
stdhead($lang_viewnfo['head_view_nfo']);
|
||||
@@ -65,14 +67,14 @@ if ($view == "fonthack") {
|
||||
// Please notice: MS LineDraw's glyphs are included in the Courier New font
|
||||
// as of Courier New version 2.0, but uses the correct mappings instead.
|
||||
// http://support.microsoft.com/kb/q179422/
|
||||
print("<pre style=\"font-size:10pt; font-family: 'MS LineDraw', 'Terminal', monospace;\">");
|
||||
print("<pre style=\"font-size:10pt; font-family: 'MS LineDraw', 'Terminal', monospace;white-space: break-spaces\">");
|
||||
}
|
||||
else {
|
||||
// IE6.0 need to know which font to use, Mozilla can figure it out in its own
|
||||
// (windows firefox at least)
|
||||
// Anything else than 'Courier New' looks pretty broken.
|
||||
// 'Lucida Console', 'FixedSys'
|
||||
print("<pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">");
|
||||
print("<pre style=\"font-size:10pt; font-family: 'Courier New', monospace;white-space: break-spaces\">");
|
||||
}
|
||||
// Writes the (eventually modified) nfo data to output, first formating urls.
|
||||
print(format_urls($nfo));
|
||||
|
||||
@@ -13,7 +13,7 @@ begin_main_frame();
|
||||
$torrent_name = get_single_value("torrents", "name", "WHERE id = ".sqlesc($id));
|
||||
print("<h1 align=center>".$lang_viewsnatches['text_snatch_detail_for'] . "<a href=details.php?id=" . htmlspecialchars($id) . "><b>".htmlspecialchars($torrent_name)."</b></a></h1>");
|
||||
$count = get_row_count("snatched", "WHERE finished = 'yes' AND torrentid = ".sqlesc($id));
|
||||
|
||||
$seedBoxRep = new \App\Repositories\SeedBoxRepository();
|
||||
if ($count){
|
||||
$perpage = 25;
|
||||
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["SCRIPT_NAME"] . "?id=" . htmlspecialchars($id) . "&" );
|
||||
@@ -53,7 +53,7 @@ if ($count){
|
||||
}
|
||||
else $username = get_username($arr['userid']);
|
||||
$reportImage = "<img class=\"f_report\" src=\"pic/trans.gif\" alt=\"Report\" title=\"".$lang_viewsnatches['title_report']."\" />";
|
||||
print("<tr$highlight><td class=rowfollow align=center>" . $username ."</td>".(user_can('userprofile') ? "<td class=rowfollow align=center>".$arr['ip']."</td>" : "")."<td class=rowfollow align=center>".$uploaded."@".$uprate.$lang_viewsnatches['text_per_second']."<br />".$downloaded."@".$downrate.$lang_viewsnatches['text_per_second']."</td><td class=rowfollow align=center>$ratio</td><td class=rowfollow align=center>$seedtime</td><td class=rowfollow align=center>$leechtime</td><td class=rowfollow align=center>".gettime($arr['completedat'],true,false)."</td><td class=rowfollow align=center>".gettime($arr['last_action'],true,false)."</td><td class=rowfollow align=center style='padding: 0px'>".($userrow['privacy'] != 'strong' || user_can('viewanonymous') ? "<a href=report.php?user={$arr['userid']}>$reportImage</a>" : $reportImage)."</td></tr>\n");
|
||||
print("<tr$highlight><td class=rowfollow align=center>" . $username ."</td>".(user_can('userprofile') || $arr['userid'] == $CURUSER['id'] ? "<td class=rowfollow align=center><span class='nowrap'>".$arr['ip'].$seedBoxRep->renderIcon($arr['ip'], $arr['userid'])."</span></td>" : "")."<td class=rowfollow align=center>".$uploaded."@".$uprate.$lang_viewsnatches['text_per_second']."<br />".$downloaded."@".$downrate.$lang_viewsnatches['text_per_second']."</td><td class=rowfollow align=center>$ratio</td><td class=rowfollow align=center>$seedtime</td><td class=rowfollow align=center>$leechtime</td><td class=rowfollow align=center>".gettime($arr['completedat'],true,false)."</td><td class=rowfollow align=center>".gettime($arr['last_action'],true,false)."</td><td class=rowfollow align=center style='padding: 0px'>".($userrow['privacy'] != 'strong' || user_can('viewanonymous') ? "<a href=report.php?user={$arr['userid']}>$reportImage</a>" : $reportImage)."</td></tr>\n");
|
||||
}
|
||||
print("</table>\n");
|
||||
print($pagerbottom);
|
||||
|
||||
Reference in New Issue
Block a user