增加 手机端背景设置

This commit is contained in:
LyLme 2022-05-02 22:07:01 +08:00
parent a0e8d530d4
commit 1946f2ff5f
2 changed files with 94 additions and 43 deletions

View File

@ -15,6 +15,7 @@ if($set=='save') {
$title=$_POST['title'];
$logo=$_POST['logo'];
$background=$_POST['background'];
$wapbackground=$_POST['wapbackground'];
$keywords=$_POST['keywords'];
$description=$_POST['description'];
$copyright=$_POST['copyright'];
@ -22,8 +23,6 @@ if($set=='save') {
$yan=$_POST['yan'];
$tq=$_POST['tq'];
$wztj=$_POST['wztj'];
$template=$_POST['template'];
$apply=$_POST['apply'];
$cdnpublic=$_POST['cdnpublic'];
$home_title= $_POST['home-title'];
if($yan=='true') {
@ -39,16 +38,16 @@ if($set=='save') {
saveSetting('title',$title);
saveSetting('logo',$logo);
saveSetting('background',$background);
saveSetting('wap_background',$wapbackground);
saveSetting('keywords',$keywords);
saveSetting('description',$description);
saveSetting('copyright',$copyright);
saveSetting('icp',$icp);
saveSetting('wztj',$wztj);
saveSetting('apply',$apply);
saveSetting('template',$template);
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');
echo '<script>alert("修改成功!");window.location.href="./set.php";</script>';
} else {
@ -82,6 +81,9 @@ if($set=='save') {
</div>
<small class="help-block">填写图片的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>
<div class="input-group">
@ -90,8 +92,28 @@ if($set=='save') {
<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>
<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://blog.lylme.com/archives/lylme_spage.html#bing" target="_blank">查看教程</a></small>
<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></small>
</div>
<div class="form-group">
<label for="wap_site_background">手机端背景图片</label>
<div class="input-group">
<input type="text" class="form-control" name="wapbackground" accept="image/png,image/jpeg" id="wap_site_background" value="<?php echo $conf['wap_background']?>" />
<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>
<small class="help-block">留空则使用PC端壁纸</small>
</div>
<div class="form-group">
<label for="web_site_keywords">站点关键词</label>
<input class="form-control" type="text" id="web_site_keywords" name="keywords" value="<?php echo $conf['keywords']?>" placeholder="请输入站点关键词" >
@ -102,66 +124,37 @@ if($set=='save') {
<textarea class="form-control" id="web_site_description" rows="5" name="description" placeholder="请输入站点描述" ><?php echo $conf['description']?></textarea>
<small class="help-block">网站描述,有利于搜索引擎抓取相关信息</small>
</div>
<div class="form-group" id='apply'>
<label class="btn-block" for="web_yan_status">申请收录</label>
<label class="lyear-switch switch-solid switch-cyan">
<select class="form-control" name="apply">';
<option <?php if($conf['apply'] == 0) echo 'selected="selected"'; ?> value="0">开启-需要审核</option>
<option <?php if($conf['apply'] == 1) echo 'selected="selected"'; ?> value="1">开启-无需审核</option>
<option <?php if($conf['apply'] == 2) echo 'selected="selected"'; ?> value="2">关闭-关闭申请</option>
</select>
</label>
<small class="help-block">申请收录开关,地址:<code><?php echo siteurl()?>/apply</code>前往<a href="/apply" target="_blank">申请收录</a>提交页</small>
</div>
<div class="form-group">
<label for="web_site_home-title">首页提示语</label>
<textarea type="text" class="form-control" name="home-title" placeholder="请输入首页提示语支持HTML代码"><?php echo $conf['home-title']?></textarea>
<small class="help-block">首页提示语:<code>支持HTML代码</code> <a href="https://blog.lylme.com/archives/lylme_spage.html#hometitle" target="_blank">查看效果演示</a></small>
<small class="help-block">首页提示语:<code>支持HTML代码</code> 仅适用于部分主题</small>
</div>
<div class="form-group">
<label for="web_site_copyright">底部版权</label>
<textarea type="text" class="form-control" name="copyright" placeholder="请输入版权信息支持HTML代码"><?php echo $conf['copyright']?></textarea>
<label for="web_site_copyright">版权信息</label>
<textarea width="200px" type="text" class="form-control" name="copyright" placeholder="请输入版权信息支持HTML代码"><?php echo $conf['copyright']?></textarea>
<small class="help-block">显示在首页底部的版权提示,<code>支持HTML代码</code></small>
</div>
<div class="form-group">
<label for="web_site_wztj">统计代码</label>
<textarea type="text" class="form-control" name="wztj" placeholder="请输入网站统计代码支持HTML代码"><?php echo $conf['wztj']?></textarea>
<small class="help-block">网站统计代码,<code>支持HTML代码</code> <a href="https://blog.lylme.com/archives/lylme_spage.html#wztj" target="_blank">查看教程</a></small>
<label for="web_site_wztj">自定义footer</label>
<textarea type="text" class="form-control" name="wztj" placeholder="可填写网站统计、引用JS文件等"><?php echo $conf['wztj']?></textarea>
<small class="help-block">站点底部自定义可填写网站统计、引用JS文件等<code>支持HTML代码</code> <a href="https://doc.lylme.com/spage/#/footer" target="_blank">查看教程</a></small>
</div>
<div class="form-group">
<label for="web_site_icp">备案号</label>
<input class="form-control" type="text" id="web_site_icp" name="icp" value="<?php echo $conf['icp']?>" placeholder="请输入备案号,留空首页不显示备案信息" >
</div>
<div class="form-group">
<label class="btn-block" for="web_yan_status">模板设置</label>
<label class="lyear-switch switch-solid switch-cyan">
<select class="form-control" name="template">';
<?php
$tlpath = ROOT.'template/';
$tls = glob( $tlpath."*", GLOB_ONLYDIR);
foreach($tls as $tl) {
$tl = str_replace($tlpath,"",$tl);
echo'<option ';
if($conf['template'] == $tl) echo 'selected="selected"';
echo 'value="'.$tl.'">'.$tl.'</option>';
}
?>
</select>
</label>
</div>
<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>
</div>
<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>
</div>

58
admin/theme.php Normal file
View File

@ -0,0 +1,58 @@
<?php
$title = '主题设置';
include './head.php';
$set=isset($_GET['set'])?$_GET['set']:null;
if(!empty($set)) {
if(saveSetting('template',$set)) {
exit('<script>alert("主题修改成功!");window.location.href="./theme.php";</script>');
} else {
exit('<script>alert("主题修改失败!");window.location.href="./theme.php";</script>');
}
}
?>
<main class="lyear-layout-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header"><h4>主题设置</h4></div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th width="35%">截图</th>
<th>详情</th>
<th>选择</th>
</tr>
</thead>
<tbody>
<?php
$theme_path = ROOT.'template/';
$themes = glob($theme_path."*", GLOB_ONLYDIR);
foreach($themes as $theme) {
$theme = str_replace($theme_path ,"" , $theme);
echo'<tr>
<td><img src="https://cdn.lylme.com/lylme_spage/themes/'.$theme.'.jpg" alt="'.$theme.'" width="500px"></td>
<td><h3>'.$theme.'</h3>
<p>';
echo @file_get_contents( $theme_path.$theme.'/theme.ini');
echo '</p><a href="https://doc.lylme.com/spage/#/%E4%B8%BB%E9%A2%98?id='.$theme.'" target="_blank">查看主题说明</a></td>';
if($conf['template'] == $theme) {
echo '<td><p class="btn btn-default disabled">当前使用</p></td>';
} else {
echo '<td><a href="./theme.php?set='.$theme.'" class="btn btn-label btn-primary"><label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>使用</a></td>';
}
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<?php
include './footer.php';
?>