diff --git a/include/constants.php b/include/constants.php
index 35c9e939..4bf2abdc 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -1,6 +1,6 @@
count();
foreach ($harems as $harem) {
$result = calculate_seed_bonus($harem->id);
- $addition += $result['seed_bonus'];
+ $addition += $result['seed_points'];
}
do_log("[HAREM_ADDITION], user: $uid, haremsCount: $haremsCount ,addition: $addition");
return $addition;
diff --git a/lang/chs/lang_mybonus.php b/lang/chs/lang_mybonus.php
index f6b04e0f..4f7f4b6b 100644
--- a/lang/chs/lang_mybonus.php
+++ b/lang/chs/lang_mybonus.php
@@ -145,10 +145,14 @@ $lang_mybonus = array
'reward_type_harem_addition' => '后宫加成',
'bonus_base' => '基础魔力',
'lock_text' => '系统限制 %s 秒内只能点击交换按钮一次!',
- 'text_get_by_seeding_official' => '官种每小时将额外得到如下的魔力值',
+ 'text_get_by_seeding_official' => '官种加成每小时将额外得到如下的魔力值',
'official_calculate_method' => '官种奖励计算公式同上,只是仅针对官种进行计算',
'official_tag_bonus_additional_factor' => '最终奖励为计算所得官种奖励乘以官种系数,当前官种系数为: ',
'reward_type_official_addition' => '官种加成',
+ 'text_get_by_harem' => '后宫加成每小时将额外得到如下的魔力值',
+ 'harem_additional_desc' => '后宫只考虑直属后宫。每个后宫加成值可在此 查看',
+ 'harem_additional_factor' => '所得奖励为全部后宫的时魔(不考虑加成)之和,乘以后宫加成系数,当前值为:',
+ 'text_bonus_summary' => '每小时获得的合计魔力值',
);
?>
diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php
index 8ba8e403..e87e3cc6 100644
--- a/lang/chs/lang_settings.php
+++ b/lang/chs/lang_settings.php
@@ -788,6 +788,8 @@ $lang_settings = array
'text_official_tag_note' => '。带此标签的种子为官种',
'row_zero_bonus_tag' => '零魔标签',
'text_zero_bonus_tag_note' => '。带此标签的种子为零魔种子',
+ 'row_upload_deny_approval_deny_count' => '拒绝发布审核不通过数',
+ 'text_upload_deny_approval_deny_count_note' => "当审核不通过的种子数大于等于此数值时,不允许发布。设置为 '0' 不使用此规则",
);
?>
diff --git a/lang/chs/lang_upload.php b/lang/chs/lang_upload.php
index 773cc5af..172beca0 100644
--- a/lang/chs/lang_upload.php
+++ b/lang/chs/lang_upload.php
@@ -41,6 +41,7 @@ $lang_upload = array
'text_english_title' => "英文名:",
'text_titles_note' => "(如果英文名不存在,使用拼音或不填写)",
'fill_quality' => '填写质量',
+ 'approval_deny_reach_upper_limit' => '当前审核被拒绝的种子数:%s 达到上限,不允许发布。',
);
?>
diff --git a/lang/cht/lang_mybonus.php b/lang/cht/lang_mybonus.php
index e77b7aad..c71668e2 100644
--- a/lang/cht/lang_mybonus.php
+++ b/lang/cht/lang_mybonus.php
@@ -145,11 +145,14 @@ $lang_mybonus = array
'reward_type_harem_addition' => '後宮加成',
'bonus_base' => '基礎魔力',
'lock_text' => '系統限製 %s 秒內只能點擊交換按鈕一次!',
- 'text_get_by_seeding_official' => '官種每小時將額外得到如下的魔力值',
+ 'text_get_by_seeding_official' => '官種加成每小時將額外得到如下的魔力值',
'official_calculate_method' => '官種獎勵計算公式同上,只是僅針對官種進行計算',
'official_tag_bonus_additional_factor' => '最終獎勵為計算所得官種獎勵乘以官種系數,當前官種系數為: ',
'reward_type_official_addition' => '官種加成',
-
+ 'text_get_by_harem' => '後宮加成每小時將額外得到如下的魔力值',
+ 'harem_additional_desc' => '後宮只考慮直屬後宮。每個後宮加成值可在此 查看',
+ 'harem_additional_factor' => '所得獎勵為全部後宮的時魔(不考慮加成)之和,乘以後宮加成系數,當前值為:',
+ 'text_bonus_summary' => '每小時獲得的合計魔力值',
);
?>
diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php
index b498d177..e0190c52 100644
--- a/lang/cht/lang_settings.php
+++ b/lang/cht/lang_settings.php
@@ -788,6 +788,8 @@ $lang_settings = array
'text_official_tag_note' => '。帶此標簽的種子為官種',
'row_zero_bonus_tag' => '零魔標簽',
'text_zero_bonus_tag_note' => '。帶此標簽的種子為零魔種子',
+ 'row_upload_deny_approval_deny_count' => '拒絕發布審核不通過數',
+ 'text_upload_deny_approval_deny_count_note' => "當審核不通過的種子數大於等於此數值時,不允許發布。設置為 '0' 不使用此規則",
);
?>
diff --git a/lang/cht/lang_upload.php b/lang/cht/lang_upload.php
index 705d00ca..d8e870b1 100644
--- a/lang/cht/lang_upload.php
+++ b/lang/cht/lang_upload.php
@@ -41,6 +41,7 @@ $lang_upload = array
'text_english_title' => "英文名:",
'text_titles_note' => "(如果英文名不存在,請使用拼音或不填寫)",
'fill_quality' => '填寫質量',
+ 'approval_deny_reach_upper_limit' => '當前審核被拒絕的種子數:%s 達到上限,不允許發布。',
);
?>
diff --git a/lang/en/lang_mybonus.php b/lang/en/lang_mybonus.php
index 995ae057..f42e096d 100644
--- a/lang/en/lang_mybonus.php
+++ b/lang/en/lang_mybonus.php
@@ -97,7 +97,7 @@ where
A is an intermediate variableTi is the i<
'text_bonus_formula_three' => " B is the number of karma points gained by seeding in an hourB0 is a parameter, which stands for the maximum bonus points per hour a user can get by seeding. B0 = ",
'text_bonus_formula_four' => "L is a parameter. L = ",
'text_bonus_formula_five' => " In a nutshell, you can get more bonus by seeding less-seeded and larger torrents.",
- 'text_bonus_formula_wi' => "Wi is the i th torrent's weight, default is 1, zero torrent is ",
+ 'text_bonus_formula_wi' => "Wi is the i th torrent's weight, default is 1, zero bonus torrent is ",
'text_user_with_ratio_above' => "User with ratio above ",
'text_and_uploaded_amount_above' => " and uploaded amount above ",
'text_cannot_exchange_uploading' => " GB cannot exchange for more uploading credit.",
@@ -149,6 +149,10 @@ whereA is an intermediate variableTi is the i<
'official_calculate_method' => 'The formula for calculating the official reward is the same as above, but only for the official type',
'official_tag_bonus_additional_factor' => 'The final reward is the calculated official type reward multiplied by the official type factor, the current official type factor is: ',
'reward_type_official_addition' => 'Official addition',
+ 'text_get_by_harem' => 'The harem addition will give the following additional bonus value per hour',
+ 'harem_additional_desc' => "Only direct harems will be considered for the harem. Each harem's bonus addition value can be viewed here ",
+ 'harem_additional_factor' => 'The reward obtained is the sum of the hourly bonus of all the harems (regardless of the addition), multiplied by the harem bonus factor, with the current value of ',
+ 'text_bonus_summary' => 'Total bonus gained per hour',
);
?>
diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php
index a67f96c4..d83efd55 100644
--- a/lang/en/lang_settings.php
+++ b/lang/en/lang_settings.php
@@ -788,6 +788,8 @@ $lang_settings = array
'text_official_tag_note' => '. Torrents with this tag are official torrents',
'row_zero_bonus_tag' => 'Zero bonus tag',
'text_zero_bonus_tag_note' => '. Torrents with this tag are zero bonus torrents',
+ 'row_upload_deny_approval_deny_count' => 'Refuse to upload approval deny count',
+ 'text_upload_deny_approval_deny_count_note' => "When the number of torrents approval deny is greater than or equal to this value, publishing is not allowed. Set to '0' to not use this rule",
);
?>
diff --git a/lang/en/lang_upload.php b/lang/en/lang_upload.php
index 341b9f8f..ae6125d1 100644
--- a/lang/en/lang_upload.php
+++ b/lang/en/lang_upload.php
@@ -41,6 +41,7 @@ $lang_upload = array
'text_english_title' => "English Name:",
'text_titles_note' => "(If no English Name exists, use pinyin or leave it blank)",
'fill_quality' => 'Fill quality',
+ 'approval_deny_reach_upper_limit' => 'The number of torrents whose current approval was denied: %s reached the upper limit and is not allowed to be upload.',
);
?>
diff --git a/nexus/Install/settings.default.php b/nexus/Install/settings.default.php
index 33514956..1b45c121 100644
--- a/nexus/Install/settings.default.php
+++ b/nexus/Install/settings.default.php
@@ -92,6 +92,7 @@ return array (
'show_top_uploader' => 'no',
'imdb_language' => 'en-US',
'offer_skip_approved_count' => 5,
+ 'upload_deny_approval_deny_count' => 2,
),
'smtp' =>
array (
diff --git a/public/mybonus.php b/public/mybonus.php
index 926648ce..e7ac933d 100644
--- a/public/mybonus.php
+++ b/public/mybonus.php
@@ -426,51 +426,10 @@ if ($donortimes_bonus)
print(" ");
-// $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']);
$A = $seedBonusResult['A'];
-
- $percent = $seedBonusResult['seed_bonus'] * 100 / ($bzero_bonus + $perseeding_bonus * $maxseeding_bonus);
- print("".$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).")
");
-
- if ($percent <= 30) $loadpic = "loadbarred";
- elseif ($percent <= 60) $loadpic = "loadbaryellow";
- else $loadpic = "loadbargreen";
- $width = $percent * 4;
- print("
");
-
- $officialAdditionalFactor = get_setting('bonus.official_addition', 0);
- $officialTag = get_setting('bonus.official_tag');
- if ($officialAdditionalFactor > 0 && $officialTag) {
- print("".$lang_mybonus['text_get_by_seeding_official']." ");
- print("");
- print("".$lang_mybonus['official_calculate_method']." ");
- print("".$lang_mybonus['official_tag_bonus_additional_factor'].$officialAdditionalFactor." ");
- print(" ");
- }
-
+$officialAdditionalFactor = get_setting('bonus.official_addition', 0);
+$officialTag = get_setting('bonus.official_tag');
$haremFactor = get_setting('bonus.harem_addition');
$haremAddition = calculate_harem_addition($CURUSER['id']);
$isDonor = is_donor($CURUSER);
@@ -478,13 +437,28 @@ $baseBonusFactor = 1;
if ($isDonor) {
$baseBonusFactor = $donortimes_bonus;
}
-$totalBonus = number_format($seedBonusResult['seed_bonus'] * $baseBonusFactor + $haremAddition * $haremFactor + $seedBonusResult['official_bonus'] * $officialAdditionalFactor, 3);
+$baseBonus = $seedBonusResult['seed_bonus'] * $baseBonusFactor;
+$totalBonus = number_format( $baseBonus + $haremAddition * $haremFactor + $seedBonusResult['official_bonus'] * $officialAdditionalFactor, 3);
+
+
+$percent = $seedBonusResult['seed_bonus'] * 100 / ($bzero_bonus + $perseeding_bonus * $maxseeding_bonus);
+print("".$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).")
");
+
+if ($percent <= 30) $loadpic = "loadbarred";
+elseif ($percent <= 60) $loadpic = "loadbaryellow";
+else $loadpic = "loadbargreen";
+$width = $percent * 4;
+print("
");
+
$rowSpan = 1;
+$hasHaremAddition = $hasOfficialAddition = false;
if ($haremFactor > 0) {
$rowSpan++;
+ $hasHaremAddition = true;
}
if ($officialAdditionalFactor > 0 && $officialTag) {
$rowSpan++;
+ $hasOfficialAddition = true;
}
$summaryTable = '';
$summaryTable .= ''.$lang_mybonus['reward_type'].' '.$lang_mybonus['bonus_base'].' '.$lang_mybonus['factor'].' '.$lang_mybonus['got_bonus'].' '.$lang_mybonus['total'].' ';
@@ -493,20 +467,17 @@ $summaryTable .= sprintf(
$lang_mybonus['reward_type_basic'],
number_format($seedBonusResult['seed_bonus'],3),
$baseBonusFactor,
- number_format($seedBonusResult['seed_bonus'],3),
+ number_format($baseBonus,3),
$rowSpan,
$totalBonus
);
-if ($haremFactor > 0) {
- $summaryTable .= sprintf(
- '%s %s %s %s ',
- $lang_mybonus['reward_type_harem_addition'],
- number_format($haremAddition, 3),
- $haremFactor,
- number_format($haremAddition * $haremFactor, 3)
- );
-}
-if ($officialAdditionalFactor > 0 && $officialTag) {
+
+if ($hasOfficialAddition) {
+ print("".$lang_mybonus['text_get_by_seeding_official']." ");
+ print("");
+ print("".$lang_mybonus['official_calculate_method']." ");
+ print("".$lang_mybonus['official_tag_bonus_additional_factor'].$officialAdditionalFactor." ");
+ print(" ");
$summaryTable .= sprintf(
'%s %s %s %s ',
$lang_mybonus['reward_type_official_addition'],
@@ -516,8 +487,23 @@ if ($officialAdditionalFactor > 0 && $officialTag) {
);
}
+if ($hasHaremAddition) {
+ print("".$lang_mybonus['text_get_by_harem']." ");
+ print("");
+ print("".sprintf($lang_mybonus['harem_additional_desc'], $CURUSER['id'])." ");
+ print("".$lang_mybonus['harem_additional_factor'].$haremFactor." ");
+ print(" ");
+ $summaryTable .= sprintf(
+ '%s %s %s %s ',
+ $lang_mybonus['reward_type_harem_addition'],
+ number_format($haremAddition, 3),
+ $haremFactor,
+ number_format($haremAddition * $haremFactor, 3)
+ );
+}
$summaryTable .= '
';
+print("".$lang_mybonus['text_bonus_summary']." ");
print ''.$summaryTable.'
';
print("".$lang_mybonus['text_other_things_get_bonus']." ");
diff --git a/public/settings.php b/public/settings.php
index 3652c942..453dc372 100644
--- a/public/settings.php
+++ b/public/settings.php
@@ -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 = [];
@@ -871,6 +872,7 @@ JS;
tr($lang_settings['row_offer_vote_timeout']," ".$lang_settings['text_offer_vote_timeout_note'], 1);
tr($lang_settings['row_offer_upload_timeout']," ".$lang_settings['text_offer_upload_timeout_note'], 1);
tr($lang_settings['row_offer_skip_approved_count']," ".$lang_settings['text_offer_skip_approved_count_note'], 1);
+ tr($lang_settings['row_upload_deny_approval_deny_count']," ".$lang_settings['text_upload_deny_approval_deny_count_note'], 1);
tr($lang_settings['row_max_subtitle_size']," ". $lang_settings['text_max_subtitle_size_note'], 1);
tr($lang_settings['row_posts_per_page']," ".$lang_settings['text_posts_per_page_note'], 1);
diff --git a/public/upload.php b/public/upload.php
index f686d8cb..633cd7c0 100644
--- a/public/upload.php
+++ b/public/upload.php
@@ -14,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);