From 54a010c9bd487ea266deae0721546ae5b78ba0aa Mon Sep 17 00:00:00 2001 From: icret Date: Sat, 16 Apr 2022 05:23:49 +0000 Subject: [PATCH] v2.5.9 --- README.md | 2 +- admin/admin.inc.php | 55 +++--- admin/index.php | 24 +++ application/compressing.php | 47 ++--- application/function.php | 5 +- application/list.php | 161 +++++++++++------- config/config.php | 4 +- public/static/zui/lib/bootbox/bootbox.min.css | 1 + public/static/zui/lib/bootbox/bootbox.min.js | 2 + 9 files changed, 188 insertions(+), 113 deletions(-) create mode 100755 public/static/zui/lib/bootbox/bootbox.min.css create mode 100755 public/static/zui/lib/bootbox/bootbox.min.js diff --git a/README.md b/README.md index 3f3f64c..84bca6d 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![jsdelivr](https://data.jsdelivr.com/v1/package/gh/icret/EasyImages2.0/badge)](https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@EasyImage2.0/) [![Code size](https://img.shields.io/github/languages/code-size/icret/EasyImages2.0?color=blueviolet)](https://github.com/icret/EasyImages2.0) [![License](https://img.shields.io/badge/license-GPL_V2.0-yellowgreen.svg)](https://github.com/icret/EasyImages2.0/blob/master/LICENSE) -[![QQ group](https://pub.idqqimg.com/wpa/images/group.png)](https://qm.qq.com/cgi-bin/qm/qr?k=TmGoIK7BXij_CR3lqZoJZu3_trPwtJ09&jump_from=webapi) +[![QQ group](https://pub.idqqimg.com/wpa/images/group.png)](https://jq.qq.com/?_wv=1027&k=jfXRHU8Y) >[演示](https://png.cm/) | [Chrome/Edge 插件](https://github.com/icret/EasyImage-Browser-Extension) | [使用手册](https://www.kancloud.cn/easyimage/easyimage/) > diff --git a/admin/admin.inc.php b/admin/admin.inc.php index 5fa1511..ac517e9 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -194,7 +194,7 @@ if (isset($_GET['recycle_reimg'])) { - + 打赏作者 @@ -210,7 +210,7 @@ if (isset($_GET['recycle_reimg'])) {
  • 图片回收
  • 可疑图片
  • 广告设置
  • -
  • 文件管理
  • +
  • 文件管理
  • 图床安全
  • 账号密码
  • 系统信息
  • @@ -302,7 +302,7 @@ if (isset($_GET['recycle_reimg'])) {
    - +
    @@ -361,21 +361,6 @@ if (isset($_GET['recycle_reimg'])) {
    -
    -

    -
    - - -
    - -
    -
    -
    - - -
    - -
    @@ -693,7 +678,8 @@ if (isset($_GET['recycle_reimg'])) {
    图床信息

    API 插件
    - Edge/Chrome + Edge + Chrome ShareX PicGo
    图床依赖
    @@ -709,12 +695,15 @@ if (isset($_GET['recycle_reimg'])) { Moderatecontent ZUI + verot + Tinyfilemanager New GPL-2.0

    +

    EasyImage2.0简单图床构建于众多优秀的开源项目之上,非常感谢这些项目!

    @@ -765,10 +754,10 @@ if (isset($_GET['recycle_reimg'])) {
    -
    +
    > - +
    @@ -800,7 +789,7 @@ if (isset($_GET['recycle_reimg'])) {
    - + @@ -1044,6 +1033,28 @@ if (isset($_GET['recycle_reimg'])) {
    +
    +

    文件管理 Tinyfilemanager是由作者定制开发,非必要请勿替换

    + 文件管理 +
    +

    删除文件 * 删除后不可恢复

    +
    +

    +
    + + +
    + +
    +
    +
    +
    + + +
    + +
    +
    diff --git a/admin/index.php b/admin/index.php index e79beb8..cce0919 100755 --- a/admin/index.php +++ b/admin/index.php @@ -89,6 +89,27 @@ if (isset($_GET['login'])) { } } ?> + +
    @@ -116,6 +137,9 @@ if (isset($_GET['login'])) { +
    diff --git a/application/compressing.php b/application/compressing.php index 390c93b..b6d8f82 100755 --- a/application/compressing.php +++ b/application/compressing.php @@ -9,6 +9,7 @@ require_once APP_ROOT . '/application/compress/function.compress.php'; // 检测登录 if (!is_who_login('admin')) { checkLogin(); + echo '
    未登陆~~
    '; exit(require_once APP_ROOT . '/application/footer.php'); } // 文件夹压缩 @@ -23,7 +24,7 @@ if (isset($_POST['folder'])) { $folder = '..' . $config['path'] . $getFolder; if (!is_dir($folder)) { - exit($folder . ''); @@ -35,30 +36,34 @@ if (isset($_POST['folder'])) { compress($folder, $type, $source); echo ' - '; +} else { + $folder = 0; + $sizeBefor = 0; } // 压缩后 $sizeAfter = getDirectorySize($folder); - -echo ' +?>

    压缩完毕

    -

    压缩前:' . getDistUsed($sizeBefor) . ' 压缩后:' . getDistUsed($sizeAfter) . '

    -

    -无论使用哪种压缩均为不可逆操作,并且非常占用硬件资源。 - -如机器配置过低可能会导致CPU、内存飙升! - -Imgcompress 自带压缩为轻微有损压缩图片 此压缩有可能使图片变大,特别是小图片!也有一定概率改变图片方向。 - -Imgcompress 对自身机器要求高,如图片过多会导致脚本崩溃或者超时(已经预处理超时和脚本崩溃处理,但是有概率重现)! - -TinyPng 是 https://tinify.cn/ 提供的API,需要自行申请,对服务器要求较低,但是对网络要求高!如在国内可能导致非常慢而超时崩溃(已预处理,但是有概率重现)。 - -获取TinyPng key https://tinify.cn/developers 并填入 /config/api_key.php 文件。 -

    -'; - -include 'footer.php'; +

    压缩前:压缩后: +

    +
    +无论使用哪种压缩均为不可逆操作,并且非常占用硬件资源。
    +如机器配置过低可能会导致CPU、内存飙升!
    +Imgcompress 自带压缩为轻微有损压缩图片 此压缩有可能使图片变大,特别是小图片!也有一定概率改变图片方向。
    +Imgcompress 对自身机器要求高,如图片过多会导致脚本崩溃或者超时(已经预处理超时和脚本崩溃处理,但是有概率重现)!
    +TinyPng 是 https://tinify.cn/ 提供的API,需要自行申请,对服务器要求较低,但是对网络要求高!如在国内可能导致非常慢而超时崩溃(已预处理,但是有概率重现)。
    +获取TinyPng key https://tinify.cn/developers 并填入 API 设置->TinyPng Key 文件。
    +
    + +/public/static/EasyImage.css"> + + @@ -178,76 +180,107 @@ if ($config['ad_top']) echo $config['ad_top_info']; } // 回收图片 function recycle_img() { - var r = confirm("确认要放入回收站?\n* 可在可疑图片中恢复!") - if (r == true) { - obj = document.getElementsByName("checkbox"); - check_val = []; - for (k in obj) { - //判断复选框是否被选中 - if (obj[k].checked) - //获取被选中的复选框的值 - check_val.push(obj[k].value); - console.log(check_val); + bootbox.confirm({ + message: "确认要放入回收站?
    可在可疑图片中恢复!", + buttons: { + confirm: { + label: '确定', + className: 'btn-success' + }, + cancel: { + label: '取消', + className: 'btn-danger' + } + }, + callback: function(result) { + if (result == true) { + obj = document.getElementsByName("checkbox"); + check_val = []; + for (k in obj) { + //判断复选框是否被选中 + if (obj[k].checked) + //获取被选中的复选框的值 + check_val.push(obj[k].value); + console.log(check_val); + } + $.post("./post_del.php", { + 'recycle_url_array': check_val + }, ); + new $.zui.Messager("放入回收站成功", { + type: "success", // 定义颜色主题 + icon: "ok-sign" // 定义消息图标 + }).show(); + // 延时2秒刷新 + window.setTimeout(function() { + window.location.reload(); + }, 1500) + } else { + new $.zui.Messager("取消回收", { + type: "primary", // 定义颜色主题 + icon: "info-sign" // 定义消息图标 + }).show(); + } + console.log('是否回收图片: ' + result); } - $.post("./post_del.php", { - 'recycle_url_array': check_val - }, ); - new $.zui.Messager("放入回收站成功", { - type: "success", // 定义颜色主题 - icon: "ok-sign" // 定义消息图标 - }).show(); - // 延时2秒刷新 - window.setTimeout(function() { - window.location.reload(); - }, 1500) - } else { - new $.zui.Messager("取消回收", { - type: "primary", // 定义颜色主题 - icon: "info-sign" // 定义消息图标 - }).show(); - } + }); + } // 删除图片 function delete_img() { - var r = confirm("确认要删除?\n* 删除文件夹后将无法恢复!") - if (r == true) { - obj = document.getElementsByName("checkbox"); - check_val = []; - for (k in obj) { - //判断复选框是否被选中 - if (obj[k].checked) - //获取被选中的复选框的值 - check_val.push(obj[k].value); - console.log(check_val); - } - $.post("./post_del.php", { - 'del_url_array': check_val + bootbox.confirm({ + message: "确认要删除?
    * 删除文件夹后将无法恢复!", + buttons: { + confirm: { + label: '确定', + className: 'btn-success' }, - function(data) { - if (data.search('success') > 0) { - new $.zui.Messager("删除成功", { - type: "success", // 定义颜色主题 - icon: "ok-sign" // 定义消息图标 - }).show(); - // 延时2秒刷新 - window.setTimeout(function() { - window.location.reload(); - }, 1500) - } else { - new $.zui.Messager("删除失败 请登录后再删除!", { - type: "danger", // 定义颜色主题 - icon: "exclamation-sign" // 定义消息图标 - }).show(); - // 延时2s跳转 - window.setTimeout("window.location=\'/../admin/index.php \'", 2000); + cancel: { + label: '取消', + className: 'btn-danger' + } + }, + callback: function(result) { + if (result == true) { + obj = document.getElementsByName("checkbox"); + check_val = []; + for (k in obj) { + //判断复选框是否被选中 + if (obj[k].checked) + //获取被选中的复选框的值 + check_val.push(obj[k].value); + console.log(check_val); } - }); - } else { - new $.zui.Messager("取消删除", { - type: "primary", // 定义颜色主题 - icon: "info-sign" // 定义消息图标 - }).show(); - } + $.post("./post_del.php", { + 'del_url_array': check_val + }, + function(data) { + if (data.search('success') > 0) { + new $.zui.Messager("删除成功", { + type: "success", // 定义颜色主题 + icon: "ok-sign" // 定义消息图标 + }).show(); + // 延时2秒刷新 + window.setTimeout(function() { + window.location.reload(); + }, 1500) + } else { + new $.zui.Messager("删除失败 请登录后再删除!", { + type: "danger", // 定义颜色主题 + icon: "exclamation-sign" // 定义消息图标 + }).show(); + // 延时2s跳转 + window.setTimeout("window.location=\'/../admin/index.php \'", 2000); + } + }); + } else { + new $.zui.Messager("取消删除", { + type: "primary", // 定义颜色主题 + icon: "info-sign" // 定义消息图标 + }).show(); + } + console.log('是否删除图片: ' + result); + } + }); } // 返回顶部 diff --git a/config/config.php b/config/config.php index 03160b6..aa1ae02 100755 --- a/config/config.php +++ b/config/config.php @@ -103,8 +103,8 @@ var _hmt = _hmt || []; 'tinyfilemanager'=>1, 'delDir'=>'thumbnails/', 'hide'=>0, - 'version'=>'2.5.8', - 'update'=>'2022-04-11 13:38:41', + 'version'=>'2.5.9', + 'update'=>'2022-04-16 13:19:50', 'terms'=>'
    diff --git a/public/static/zui/lib/bootbox/bootbox.min.css b/public/static/zui/lib/bootbox/bootbox.min.css new file mode 100755 index 0000000..4483c69 --- /dev/null +++ b/public/static/zui/lib/bootbox/bootbox.min.css @@ -0,0 +1 @@ +.bootbox.modal .modal-dialog{width:400px} \ No newline at end of file diff --git a/public/static/zui/lib/bootbox/bootbox.min.js b/public/static/zui/lib/bootbox/bootbox.min.js new file mode 100755 index 0000000..d553561 --- /dev/null +++ b/public/static/zui/lib/bootbox/bootbox.min.js @@ -0,0 +1,2 @@ +/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */ +!function(t,o){"use strict";"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof exports?module.exports=o(require("jquery")):t.bootbox=o(t.jQuery)}(this,function t(o,e){"use strict";function a(t){var e=o.zui&&o.zui.getLangData?o.zui.getLangData("bootbox",d.locale,h):h[d.locale];return e?e[t]:h.en[t]}function n(t,o,e){t.stopPropagation(),t.preventDefault();var a="function"==typeof e&&e.call(o,t)===!1;a||o.modal("hide")}function r(t){var o,e=0;for(o in t)e++;return e}function l(t,e){var a=0;o.each(t,function(t,o){e(t,o,a++)})}function c(t){var e,a;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=o.extend({},d,t),t.buttons||(t.buttons={}),e=t.buttons,a=r(e),l(e,function(t,n,r){if("function"==typeof n&&(n=e[t]={callback:n}),"object"!==o.type(n))throw new Error("button with key "+t+" must be an object");n.label||(n.label=t),n.className||(2===a&&("ok"===t||"confirm"===t)||1===a?n.className="btn-primary":n.className="btn-default")}),t}function i(t,o){var e=t.length,a={};if(e<1||e>2)throw new Error("Invalid argument length");return 2===e||"string"==typeof t[0]?(a[o[0]]=t[0],a[o[1]]=t[1]):a=t[0],a}function s(t,e,a){return o.extend(!0,{},t,i(e,a))}function u(t,o,e,a){var n={className:"bootbox-"+t,buttons:p.apply(null,o)};return b(s(n,a,e),o)}function p(){for(var t={},o=0,e=arguments.length;o
    ",header:"",footer:"",closeButton:"",form:"",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
    ",date:"",time:"",number:"",password:""}},d={locale:o.zui&&o.zui.clientLang?o.zui.clientLang():"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},m={};m.alert=function(){var t;if(t=u("alert",["ok"],["message","callback"],arguments),t.callback&&"function"!=typeof t.callback)throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return"function"!=typeof t.callback||t.callback.call(this)},m.dialog(t)},m.confirm=function(){var t;if(t=u("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},"function"!=typeof t.callback)throw new Error("confirm requires a callback");return m.dialog(t)},m.prompt=function(){var t,a,n,r,c,i,u;if(r=o(f.form),a={className:"bootbox-prompt",buttons:p("cancel","confirm"),value:"",inputType:"text"},t=b(s(a,arguments,["title","callback"]),["confirm","cancel"]),i=t.show===e||t.show,t.message=r,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var e;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":e=c.val();break;case"checkbox":var a=c.find("input:checked");e=[],l(a,function(t,a){e.push(o(a).val())})}return t.callback.call(this,e)},t.show=!1,!t.title)throw new Error("prompt requires a title");if("function"!=typeof t.callback)throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(c=o(f.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":c.val(t.value);break;case"select":var d={};if(u=t.inputOptions||[],!Array.isArray(u))throw new Error("Please pass an array of input options");if(!u.length)throw new Error("prompt with select requires options");l(u,function(t,a){var n=c;if(a.value===e||a.text===e)throw new Error("given options in wrong format");a.group&&(d[a.group]||(d[a.group]=o("").attr("label",a.group)),n=d[a.group]),n.append("")}),l(d,function(t,o){c.append(o)}),c.val(t.value);break;case"checkbox":var h=Array.isArray(t.value)?t.value:[t.value];if(u=t.inputOptions||[],!u.length)throw new Error("prompt with checkbox requires options");if(!u[0].value||!u[0].text)throw new Error("given options in wrong format");c=o("
    "),l(u,function(e,a){var n=o(f.inputs[t.inputType]);n.find("input").attr("value",a.value),n.find("label").append(a.text),l(h,function(t,o){o===a.value&&n.find("input").prop("checked",!0)}),c.append(n)})}return t.placeholder&&c.attr("placeholder",t.placeholder),t.pattern&&c.attr("pattern",t.pattern),t.maxlength&&c.attr("maxlength",t.maxlength),r.append(c),r.on("submit",function(t){t.preventDefault(),t.stopPropagation(),n.find(".btn-primary").click()}),n=m.dialog(t),n.off("shown.zui.modal"),n.on("shown.zui.modal",function(){c.focus()}),i===!0&&n.modal("show"),n},m.dialog=function(t){t=c(t);var a=o(f.dialog),r=a.find(".modal-dialog"),i=a.find(".modal-body"),s=t.buttons,u="",p={onEscape:t.onEscape};if(o.fn.modal===e)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(l(s,function(t,o){u+="",p[t]=o.callback}),i.find(".bootbox-body").html(t.message),t.animate===!0&&a.addClass("fade"),t.className&&a.addClass(t.className),"large"===t.size?r.addClass("modal-lg"):"small"===t.size&&r.addClass("modal-sm"),t.title&&i.before(f.header),t.closeButton){var b=o(f.closeButton);t.title?a.find(".modal-header").prepend(b):b.css("margin-top","-10px").prependTo(i)}return t.title&&a.find(".modal-title").html(t.title),u.length&&(i.after(f.footer),a.find(".modal-footer").html(u)),a.on("hidden.zui.modal",function(t){t.target===this&&a.remove()}),a.on("shown.zui.modal",function(){a.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&a.on("click.dismiss.zui.modal",function(t){a.children(".modal-backdrop").length&&(t.currentTarget=a.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&a.trigger("escape.close.bb")}),a.on("escape.close.bb",function(t){p.onEscape&&n(t,a,p.onEscape)}),a.on("click",".modal-footer button",function(t){var e=o(this).data("bb-handler");n(t,a,p[e])}),a.on("click",".bootbox-close-button",function(t){n(t,a,p.onEscape)}),a.on("keyup",function(t){27===t.which&&a.trigger("escape.close.bb")}),o(t.container).append(a),a.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&a.modal("show"),a},m.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],o.extend(d,t)},m.hideAll=function(){return o(".bootbox").modal("hide"),m};var h={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return m.addLocale=function(t,e){return o.each(["OK","CANCEL","CONFIRM"],function(t,o){if(!e[o])throw new Error("Please supply a translation for '"+o+"'")}),h[t]={OK:e.OK,CANCEL:e.CANCEL,CONFIRM:e.CONFIRM},m},m.removeLocale=function(t){return delete h[t],m},m.setLocale=function(t){return m.setDefaults("locale",t)},m.init=function(e){return t(e||o)},m}); \ No newline at end of file