added option home_pic_url

This commit is contained in:
printempw 2016-03-19 15:35:16 +08:00
parent b254dc5c1e
commit 3be967b672
4 changed files with 41 additions and 9 deletions

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-03-19 14:34:21
* @Last Modified by: printempw
* @Last Modified time: 2016-03-19 15:06:36
* @Last Modified time: 2016-03-19 15:31:15
*/
require "../includes/session.inc.php";
if (!$user->is_admin) header('Location: ../index.php?msg=看起来你并不是管理员');
@ -33,7 +33,7 @@ $db = new Database\Database();
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="box box-solid">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">更改配色</h3>
</div><!-- /.box-header -->
@ -99,6 +99,35 @@ $db = new Database\Database();
</div>
<div class="col-md-6">
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">首页配置</h3>
</div><!-- /.box-header -->
<form method="post" action="customize.php">
<input type="hidden" name="option" value="adapter">
<div class="box-body">
<?php
if (isset($_POST['home_pic_url'])) {
Config::set('home_pic_url', $_POST['home_pic_url']);
echo '<div class="callout callout-success">设置已保存。</div>';
} ?>
<table class="table">
<tbody>
<tr>
<td class="key">首页图片地址</td>
<td class="value">
<input type="text" data-toggle="tooltip" data-placement="bottom" title="相对与首页的路径或绝对路径。" class="form-control" name="home_pic_url" value="<?php echo Config::get('home_pic_url'); ?>">
</td>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
<div class="box-footer">
<button type="submit" name="submit" class="btn btn-primary">提交</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: printempw
* @Last Modified time: 2016-03-19 15:20:18
* @Last Modified time: 2016-03-19 15:34:26
*
* Blessing Skin Server Installer
*/
@ -189,7 +189,8 @@ $sql3 = "INSERT INTO `$table_options` (`option_id`, `option_name`, `option_val
(10, 'data_column_uname', 'username'),
(11, 'data_column_passwd', 'password'),
(12, 'data_column_ip', 'ip'),
(12, 'color_scheme', 'skin-blue');";
(12, 'color_scheme', 'skin-blue'),
(14, 'home_pic_url', './assets/images/bg.jpg');";
if (!$conn->query($sql1) || !$conn->query($sql2) || !$conn->query($sql3)) { ?>
<h1>数据表创建失败</h1>

View File

@ -2,7 +2,7 @@
* @Author: printempw
* @Date: 2016-01-21 20:07:47
* @Last Modified by: printempw
* @Last Modified time: 2016-03-19 10:08:29
* @Last Modified time: 2016-03-19 15:33:10
*/
.home-menu-blur {
position: absolute;
@ -17,7 +17,6 @@
background-color: rgba(255,255,255,0.4);
}
.home-menu-bg {
background-image: url("../images/bg.jpg");
background-position: center 0;
background-size: auto 800px;
position: absolute;
@ -33,8 +32,6 @@
}
.container {
background-image:
url("../images/bg.jpg");
background-size: auto 800px;
background-repeat: no-repeat;
background-position: center 0;

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-17 13:55:20
* @Last Modified by: printempw
* @Last Modified time: 2016-03-18 17:47:57
* @Last Modified time: 2016-03-19 15:33:43
*/
session_start();
$dir = dirname(__FILE__);
@ -33,6 +33,11 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
<link rel="stylesheet" href="./libs/remodal/remodal.css">
<link rel="stylesheet" href="./libs/ply/ply.css">
<link rel="stylesheet" href="./libs/remodal/remodal-default-theme.css">
<style>
.home-menu-bg, .container {
background-image: url("<?php echo Config::get('home_pic_url'); ?>");
}
</style>
</head>
<body>