summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xlibs/Options.php127
2 files changed, 65 insertions, 64 deletions
diff --git a/README.md b/README.md
index 1496805..425993b 100644
--- a/README.md
+++ b/README.md
@@ -205,7 +205,7 @@ $ git clone https://github.com/BigCoke233/miracles.git
## 🎁 捐助
-你可以通过[爱发电](https://afdian.net/@Eltrac)向我投食,~~用金钱催更~~。
+你可以通过[爱发电](https://afdian.net/@Eltrac)向我投食,~~用金钱催更~~;或是在 [Open Collective](https://opencollective.com/miracles) 上为 Miracles 进行捐献
---
diff --git a/libs/Options.php b/libs/Options.php
index 27f5265..ed2fce5 100755
--- a/libs/Options.php
+++ b/libs/Options.php
@@ -15,32 +15,32 @@ function themeConfig($form) {
$sjdq=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name));
$ysj = $sjdq['value'];
if(isset($_POST['type'])){
- if($_POST["type"]=="备份模板设置数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:'.$name.'bf');
- $updateRows= $db->query($update);
- }else{
- if($ysj){
- $insert = $db->insert('table.options')
- ->rows(array('name' => 'theme:'.$name.'bf','user' => '0','value' => $ysj));
- $insertId = $db->query($insert);
- }
- }
- }
- if($_POST["type"]=="还原模板设置数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'));
- $bsj = $sjdub['value'];
- $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:'.$name);
- $updateRows= $db->query($update);
- }
- }
- if($_POST["type"]=="删除备份数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- $delete = $db->delete('table.options')->where ('name = ?', 'theme:'.$name.'bf');
- $deletedRows = $db->query($delete);
- }
- }
+ if($_POST["type"]=="备份模板设置数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:'.$name.'bf');
+ $updateRows= $db->query($update);
+ }else{
+ if($ysj){
+ $insert = $db->insert('table.options')
+ ->rows(array('name' => 'theme:'.$name.'bf','user' => '0','value' => $ysj));
+ $insertId = $db->query($insert);
+ }
+ }
+ }
+ if($_POST["type"]=="还原模板设置数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'));
+ $bsj = $sjdub['value'];
+ $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:'.$name);
+ $updateRows= $db->query($update);
+ }
+ }
+ if($_POST["type"]=="删除备份数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ $delete = $db->delete('table.options')->where ('name = ?', 'theme:'.$name.'bf');
+ $deletedRows = $db->query($delete);
+ }
+ }
}
/**
@@ -64,45 +64,46 @@ function themeConfig($form) {
<input type="submit" name="type" class="miracles-backup-button" value="还原模板设置数据" />&nbsp;&nbsp;
<input type="submit" name="type" class="miracles-backup-button" value="删除备份数据" />
</form>';
- //备份数据提示
- if($_POST["type"]=="备份模板设置数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- echo '<div class="tongzhi col-mb-12 home">备份已更新,请等待自动刷新!如果等不到请点击';
- ?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
-<script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
- }else{
- echo '<div class="tongzhi col-mb-12 home">备份完成,请等待自动刷新!如果等不到请点击';
-?> <a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
-<script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
- }
- }
- //还原数据提示
- if($_POST["type"]=="还原模板设置数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- echo '<div class="tongzhi col-mb-12 home">检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击';
- ?> <a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
-<script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script>
-<?php
- }else{
- echo '<div class="tongzhi col-mb-12 home">没有模板备份数据,恢复不了哦!</div>';
- }
- }
- //删除数据提示
- if($_POST["type"]=="删除备份数据"){
- if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
- echo '<div class="tongzhi col-mb-12 home">删除成功,请等待自动刷新,如果等不到请点击';
-?>
-<a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
-<script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script>
-<?php
- }else{
- echo '<div class="tongzhi col-mb-12 home">备份已经被删除了</div>';
- ?><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
- }
+ if(isset($_POST['type'])){
+ //备份数据提示
+ if($_POST["type"]=="备份模板设置数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ echo '<div class="tongzhi col-mb-12 home">备份已更新,请等待自动刷新!如果等不到请点击';
+ ?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
+ <script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
+ }else{
+ echo '<div class="tongzhi col-mb-12 home">备份完成,请等待自动刷新!如果等不到请点击';
+ ?> <a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
+ <script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
+ }
+ }
+ //还原数据提示
+ if($_POST["type"]=="还原模板设置数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ echo '<div class="tongzhi col-mb-12 home">检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击';
+ ?> <a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
+ <script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script>
+ <?php
+ }else{
+ echo '<div class="tongzhi col-mb-12 home">没有模板备份数据,恢复不了哦!</div>';
+ }
+ }
+ //删除数据提示
+ if($_POST["type"]=="删除备份数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){
+ echo '<div class="tongzhi col-mb-12 home">删除成功,请等待自动刷新,如果等不到请点击';
+ ?>
+ <a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div>
+ <script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script>
+ <?php
+ }else{
+ echo '<div class="tongzhi col-mb-12 home">备份已经被删除了</div>';
+ ?><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 1500);</script><?php
+ }
+ }
+ echo '<br></div>';
}
- echo '<br></div>';
-
/**
* 设置项