From 6bd243b6f91b2223617a3bc5f2f578336ca37c70 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Sat, 11 Apr 2020 17:12:09 +0800 Subject: =?UTF-8?q?:apple:=20Fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=A4=87=E4=BB=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archive.php | 4 +- assets/css/setting.miracles.css | 75 ++++++++++++++---------- includes/head.php | 2 +- index.php | 2 +- libs/Options.php | 125 ++++++++++++++++++++++++---------------- 5 files changed, 123 insertions(+), 85 deletions(-) diff --git a/archive.php b/archive.php index 4287178..4c0d797 100644 --- a/archive.php +++ b/archive.php @@ -9,7 +9,7 @@ $this->need('includes/header.php');

居然没有找到相关内容

next()): ?> -
+
-
+
pageLink(''); ?> diff --git a/assets/css/setting.miracles.css b/assets/css/setting.miracles.css index e2bf856..e89430d 100644 --- a/assets/css/setting.miracles.css +++ b/assets/css/setting.miracles.css @@ -55,24 +55,47 @@ hr { transform-origin: bottom left; } -.miracles-backup-alert { - position: fixed; - top: 0; - right: 0; - left: 0; - padding: 15px 0; - background: #4d90fe; +.tongzhi { + bottom: 0; + left: 50%; + transform: translate(-50%, 0px); + z-index: 10; + padding: 1em; + position: fixed; + color: #fff; + background: rgba(50,50,50,.95); + border-radius: 2px; + margin: 0 auto 1em auto; + box-shadow: 0 2px 6px gray; + transition: .2s; + -webkit-animation: slideDown 0.2s ease forwards; + animation: slideDown 0.3s ease forwards; + max-width: 520px; text-align: center; - transition: all .2s; + font-size: 1.06em } -.miracles-backup-alert,.miracles-backup-alert a { - color: #fff; +@-webkit-keyframes slideDown { + 0%{ + bottom: -100px; + } + 25%{ + bottom: -50px; + } + 50%{ + bottom: 0; + } + 100%{ + bottom: 50px; + } } -.miracles-backup-button { +.miracles-backup-div { margin: 15px 0; - margin-bottom: 0; + margin-bottom: 0 +} + +.miracles-backup-button { padding: 6px 10px; border: none; border-radius: 2px; @@ -81,8 +104,7 @@ hr { -moz-box-shadow: 0 1px 1px #000; box-shadow: 0 1px 1px #000; color: #fff; -}[action="?MiraclesBackup"] { - margin-top: -10px; + cursor: pointer; } .miracles-para-attention { @@ -92,14 +114,6 @@ hr { color: #fff; } -iframe.miracles-news { - margin: 0 -8px; - margin-top: -5px; - width: 100%; - height: 60px; - border: none; -} - ::-webkit-scrollbar { width: 6px; height: 5px; @@ -160,17 +174,14 @@ iframe.miracles-news { } .typecho-option .btn { - width: 100%; - display: block; - height: 50px; - background: #000; - text-align: center; - font-size: 18px; position: fixed; - bottom: 0; - left: 0; - right: 0; - border-radius: 0; + bottom: 15px; + right: 15px; + border-radius: 4px; + background: #000; + box-shadow: 0 0 6px #bababa; + padding: 8px 14px; + font-size: 1.1em } .wmd-button-row { diff --git a/includes/head.php b/includes/head.php index 1bf7ecd..7d65937 100644 --- a/includes/head.php +++ b/includes/head.php @@ -48,7 +48,7 @@ generate_require($css_files,"css",$this->options->CDN?"https://cdn.jsdelivr.net/gh/BigCoke233/miracles@":""); ?> - + diff --git a/index.php b/index.php index c2de313..dd4309c 100644 --- a/index.php +++ b/index.php @@ -53,7 +53,7 @@ $this->need('includes/header.php');
-
+
diff --git a/libs/Options.php b/libs/Options.php index b74fb86..13ec8ea 100755 --- a/libs/Options.php +++ b/libs/Options.php @@ -8,51 +8,41 @@ function themeConfig($form) { * 主题设置备份 * From https://qqdie.com/archives/typecho-templates-backup-and-restore.html */ + $str1 = explode('/themes/', Helper::options()->themeUrl); + $str2 = explode('/', $str1[1]); + $name=$str2[0]; $db = Typecho_Db::get(); - $sjdq=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:Miracles')); - $ysj = $sjdq['value']; - if(isset($_POST['type'])){ - if($_POST["type"]=="备份设置"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup'))){ - $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:MiraclesBackup'); - $updateRows= $db->query($update); - echo ' -insert('table.options') - ->rows(array('name' => 'theme:MiraclesBackup','user' => '0','value' => $ysj)); - $insertId = $db->query($insert); - echo '
备份完成,即将自动刷新。如过您的浏览器没有自动跳转请点击'; -?>这里
-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:MiraclesBackup'))){ - $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup')); - $bsj = $sjdub['value']; - $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:Miracles'); - $updateRows= $db->query($update); - echo '
检测到模板备份数据,恢复完成,即将自动刷新。如过您的浏览器没有自动跳转请点击'; -?>这里
-没有模板备份数据,恢复不了哦!
'; + 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:MiraclesBackup'))){ - $delete = $db->delete('table.options')->where ('name = ?', 'theme:MiraclesBackup'); - $deletedRows = $db->query($delete); - echo '
删除成功,请等待自动刷新,如果等不到请点击'; -?>这里
-备份不存在!'; - } - } -} + } + /** * 设置样式+面板 @@ -66,14 +56,51 @@ function themeConfig($form) {

欢迎使用 Miracles 主题,目前版本是:'. $ver .'
作者博客:Eltrac\'s | 帮助文档:WIKI | - 问题反馈:issues -

-
-    -    - -
- '; + 问题反馈:issues

+
+    +    + +
'; + //备份数据提示 + if($_POST["type"]=="备份模板设置数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
备份已更新,请等待自动刷新!如果等不到请点击'; + ?>这里
+备份完成,请等待自动刷新!如果等不到请点击'; +?> 这里 +fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击'; + ?> 这里
+ +没有模板备份数据,恢复不了哦!'; + } + } + //删除数据提示 + if($_POST["type"]=="删除备份数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
删除成功,请等待自动刷新,如果等不到请点击'; +?> +这里
+ +备份已经被删除了'; + ?>'; + /** * 设置项 -- cgit v1.2.3