add bonus exchange downloaded

This commit is contained in:
xiaomlove
2022-09-17 14:59:46 +08:00
parent dd51f32193
commit fedc67ad5e
23 changed files with 572 additions and 5 deletions
+35
View File
@@ -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;
@@ -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")
@@ -538,6 +567,12 @@ if ($action == "exchange") {
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 download bonus.", ['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) {
+6 -1
View File
@@ -97,7 +97,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'
);
GetVar($validConfig);
$BONUS = [];
@@ -582,6 +582,11 @@ elseif ($action == 'bonussettings'){
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);