优化 后台设置

This commit is contained in:
LyLme 2024-01-09 11:12:18 +08:00
parent 4f6579764f
commit 1c466599b7
2 changed files with 354 additions and 354 deletions

View File

@ -9,8 +9,8 @@ var_export($update,true);
$content = "<?php\nreturn " . var_export($update, true) . "\n?>";
file_put_contents('cache.php', $content);
}
$mysqlversion=$DB->count("select VERSION()");
function tjsj($tjname) {
function tjsj($tjname)
{
if ($tjname == '') {
echo '0';
} else {
@ -139,7 +139,7 @@ if($applyrows>0) {
?>
</li>
<li class="list-group-item">
<b>MySQL 版本:</b><?php echo $mysqlversion ?>
<b>MySQL 版本:</b><?php echo $DB->count("select VERSION()") ?>
</li>
<li class="list-group-item">
<b>服务器软件:</b><?php echo $_SERVER['SERVER_SOFTWARE'] ?>
@ -147,6 +147,10 @@ if($applyrows>0) {
<li class="list-group-item">
<b>程序名称:</b>六零导航页(LyLme Spage)
</li>
<li class="list-group-item">
<b>授权状态:</b>
<a href="https://www.lylme.com/spage/" target="_blank">查询</a>
</li>
<li class="list-group-item">
<b>建站日期:</b><?php echo $conf['build'] ?>
</li>
@ -154,13 +158,13 @@ if($applyrows>0) {
<b>当前版本:</b><?php echo $conf['version'] ?> <a href="./update.php" target="_blank">检查更新</a>
</li>
<li class="list-group-item">
<b>最新版本:</b> <?php echo $update['version']?> <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank">查看更新说明</a>
<b>最新版本:</b> <?php echo $update['version'] ?> <a href="https://doc.lylme.com/spage/#/logs target=" _blank">更新日志</a>
</li>
<li class="list-group-item">
<b>项目作者:</b>六零 <a href="https://www.lylme.com/support/" target="_blank">捐赠作者</a>
</li>
<li class="list-group-item">
<b>项目地址:</b>https://github.com/LyLme/lylme_spage
<b>项目地址:</b><a href="https://github.com/LyLme/lylme_spage" target="_blank">https://github.com/LyLme/lylme_spage</a>
</li>
</ul>
</div>
@ -179,7 +183,7 @@ $(document).ready(function(e) {
var $dashChartBarsCnt = jQuery('.js-chartjs-bars')[0].getContext('2d'),
$dashChartLinesCnt = jQuery('.js-chartjs-lines')[0].getContext('2d');
var $dashChartBarsData = {
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览', '链接数', '分组数'],
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览'],
datasets: [{
label: '数量',
borderWidth: 1,
@ -191,43 +195,32 @@ $(document).ready(function(e) {
?>, <?php echo $tjyesterday;
?>, <?php echo $tjmonth;
?>, <?php echo $tjtotal;
?>, <?php echo $linksrows;
?>, <?php echo $groupsrows;
?>]
}
]
}
;
}]
};
var $dashChartLinesData = {
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览', '链接数', '分组数'],
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览'],
datasets: [{
label: '数量',
data: [<?php echo $tjtoday;
?>, <?php echo $tjyesterday;
?>, <?php echo $tjmonth;
?>, <?php echo $tjtotal;
?>,<?php echo $linksrows;
?>, <?php echo $groupsrows;
?>],
borderColor: '#358ed7',
backgroundColor: 'rgba(53, 142, 215, 0.175)',
borderWidth: 1,
fill: false,
lineTension: 0
}
]
}
;
}]
};
new Chart($dashChartBarsCnt, {
type: 'bar',
data: $dashChartBarsData
}
);
});
var myLineChart = new Chart($dashChartLinesCnt, {
type: 'line',
data: $dashChartLinesData,
}
);
}
);
});
});
</script>

View File

