Skip to content

Commit

Permalink
增加取消下载次数提醒功能
Browse files Browse the repository at this point in the history
  • Loading branch information
yuantuo666 committed Feb 12, 2021
1 parent d908cba commit 87c5dfc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
28 changes: 16 additions & 12 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,22 @@
<script defer src="static/ready.js"></script>
<script>
function confirmdl(fs_id, timestamp, sign, randsk, share_id, uk, bdstoken, filesize) {
Swal.fire({
title: "<?php echo Language["ConfirmTitle"]; ?>",
html: "<?php echo Language["ConfirmText"]; ?>",
icon: "warning",
showCancelButton: true,
confirmButtonText: "<?php echo Language["ConfirmmButtonText"]; ?>",
reverseButtons: true
}).then(function(e) {
if (e.isConfirmed) {
dl(fs_id, timestamp, sign, randsk, share_id, uk, bdstoken, filesize);
}
});
<?php
if (IsConfirmDownload)
echo 'Swal.fire({
title: "' . Language["ConfirmTitle"] . '",
html: "' . Language["ConfirmText"] . '",
icon: "warning",
showCancelButton: true,
confirmButtonText: "' . Language["ConfirmmButtonText"] . '",
reverseButtons: true
}).then(function(e) {
if (e.isConfirmed) {
dl(fs_id, timestamp, sign, randsk, share_id, uk, bdstoken, filesize);
}
});';
else echo 'dl(fs_id, timestamp, sign, randsk, share_id, uk, bdstoken, filesize);';
?>
}
</script>
</head>
Expand Down
19 changes: 19 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@
<small class="form-text">设置每一个IP的下载次数。</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">是否开启下载次数提示</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="IsConfirmDownload" id="IsConfirmDownload1" value="true" checked>
<label class="form-check-label" for="IsConfirmDownload1">
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="IsConfirmDownload" id="IsConfirmDownload2" value="false">
<label class="form-check-label" for="IsConfirmDownload2">
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">页脚设置</label>
<div class="col-sm-10">
Expand Down Expand Up @@ -395,6 +412,7 @@ function CheckForm() {
$Password = (!empty($_POST["Password"])) ? $_POST["Password"] : "";
$ADMIN_PASSWORD = (!empty($_POST["ADMIN_PASSWORD"])) ? $_POST["ADMIN_PASSWORD"] : "";
$DownloadTimes = (!empty($_POST["DownloadTimes"])) ? $_POST["DownloadTimes"] : "";
$IsConfirmDownload = (!empty($_POST["IsConfirmDownload"])) ? $_POST["IsConfirmDownload"] : "";
$Footer = (!empty($_POST["Footer"])) ? $_POST["Footer"] : "";

$BDUSS = (!empty($_POST["BDUSS"])) ? $_POST["BDUSS"] : "";
Expand Down Expand Up @@ -449,6 +467,7 @@ function CheckForm() {
$update_config = str_replace('<Password>', $Password, $update_config);
$update_config = str_replace('<ADMIN_PASSWORD>', $ADMIN_PASSWORD, $update_config);
$update_config = str_replace('<DownloadTimes>', $DownloadTimes, $update_config);
$update_config = str_replace('<IsConfirmDownload>', $IsConfirmDownload, $update_config);
$update_config = str_replace('<Footer>', $Footer, $update_config);

$update_config = str_replace('<BDUSS>', $BDUSS, $update_config);
Expand Down
2 changes: 1 addition & 1 deletion install/config_raw
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if (!defined('init')) {
const Sitename = '<Sitename>'; const BDUSS = '<BDUSS>'; const STOKEN = '<STOKEN>'; const SVIP_BDUSS = '<SVIP_BDUSS>'; const IsCheckPassword = <IsCheckPassword>;
const Password = '<Password>'; const Footer = '<Footer>'; const APP_ID = '250528'; const DEBUG = false; const USING_DB = <USING_DB>;
const DbConfig = array("servername" => "<servername>", "username" => "<username>", "password" => "<password>", "dbname" => "<dbname>", "dbtable" => "<dbtable>");
const ADMIN_PASSWORD = '<ADMIN_PASSWORD>'; const DownloadTimes = <DownloadTimes>;
const ADMIN_PASSWORD = '<ADMIN_PASSWORD>'; const DownloadTimes = <DownloadTimes>; const IsConfirmDownload = <IsConfirmDownload>;

0 comments on commit 87c5dfc

Please sign in to comment.