diff --git a/README.md b/README.md index 0a28e61..58868b1 100755 --- a/README.md +++ b/README.md @@ -103,10 +103,14 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 -* 2022-2-13 v2.5.1 -- 异步执行鉴黄 -- 取消检测imagick扩展 +* 2022-2-19 v2.5.2 Developing +- 增加简繁体转换 +- 增加管理页面记录当前操作页 - 修复一处暴露路径bug + +* 2022-2-13 v2.5.1 +- 增加异步执行鉴黄 +- 取消检测imagick扩展 - 修复可能导致检测弹窗弹出失败 * 2022-2-7 v2.5.0 diff --git a/admin/admin.inc.php b/admin/admin.inc.php index f5b24f6..a8eba6b 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -138,20 +138,20 @@ if (isset($_GET['reimg'])) {
-
+
@@ -572,27 +572,26 @@ if (isset($_GET['reimg'])) { $cache_dir = APP_ROOT . $config['path'] . 'suspic/'; // cache目录 $cache_file = get_file_by_glob($cache_dir . '*.*'); // 获取所有文件 @$cache_num = count($cache_file); // 统计目录文件个数 - for ($i = 0; $i < $cache_num and $i < 21; $i++) { // 循环输出文件 + for ($i = 0; $i < $cache_num and $i < 21; $i++) : // 循环输出文件 $file_cache_path = APP_ROOT . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片绝对路径 $file_path = $config['path'] . 'suspic/' . $cache_file[$i]; // 图片相对路径 @$file_size = getDistUsed(filesize($file_cache_path)); // 图片大小 @$filen_name = $cache_file[$i]; // 图片名称 $url = $config['imgurl'] . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片网络连接 $unlink_img = $config['domain'] . '/application/del.php?url=' . $url; // 图片删除连接 - echo ' + ?> - ' . $i . ' - - ' . $filen_name . ' - ' . $file_size . ' + + + + - 新窗口 - 恢复 - 删除 + 新窗口 + 恢复 + 删除 - '; - } ?> +
@@ -661,6 +660,13 @@ if (isset($_GET['reimg'])) {
+
+ + +
上传后首选显示链接
-
+
>
-
-
- - > - -
-
-
-
- - > - -
-
@@ -713,12 +705,27 @@ if (isset($_GET['reimg'])) {
-
+
> - +
+
+
+ + > + +
+
+
+
+ + > + +
+
+
@@ -799,15 +806,13 @@ if (isset($_GET['reimg'])) { - $value) { - echo " - - $key - $value - 删除 - "; - } ?> + $value) : ?> + + + + 删除 + +
@@ -819,8 +824,30 @@ if (isset($_GET['reimg'])) { - + +
-
diff --git a/application/footer.php b/application/footer.php index f503cd3..1b88d30 100755 --- a/application/footer.php +++ b/application/footer.php @@ -40,6 +40,9 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告

- \ No newline at end of file diff --git a/application/header.php b/application/header.php index 83037e3..b81b201 100755 --- a/application/header.php +++ b/application/header.php @@ -30,7 +30,7 @@ - + diff --git a/config/config.php b/config/config.php index df4b8bc..7c9efaa 100755 --- a/config/config.php +++ b/config/config.php @@ -1,11 +1,11 @@ -'简单图床 - EasyImage', 'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制', 'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序,最新html5自适应页面兼容手机电脑,上传后返回图片直链,markdown图片,论坛贴图bbscode链接,简单方便支持一键复制,支持多域名,api上传。', - 'tips'=>'
  • 单文件≤10M,单次上传≤30张
  • - 简单图床是一款开源图床, 支持多文件上传无数据库 + 'tips'=>'
  • 单文件≤10M,单次上传≤30张
  • + 简单图床是一款开源图床, 支持多文件上传无数据库 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧', 'domain'=>'http://127.0.0.1', 'imgurl'=>'http://127.0.0.1', @@ -47,25 +47,25 @@ $config=Array 'checkImg_value'=>50, 'moderatecontent_key'=>'', 'nsfwjs_url'=>'', - 'footer'=>'请勿上传违反中国政策的图片 -', 'ad_top'=>0, - 'ad_top_info'=>' -
    - + 'ad_top_info'=>' +
    +
    ', 'ad_bot'=>0, - 'ad_bot_info'=>'
    - 打赏作者 - 打赏作者 + 'ad_bot_info'=>'', 'showSwitch'=>1, 'showSort'=>1, @@ -81,6 +81,7 @@ var _hmt = _hmt || []; 'check_ip'=>0, 'check_ip_model'=>0, 'check_ip_list'=>'', - 'version'=>'2.5.1', - 'update'=>'2022-02-18 00:23:07' + 'language'=>0, + 'version'=>'2.5.2 dev', + 'update'=>'2022-02-19 13:59:41' ); \ No newline at end of file diff --git a/index.php b/index.php index c6360aa..70726e9 100755 --- a/index.php +++ b/index.php @@ -153,4 +153,5 @@ mustLogin(); })(); 0x3400 && code < 0x9FC3) || (code > 0xF900 && code < 0xFA6A); + + if (!isChinese) { + result += letter; + continue; + } + + index = src.indexOf(letter); + + if (index !== -1) { + result += des.charAt(index); + } else { + result += letter; + } + } + + return result; + } + + /** + * 转换HTML Element属性 + * @param {Element} element - 待转换的HTML Element节点 + * @param {String|Array} attr - 待转换的属性/属性列表 + * @param {Boolean} toT - 是否转换成繁体 + */ + function tranAttr(element, attr, toT) { + var i, attrValue; + + if (attr instanceof Array) { + for(i = 0; i < attr.length; i++) { + tranAttr(element, attr[i], toT); + } + } else { + attrValue = element.getAttribute(attr); + + if (attrValue !== "" && attrValue !== null) { + element.setAttribute(attr, tranStr(attrValue, toT)); + } + } + } + + /** + * 转换HTML Element节点 + * @param {Element} element - 待转换的HTML Element节点 + * @param {Boolean} toT - 是否转换成繁体 + */ + function tranElement(element, toT) { + var i; + var childNodes; + + if (element.nodeType !== 1) { + return; + } + + childNodes = element.childNodes; + + for (i = 0; i < childNodes.length; i++) { + var childNode = childNodes.item(i); + + // 若为HTML Element节点 + if (childNode.nodeType === 1) { + // 对以下标签不做处理 + if ("|BR|HR|TEXTAREA|SCRIPT|OBJECT|EMBED|".indexOf("|" + childNode.tagName + "|") !== -1) { + continue; + } + + tranAttr(childNode, ['title', 'data-original-title', 'alt', 'placeholder'], toT); + + // input 标签 + // 对text类型的input输入框不做处理 + if (childNode.tagName === "INPUT" + && childNode.value !== "" + && childNode.type !== "text" + && childNode.type !== "hidden") + { + childNode.value = tranStr(childNode.value, toT); + } + + // 继续递归调用 + tranElement(childNode, toT); + } else if (childNode.nodeType === 3) { // 若为文本节点 + childNode.data = tranStr(childNode.data, toT); + } + } + } + + // 扩展jQuery全局方法 + $.extend({ + /** + * 文本简转繁 + * @param {String} str - 待转换的文本 + * @returns {String} 转换结果 + */ + s2t: function(str) { + return tranStr(str, true); + }, + + /** + * 文本繁转简 + * @param {String} str - 待转换的文本 + * @returns {String} 转换结果 + */ + t2s: function(str) { + return tranStr(str, false); + } + }); + + // 扩展jQuery对象方法 + $.fn.extend({ + /** + * jQuery Objects简转繁 + * @this {jQuery Objects} 待转换的jQuery Objects + */ + s2t: function() { + return this.each(function() { + tranElement(this, true); + }); + }, + + /** + * jQuery Objects繁转简 + * @this {jQuery Objects} 待转换的jQuery Objects + */ + t2s: function() { + return this.each(function() { + tranElement(this, false); + }); + } + }); +}) (jQuery); diff --git a/public/static/jquery/jquery.cookie.js b/public/static/jquery/jquery.cookie.js new file mode 100755 index 0000000..c7f3a59 --- /dev/null +++ b/public/static/jquery/jquery.cookie.js @@ -0,0 +1,117 @@ +/*! + * jQuery Cookie Plugin v1.4.1 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2013 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // CommonJS + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function encode(s) { + return config.raw ? s : encodeURIComponent(s); + } + + function decode(s) { + return config.raw ? s : decodeURIComponent(s); + } + + function stringifyCookieValue(value) { + return encode(config.json ? JSON.stringify(value) : String(value)); + } + + function parseCookieValue(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape... + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + + try { + // Replace server-side written pluses with spaces. + // If we can't decode the cookie, ignore it, it's unusable. + // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); + return config.json ? JSON.parse(s) : s; + } catch(e) {} + } + + function read(s, converter) { + var value = config.raw ? s : parseCookieValue(s); + return $.isFunction(converter) ? converter(value) : value; + } + + var config = $.cookie = function (key, value, options) { + + // Write + + if (value !== undefined && !$.isFunction(value)) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setTime(+t + days * 864e+5); + } + + return (document.cookie = [ + encode(key), '=', stringifyCookieValue(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // Read + + var result = key ? undefined : {}; + + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling $.cookie(). + var cookies = document.cookie ? document.cookie.split('; ') : []; + + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = decode(parts.shift()); + var cookie = parts.join('='); + + if (key && key === name) { + // If second argument (value) is a function it's a converter... + result = read(cookie, value); + break; + } + + // Prevent storing a cookie that we couldn't decode. + if (!key && (cookie = read(cookie)) !== undefined) { + result[name] = cookie; + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + if ($.cookie(key) === undefined) { + return false; + } + + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); + }; + +}));