@ -1,7 +1,8 @@
<?php
$title = '网站设置';
include './head.php';
function uploadimg($arr,$uppath,$uptype) {
function uploadimg($arr, $uppath, $uptype)
{
if ((($arr["type"] == "image/jpeg") || ($arr["type"] == "image/jpg") || ($arr["type"] == "image/png")) && $arr["size"] < 10485760) {
copy($arr["tmp_name"], ROOT . $uppath);
saveSetting($uptype, '/' . $uppath);
@ -46,9 +47,9 @@ if($set=='save') {
saveSetting('wztj', $wztj);
saveSetting('cdnpublic', $cdnpublic);
saveSetting('home-title', $home_title);
uploadimg($_FILES["logoimg"],'assets/img/logo.png','logo');
uploadimg($_FILES["wapbackgroundimg"],'assets/img/wapbackground.jpg','wap_background');
uploadimg($_FILES["backgroundimg"],'assets/img/background.jpg','background');
uploadimg($_FILES["logoimg"], 'assets/img/web-logo.png', 'logo');
uploadimg($_FILES["wapbackgroundimg"], 'assets/img/web-wapbackground.jpg', 'wap_background');
uploadimg($_FILES["backgroundimg"], 'assets/img/web-background.jpg', 'background');
echo '<script>alert("修改成功!");window.location.href="./set.php";</script>';
} else {
?>
@ -79,7 +80,7 @@ if($set=='save') {
<input type="file" style="display:none" accept=".png,.jpeg,.jpg" id="logoimg" name="logoimg" onclick="updatetext('checklogo');" />
</div>
</div>
<small class="help-block">填写图片的URL默认值<code>./assets/img/logo.png</code><code><?php echo siteurl()?>/assets/img/logo.png</code>或从<code>本地上传</code></small>
<small class="help-block">比例1:1(正方形),可填写图片的URL默认值<code>./assets/img/logo.png</code><code><?php echo siteurl() ?>/assets/img/logo.png</code>或从<code>本地上传</code></small>
</div>
<div class="form-group">
<label for="web_site_background">网站背景</label>
@ -88,7 +89,8 @@ if($set=='save') {
<div class="input-group-btn">
<label class="btn btn-default" id="checkbackground" for="backgroundimg" type="button">选择图片</label>
<input type="file" style="display:none" accept="image/png,image/jpeg" id="backgroundimg" name="backgroundimg" onclick="updatetext('checkbackground');" />
</div></div>
</div>
</div>
<small class="help-block">填写图片的URL<code>./assets/img/background.jpg</code><code><?php echo siteurl() ?>/assets/img/background.jpg</code>或从<code>本地上传</code><br>设置Bing每日壁纸<a href="https://doc.lylme.com/spage/#/%E8%83%8C%E6%99%AF%E8%AE%BE%E7%BD%AE" target="_blank">查看教程</a><br>注:修改后需要清除浏览器缓存才会改变</small>
</div>
<div class="form-group">
@ -98,7 +100,8 @@ if($set=='save') {
<div class="input-group-btn">
<label class="btn btn-default" id="checkwapbackground" for="wapbackgroundimg" type="button">选择图片</label>
<input type="file" style="display:none" accept="image/png,image/jpeg" id="wapbackgroundimg" name="wapbackgroundimg" onclick="updatetext('checkwapbackground');" />
</div></div>
</div>
</div>
<small class="help-block">手机端独立背景留空则使用PC端壁纸<br>:修改后需要清除浏览器缓存才会改变</small>
</div>
<div class="form-group">
@ -133,7 +136,9 @@ if($set=='save') {
<div class="form-group">
<label class="btn-block" for="web_yan_status">随机一言开关</label>
<label class="lyear-switch switch-solid switch-cyan">
<input type="checkbox" <?php if($conf['yan']!='false')echo 'checked="checked"';?> name="yan" value="true">
<input type="checkbox" <?php if ($conf['yan'] != 'false') {
echo 'checked="checked"';
} ?> name="yan" value="true">
<span></span>
</label>
<small class="help-block">显示在首页的随机一言,自定义一言文件路径,一行一条<code>/assets/date/date.dat</code> </small>
@ -141,7 +146,9 @@ if($set=='save') {
<div class="form-group">
<label class="btn-block" for="web_tq_status">天气显示开关</label>
<label class="lyear-switch switch-solid switch-primary">
<input type="checkbox" <?php if($conf['tq']!='false')echo 'checked="checked"';?> name="tq" value="true">
<input type="checkbox" <?php if ($conf['tq'] != 'false') {
echo 'checked="checked"';
} ?> name="tq" value="true">
<span></span>
</label>
<small class="help-block">和风天气插件,若不能使用请申请自己的密钥填入,<a href="https://doc.lylme.com/spage/#/%E5%A4%A9%E6%B0%94" target="_blank">查看教程</a><br><code>baisu模板关闭后同时关闭时间显示</code> </small>