兄弟们完工了我的这个是tt签到插件才能用sg的楼下已经有人做好了可以下载
复制粘贴到index_site_brief_before.htm文件里就可以用了
致敬 NOTEWEB-开发者创意社区
代码很粗糙需要有一定的动手能力 != 请不要购买有点掉头发
<?php $todaystart = strtotime(date('Ymd'),time()); $todayend = $todaystart+60*60*24;?>
<?php $data = db_find('sign' ,array('time'=>$todaystart ,'time'=>array('>='=>$todaystart)), array('time'=>1), $page=1, $pagesize = 5);?>
<div class="card-body py-3">
<ol class="list-unstyled mb-0">
<?php foreach($data as $k=>$v){?>
<li class="my-2">
<div class="media">
<a href="/<?php echo url("user-$v[uid]")?>"> <img class="avatar-3 mt-1 mr-2" src="<?php echo user_read_cache($v['uid'])['avatar_url'];?>">
<!-- <?php echo user_read_cache($v['uid'])['username'];?> -->
</a>
<span></span>
<div class="media-body">
<span class="sign_name">
<span class="badge badge-pill badge-primary mr-1"><?php echo $k+1;?></span>
<a href="/<?php echo url("user-$v[uid]")?>"> <?php echo user_read_cache($v['uid'])['username'];?></a>
</span>
<span class="sign_time d-block text-gray small mt-1">
<!-- echo "相差秒数:".$second."秒"; -->
<?php
$enddate = date("Y-m-d H:i:s",time());
$startdate = date("Y-m-d H:i:s",$v['time']);
$second=floor(strtotime($enddate)-strtotime($startdate));
$seconds = (int)$seconds;
$time = '';
if ($second >= 3600) {
if ($second > 86400) {
$days = (int)($seconds / 86400);
$second = $second % 86400;//取余
$time .= $days . " 天 ";
}
$hours = intval($second / 3600);
$minutes = $seconds % 3600;//取余下秒数
echo $time .= ' 签到时间:'. $hours . " 小时前 " . gmstrftime('%M 分钟 %S 秒', $minutes);
} elseif ($second >= 60) {
$hours = intval($second / 60);
$minutes = $seconds % 60;//取余下秒数
echo $time .= ' 签到时间:'. $hours . " 分钟前 " . gmstrftime('%M 分钟 %S 秒', $minutes);
} else {
echo ' 签到时间:'. $second .'秒前';
}
?>
</span>
</div>
<span class="badge text-gray mt-2 badge-light"><i class="fa fa-coins"></i> <?php echo $v['golds'];?></span>
</div>
</li>
<?php }?>
</ol>
</div>
最后于 2023-1-1
被7232708273编辑
,原因: