diff options
| author | Eltrac <45323514+BigCoke233@users.noreply.github.com> | 2019-07-25 16:07:14 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-25 16:07:14 +0800 |
| commit | 35a51540b738f47c500b47a3398416e951096e5a (patch) | |
| tree | 2885d38d5be8c07581e52afb68410eeb8481b08d /libs | |
| parent | 38353f67af44f1a2c0b29d9ff43f0c2a42958833 (diff) | |
左侧抽屉栏,可与顶部导航栏进行切换 / Bug fix
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/Contents.php | 2 | ||||
| -rw-r--r-- | libs/Options.php | 4 | ||||
| -rw-r--r-- | libs/Utils.php | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/libs/Contents.php b/libs/Contents.php index d08629f..40a27c6 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -36,7 +36,7 @@ class Contents $text = preg_replace($reg,$rp,$text); //解析友链项目 $reg = '/\[(.*?)\]\{(.*?)\}\((.*?)\)/s'; - $rp = '<div class="col-lg-2 col-4 col-md-3 links-container"> + $rp = '<div class="col-lg-2 col-6 col-md-3 links-container"> <a href="${2}" target="_blank" class="links-link"> <div class="links-item"> <div class="links-img" style="background:url(\'${3}\');width: 100%;padding-top: 100%;background-repeat: no-repeat;background-size: cover;"></div> diff --git a/libs/Options.php b/libs/Options.php index 6570018..e7c06b7 100644 --- a/libs/Options.php +++ b/libs/Options.php @@ -76,7 +76,9 @@ function themeConfig($form) { * 设置项
*/
//nav
- $nav_position = new Typecho_Widget_Helper_Form_Element_Select('nav_position',array('0'=>'不固定','1'=>'固定'),'0','<h2>导航栏 Nav</h2>是否固定','固定后,导航栏不会随滚动条滚动而移动在屏幕上的位置<hr>');
+ $navStyle = new Typecho_Widget_Helper_Form_Element_Select('navStyle',array('0'=>'顶部导航栏','1'=>'左侧抽屉蓝'),'0','<h2>导航栏 Nav</h2>类型','选择导航栏的类型(若选择左侧抽屉蓝,则下一条设置失效)');
+ $form->addInput($navStyle);
+ $nav_position = new Typecho_Widget_Helper_Form_Element_Select('nav_position',array('0'=>'不固定','1'=>'固定'),'0','是否固定','固定后,导航栏不会随滚动条滚动而移动在屏幕上的位置<hr>');
$form->addInput($nav_position);
//index-banner
diff --git a/libs/Utils.php b/libs/Utils.php index 9e7943e..902b7d4 100644 --- a/libs/Utils.php +++ b/libs/Utils.php @@ -85,12 +85,17 @@ class Utils /** * 判定内容是否过时 - * $timeout:过期时间,单位为天 + * + * @return array */ - public static function isOutdated($archive, $timeout) + public static function isOutdated($archive) { date_default_timezone_set("Asia/Shanghai"); - return round((time()- $archive->created) / 3600 / 24) > $timeout; + $created = round((time()- $archive->created) / 3600 / 24); + $updated = round((time()- $archive->modified) / 3600 / 24); + return array("is" => $created > 90, + "created" => $created, + "updated" => $updated); } /** |
