方法
打开 /usr/themes/handsome/comment/sidebar.php 文件,然后大约在132行左右
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.1/css/all.min.css"rel="stylesheet">
<?php
$online_log = "slzxrs.dat";
$timeout = 30;
$entries = file($online_log);
$temp = array();
for ($i=0;$i<count($entries);$i++){
$entry = explode(",",trim($entries[$i]));
if(($entry[0] != getenv('REMOTE_ADDR')) && ($entry[1] > time())) {
array_push($temp,$entry[0].",".$entry[1]."\n");
}
}
array_push($temp,getenv('REMOTE_ADDR').",".(time() + ($timeout))."\n");
$slzxrs = count($temp);
$entries = implode("",$temp);
$fp = fopen($online_log,"w");
flock($fp,LOCK_EX);
fputs($fp,$entries);
flock($fp,LOCK_UN);
fclose($fp);
$tj=$slzxrs."人";
?>
<li class="list-group-item text-second">
<i class="fa fa-user"aria-hidden="true" style="margin-right:5px"></i>
<span class="badge
pull-right"><?php echo $tj?></span>在线人数
</li>
把上面的代码添加进去就可以了