Skip to content

Commit

Permalink
v2.6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
icret committed Jul 10, 2022
1 parent 313ce88 commit c6cd454
Show file tree
Hide file tree
Showing 144 changed files with 353 additions and 132 deletions.
6 changes: 6 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ $HTTP["url"] =~ "^/(i|public)/" {

<details><summary>点击查看2.0版更新日志</summary>

* 2022-07-09 v2.6.6
- 增加图片信息显示随机图片
- 增加文件雪花命名
- 增加举报入口
- 更新组件

* 2022-05-27 v2.6.5
- 更改文件位置

Expand Down
25 changes: 17 additions & 8 deletions admin/admin.inc.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@
<option value="unix" <?php if ($config['imgName'] == 'unix') echo 'selected'; ?>>Unix >> 1635074840</option>
<option value="crc32" <?php if ($config['imgName'] == 'crc32') echo 'selected'; ?>>CRC32 >> 2495551279</option>
<option value="uniqid" <?php if ($config['imgName'] == 'uniqid') echo 'selected'; ?>>微秒 >> 6175436c73418</option>
<option value="source" <?php if ($config['imgName'] == 'source') echo 'selected'; ?>>源文件名 >> 微信图片_20211228214754</option>
<option value="snowflake" <?php if ($config['imgName'] == 'snowflake') echo 'selected'; ?>>雪花 >> 5357520647037653166</option>
<option value="source" <?php if ($config['imgName'] == 'source') echo 'selected'; ?>>源名 >> 微信图片_20211228214754</option>
<option value="md5" <?php if ($config['imgName'] == 'md5') echo 'selected'; ?>>MD5 >> 3888aa69eb321a2b61fcc63520bf6c82</option>
<option value="sha1" <?php if ($config['imgName'] == 'sha1') echo 'selected'; ?>>SHA1 >> 654faac01499e0cb5fb0e9d78b21e234c63d842a</option>
<option value="guid" <?php if ($config['imgName'] == 'guid') echo 'selected'; ?>>全局唯一标识符 >> 6EDAD0CC-AB0C-4F61-BCCA-05FAD65BF0FA</option>
Expand Down Expand Up @@ -780,7 +781,7 @@
<a href="https://github.com/verot/class.upload.php" target="_blank"><span class="label label-badge label-success" data-toggle="tooltip" title="文件管理">Tinyfilemanager</span></a>
<span class="label label-badge label-success" data-toggle="tooltip" title="当前版本"><?php echo get_current_verson(); ?></span>
<?php if (getVersion() !== get_current_verson()) : ?>
<a href="#NewVersion" data-toggle="collapse" class="label label-badge label-warning" title="Github有更新"><?php echo getVersion(); ?> New</span></a>
<a href="#NewVersion" data-toggle="collapse" class="label label-badge label-warning" title="Github有更新"><?php echo getVersion(); ?></span><i class="icon icon-angle-down"></i></a>
<?php endif; ?>
<a href="https://github.com/icret/EasyImages2.0/blob/master/LICENSE" target="_blank"><span class="label label-badge" data-toggle="tooltip" title="许可证">GPL-2.0</span></a>
</p>
Expand Down Expand Up @@ -842,16 +843,21 @@
<input type="checkbox" name="showSort" value="1" <?php if ($config['showSort']) echo 'checked="checked"'; ?>>
<label style="font-weight: bold">排序</label>
</div>
<div class="switch switch-inline" data-toggle="tooltip" title="广场图片详细信息按钮">
<input type="hidden" name="show_exif_info" value="0">
<input type="checkbox" name="show_exif_info" value="1" <?php if ($config['show_exif_info']) echo 'checked="checked"'; ?>>
<label style="font-weight: bold">详息</label>
</div>
<div class="switch switch-inline" data-toggle="tooltip" title="图片过多时可能会影响统计时间">
<input type="hidden" name="chart_on" value="0">
<input type="checkbox" name="chart_on" value="1" <?php if ($config['chart_on']) echo 'checked="checked"'; ?>>
<label style="font-weight: bold">统计</label>
</div>
<div class="switch switch-inline" data-toggle="tooltip" title="广场图片详细信息按钮">
<input type="hidden" name="show_exif_info" value="0">
<input type="checkbox" name="show_exif_info" value="1" <?php if ($config['show_exif_info']) echo 'checked="checked"'; ?>>
<label style="font-weight: bold">详情页</label>
</div>
<div class="switch switch-inline" data-toggle="tooltip" title="图片详细信息显示随机图片">
<input type="hidden" name="info_rand_pic" value="0">
<input type="checkbox" name="info_rand_pic" value="1" <?php if ($config['info_rand_pic']) echo 'checked="checked"'; ?>>
<label style="font-weight: bold">随机图片</label>
</div>
</div>
<div class="form-group">
<label data-toggle="tooltip" title="暂支持中文简繁体转换">界面语言</label>
Expand Down Expand Up @@ -880,7 +886,10 @@
<input type="text" class="form-control" id="login_bg" name="login_bg" value="<? if ($config['login_bg']) echo $config['login_bg']; ?>" required="required" placeholder="图片地址可以是相对路径或网址" onkeyup="this.value=this.value.replace(/\s/g,'')">
</div>
<div class="form-group">

<label for="report" data-toggle="tooltip" title="举报图片链接网址 (推荐ZOHO)<br/>留空则不显示">举报链接 | <a href="https://store.zoho.com.cn/referral.do?servicename=ZohoForms&category=ZohoForms&ref=52f8a4e98a7a7d4c2475713784605af0dc842f6cc9732dd77f37b87f2959149e212e550f50a869f70360f15b80a4abc6" target="_blank">申请</a></label>
<input type="text" class="form-control" id="report" name="report" value="<? if ($config['report']) echo $config['report']; ?>" placeholder="可以是网址或邮箱" onkeyup="this.value=this.value.replace(/\s/g,'')">
</div>
<div class="form-group">
<div class="col-md-9">
<label data-toggle="tooltip" title="可在网址后填写参数更改预览数量 eg: /list.php?num=3">广场默认浏览数量 | 当前: </label>
<label id="listNumber"><?php echo $config['listNumber']; ?>张</label>
Expand Down
Empty file modified admin/chart.php
100644 → 100755
Empty file.
Empty file modified admin/index.php
100644 → 100755
Empty file.
Empty file modified admin/manager.php
100644 → 100755
Empty file.
Empty file modified admin/terms.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion admin/verson.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
2.6.6
Empty file modified admin/zui.chart.php
100644 → 100755
Empty file.
Empty file modified api/index.php
100644 → 100755
Empty file.
Empty file modified api/public.php
100644 → 100755
Empty file.
Empty file modified application/TimThumb.php
100644 → 100755
Empty file.
Empty file modified application/WaterMask.php
100644 → 100755
Empty file.
Empty file modified application/captcha.php
100644 → 100755
Empty file.
Empty file modified application/chart.php
100644 → 100755
Empty file.
Empty file modified application/check.php
100644 → 100755
Empty file.
Empty file modified application/check_admin.inc.php
100644 → 100755
Empty file.
45 changes: 45 additions & 0 deletions application/class.snowflake.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/**
* 分布式 id 生成类 组成: <毫秒级时间戳+机器id+序列号>
* 默认情况下41bit的时间戳可以支持该算法使用到2082年,10bit的工作机器id可以支持1023台机器,序列号支持1毫秒产生4095个自增序列id
* @author zhangqi
* @link https://www.cnblogs.com/njccqx/p/13402169.html
*/
class SnowFlake
{
const EPOCH = 1479533469598; //开始时间,固定一个小于当前时间的毫秒数
const max12bit = 4095;
const max41bit = 1099511627775;

static $machineId = 1; // 机器id

public static function machineId($mId = 0)
{
self::$machineId = $mId;
}

public static function createOnlyId()
{
// 时间戳 42字节
$time = floor(microtime(true) * 1000);
// 当前时间 与 开始时间 差值
$time -= self::EPOCH;
// 二进制的 毫秒级时间戳
$base = decbin(self::max41bit + $time);
// 机器id 10 字节
if (!self::$machineId) {
$machineid = self::$machineId;
} else {
$machineid = str_pad(decbin(self::$machineId), 10, "0", STR_PAD_LEFT);
}
// 序列数 12字节
$random = str_pad(decbin(mt_rand(0, self::max12bit)), 12, "0", STR_PAD_LEFT);
// 拼接
$base = $base . $machineid . $random;
// 转化为 十进制 返回
return bindec($base);
}
}
// SnowFlake::machineId("1"); //机器编号
// echo SnowFlake::createOnlyId();//分布式id
Empty file modified application/class.thumb.php
100644 → 100755
Empty file.
Loading

0 comments on commit c6cd454

Please sign in to comment.