Browse Source

fleat:update template

igb 1 month ago
parent
commit
0340ca07d0

File diff suppressed because it is too large
+ 100 - 80
usr/themes/beardocs/archive.php


+ 13 - 6
usr/themes/beardocs/assets/css/beardocs.css

@@ -2601,8 +2601,8 @@ select.uk-form-width-xsmall {
  * Small
  */
 .uk-section-small {
-  padding-top: 40px;
-  padding-bottom: 40px;
+  padding-top: 5px;
+  padding-bottom: 5px;
 }
 
 /*
@@ -3418,7 +3418,7 @@ select.uk-form-width-xsmall {
 /* Sections
  ========================================================================== */
 .uk-card-body {
-  padding: 30px 30px;
+  padding: 10px 30px;
 }
 
 .uk-card-header {
@@ -9356,7 +9356,7 @@ iframe.uk-cover {
 .uk-logo {
 
   font-size: 3rem;
-  margin-top:80px;
+  margin-top:5px;
   color: #67607c;
   /* 1 */
   text-decoration: none;
@@ -12524,7 +12524,14 @@ img.lazyload[src^="data:image/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPg"]{width:
             text-overflow: ellipsis;
         }
 .uk-search{
-    width:80%;
+    width:100%;
     left: 50%;
     transform: translateX(-50%);
-    }
+    }
+
+
+
+.lxdh a {
+  background: url(https://www.mietubl.com/images/whatsapp.png) left center no-repeat;
+  padding-left: 25px;
+}

+ 32 - 9
usr/themes/beardocs/footer.php

@@ -1,17 +1,40 @@
 <?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
 
 <a href="#" id="gotop" uk-totop uk-scroll></a>
+<?php
+$currentUrl = $_SERVER['REQUEST_URI'];
 
-<footer class="uk-section-small uk-text-center uk-text-muted">
-	<div class="uk-container">
+ ?>
+<?php if (strpos($currentUrl, 'search') == true) { ?>
 
-		
-		<div class="uk-margin-medium uk-text-small uk-link-primary">&copy; <?php echo date("Y");?> <a href="<?php $this->options->siteUrl();?>"><?php $this->options->title();?></a> All right Reserved.  <br> <br>
-     <?php if (General::Options('PoliceBa')): ?><img  src="<?php $this->options->themeUrl('assets/images/beian.png');?>"> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<?php echo General::parseNumber(General::Options('PoliceBa')); ?>"><?php echo General::Options('PoliceBa'); ?></a><?php endif; ?><?php if (General::Options('IcpBa') && General::Options('PoliceBa')): ?>  | <?php endif; ?><?php if (General::Options('IcpBa')): ?><a href="https://beian.miit.gov.cn/"><?php echo General::Options('IcpBa'); ?></a><?php endif; ?>
-		</div>
-		<?php echo General::Options('CustomizationFooterCode'); ?>	
-	</div>
-</footer>
+<!--<footer class="uk-section-small uk-text-center uk-text-muted">-->
+<!--	<div class="uk-container">-->
+<!---->
+<!---->
+<!--		<div class="uk-margin-medium uk-text-small uk-link-primary">&copy; --><?php //echo date("Y");?><!-- <a href="--><?php //$this->options->siteUrl();?><!--">--><?php //$this->options->title();?><!--</a> All right Reserved.  <br> <br>-->
+<!--     --><?php //if (General::Options('PoliceBa')): ?><!--<img  src="--><?php //$this->options->themeUrl('assets/images/beian.png');?><!--"> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=--><?php //echo General::parseNumber(General::Options('PoliceBa')); ?><!--">--><?php //echo General::Options('PoliceBa'); ?><!--</a>--><?php //endif; ?><!----><?php //if (General::Options('IcpBa') && General::Options('PoliceBa')): ?><!--  | --><?php //endif; ?><!----><?php //if (General::Options('IcpBa')): ?><!--<a href="https://beian.miit.gov.cn/">--><?php //echo General::Options('IcpBa'); ?><!--</a>--><?php //endif; ?>
+<!--		</div>-->
+<!--		--><?php //echo General::Options('CustomizationFooterCode'); ?>
+<!--	</div>-->
+<!--</footer>-->
+
+    <footer class="uk-background-secondary uk-background-norepeat uk-background-cover uk-background-center-center uk-light uk-margin-large-top" >
+        <div class="uk-section uk-section-small uk-section-hero uk-position-relative" data-uk-scrollspy="cls: uk-animation-slide-bottom-medium; repeat: false">
+            <div class="uk-container">
+                <div class="hero-search">
+                    <div class="uk-position-relative" style="display: flex; justify-content: center; align-items: center; height: 40px;"> <!-- 设置固定高度 -->
+                <div class='lxdh'>
+                            <a href="https://wa.me/8617000161888?text=Hello!">No result ? Contact us on WhatsApp.</a>
+                   </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+    </footer>
+<?php
+}
+?>
 
 
 <script src="<?php $this->options->themeUrl('assets/plugins/fancybox/fancybox.umd.min.js'); ?>"></script>

+ 110 - 37
usr/themes/beardocs/header.php

@@ -119,49 +119,122 @@
 <body>
 <header class="uk-background-secondary uk-background-norepeat uk-background-cover uk-background-center-center uk-light" <?php if (General::Options('headerBackground') !== '' && (General::Options('headerColorChoose') == false || General::Options('headerColorChoose') == '')): ?>
 	style="background-image: url(<?php echo General::Options('headerBackground'); ?>);"<?php endif; ?>>
-	<nav class="uk-navbar-container">
-	  <div class="uk-container">
-	    <div data-uk-navbar>
-	      <div class="uk-navbar-center">
-	          <?php if(General::Options('logoPic') == ''):?>
-	          <a class="uk-navbar-item uk-logo" href="<?php $this->options->siteUrl(); ?>"><?php if (General::Options('logoText')): ?><?php echo General::Options('logoText'); ?><?php else:?><?php echo $this->options->title;?><?php endif; ?></a>
-	          <?php else:?>
-	        <a class="uk-navbar-item uk-logo" href="<?php $this->options->siteUrl(); ?>"><img src="<?php echo General::Options('logoPic'); ?>" style="max-width:100%;"></a>
-	        <?php endif;?>
-	      </div>
-	    </div>
-	  </div>
-	</nav>
-<div class="uk-section uk-section-small uk-section-hero uk-position-relative" data-uk-scrollspy="cls: uk-animation-slide-bottom-medium; repeat: false">
-		<div class="uk-container">
-		    	<h1 class="uk-text-center uk-margin-remove-top"><?php if (General::Options('headerText')): ?><?php echo General::Options('headerText'); ?><?php else:?>How can I help you?<?php endif; ?></h1>
-			<div class="hero-search uk-margin-bottom">
-				<div class="uk-position-relative">
-					<form class="uk-search uk-search-default" name="searchCompleteForm" onsubmit="return false;">
-						<span data-uk-search-icon="ratio: 1.2"></span>
-						<input id="searchComplete" spellcheck=false autocorrect="off" autocomplete="off"
-				autocapitalize="off" maxlength="2048" tabindex="1" class="uk-search-input uk-form-large uk-border-rounded" type="search"
-							placeholder="Input keywords and  Enter to search" autocomplete="off" data-minchars="1" data-maxitems="30">
-					</form>
-				</div>
-			</div>
-		</div>
-	</div>
+<!--	<nav class="uk-navbar-container">-->
+<!--	  <div class="uk-container">-->
+<!--	    <div data-uk-navbar>-->
+<!--	      <div class="uk-navbar-center">-->
+<!--	          --><?php //if(General::Options('logoPic') == ''):?>
+<!--	          <a class="uk-navbar-item uk-logo" href="--><?php //$this->options->siteUrl(); ?><!--">--><?php //if (General::Options('logoText')): ?><!----><?php //echo General::Options('logoText'); ?><!----><?php //else:?><!----><?php //echo $this->options->title;?><!----><?php //endif; ?><!--</a>-->
+<!--	          --><?php //else:?>
+<!--	        <a class="uk-navbar-item uk-logo" href="--><?php //$this->options->siteUrl(); ?><!--"><img src="--><?php //echo General::Options('logoPic'); ?><!--" style="max-width:100%;"></a>-->
+<!--	        --><?php //endif;?>
+<!--	      </div>-->
+<!--	    </div>-->
+<!--	  </div>-->
+<!--	</nav>-->
+<?php
+$currentUrl = $_SERVER['REQUEST_URI'];
+
+?>
+    <?php if (strpos($currentUrl, 'category') !== false) { ?>
+    <div class="uk-section uk-section-small uk-section-hero uk-position-relative" data-uk-scrollspy="cls: uk-animation-slide-bottom-medium; repeat: false">
+        <div class="uk-container">
+<!--		    	<h1 class="uk-text-center uk-margin-remove-top">--><?php //if (General::Options('headerText')): ?><!----><?php //echo General::Options('headerText'); ?><!----><?php //else:?><!--How can I help you?--><?php //endif; ?><!--</h1>-->
+            <div class="hero-search ">
+                <div class="uk-position-relative" >
+                    <form class="uk-search uk-search-default " id="searchCompleteForm" name="searchCompleteForm" onsubmit="return false;" style="display: flex; align-items: center; gap: 10px;background-color: ">
+                        <div class="uk-inline" style="flex-grow: 1;">
+                            <span data-uk-search-icon="ratio: 1.2"></span>
+                            <input id="searchComplete" spellcheck=false autocorrect="off" autocomplete="off"
+                                   autocapitalize="off" maxlength="2048" tabindex="1" class="uk-search-input uk-form-medium uk-border-rounded" type="search"
+                                   placeholder="Keywords, Enter to search" autocomplete="off" data-minchars="1" data-maxitems="30" style="width: 100%;">
+                        </div>
+                        <button class="uk-button uk-button-primary uk-border-rounded" type="submit" aria-label="Search">
+                            <span data-uk-icon="icon: search"></span>
+                        </button>
+                    </form>
+
+                </div>
+            </div>
+        </div>
+    </div>
+    <?php
+    }
+    else if (strpos($currentUrl, 'archives') == true)
+    {
+
+        $category_id=General::getCategoryId($this->category);
+        $category_info= General::getCategoryInfo($category_id);
+
+        ?>
+        <div class="uk-section uk-section-small uk-section-hero uk-position-relative" data-uk-scrollspy="cls: uk-animation-slide-bottom-medium; repeat: false">
+            <div class="uk-container">
+                <div class="hero-search">
+                    <div class="uk-position-relative" style="display: flex; justify-content: center; align-items: center; height: 40px;"> <!-- 设置固定高度 -->
+                        <p style="margin: 0;"><?php echo $category_info['name'];?></p>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <?php
+    }
+    else
+    {
+      ?>
+        <div class="uk-section uk-section-small uk-section-hero uk-position-relative" data-uk-scrollspy="cls: uk-animation-slide-bottom-medium; repeat: false">
+            <div class="uk-container">
+                <div class="hero-search">
+                    <div class="uk-position-relative" style="display: flex; justify-content: center; align-items: center; height: 40px;"> <!-- 设置固定高度 -->
+                        <p style="margin: 0;">Select a category to search.</p>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <?php
+    }
+    ?>
 
 </header>
 
 <script>
     $(document).ready(function() {
-        $('#searchComplete').on('keypress', function(e) {
-            // 判断是否按下回车键
-            if (e.which === 13) {
-                // 获取搜索框中的输入值
-                var searchQuery = $(this).val();
-                // 构建目标URL
-                var targetUrl = '/index.php/search/' + encodeURIComponent(searchQuery)+'/?category=<?php echo General::getCategoryId($this->getArchiveSlug());?>';
-                // 跳转到目标URL
-                window.location.href = targetUrl;
+        // 监听搜索按钮的点击事件
+        $('button[type="submit"]').on('click', function(e) {
+            e.preventDefault(); // 阻止表单默认提交行为
+
+            // 获取搜索框中的输入值
+            var searchQuery = $('#searchComplete').val();
+
+
+            // 如果 searchQuery 为空,提示用户输入
+            if (!searchQuery.trim()) {
+                // 移除之前的提示信息(如果存在)
+                $('.search-error-message').remove();
+
+                // 插入提示信息
+                $('#searchCompleteForm').after(
+                    '<div class="search-error-message uk-alert-danger uk-border-rounded uk-margin-small uk-padding-small" style="padding:8px;margin: 0px;">' +
+                    'Please enter a search term.' +
+                    '</div>'
+                );
+                return;
             }
+
+            // 获取 category
+            var category = '<?php
+                $categoryId = General::getCategoryId($this->getArchiveSlug());
+                if (empty($categoryId)) {
+                    // 如果从 General::getCategoryId 获取不到 category,尝试从 URL 参数中获取
+                    $categoryId = isset($_GET['category']) ? $_GET['category'] : '';
+                }
+                echo $categoryId;
+                ?>';
+
+            // 构建目标URL
+            var targetUrl = '/index.php/search/' + encodeURIComponent(searchQuery) + '/?category=' + category;
+
+            // 跳转到目标URL
+            window.location.href = targetUrl;
         });
     });
 </script>

+ 35 - 28
usr/themes/beardocs/index.php

@@ -8,39 +8,46 @@
  * @link https://www.bearnotion.ru/
  */
 
+
+//隐藏起来的mid分类数组
+$skip_mid_array=array(2);
+
+
 if (!defined('__TYPECHO_ROOT_DIR__')) exit;
     $this->need('header.php');
 ?>
 
-<div class="uk-section uk-section-muted">
-	<div class="uk-container">
-    		<div class="uk-grid-medium uk-flex-middle uk-child-width-<?php echo General::getColumnNumber(General::Options('categoryShowColumnMiddle'));?>@m uk-child-width-<?php echo General::getColumnNumber(General::Options('categoryShowColumnLarge'));?>@l uk-grid-match" data-uk-grid>
-		    <?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
-		    <?php while($categorys->next()): ?>
-		    <?php if ($categorys->levels === 0): ?>
-			<div>
-				<div class="uk-card uk-card uk-card-default uk-card-hover uk-card-body uk-inline uk-border-rounded">
-					<a class="uk-position-cover" href="<?php $categorys->permalink(); ?>"></a>
-                    <div class="uk-width-auto uk-text-secondary uk-flex uk-flex-middle">
-                        <image src="/static/images/category-<?php  echo $categorys->mid?>.png"/>
-                    </div>
-
-					<div class="uk-grid-medium" data-uk-grid>
-
-						<div class="uk-width-expand">
-							<h3 class="uk-card-title uk-margin-remove uk-text-secondary uk-category-name"><?php $categorys->name(); ?></h3>
-							<p class="uk-text-muted uk-margin-remove uk-category-desc"><?php echo General::getCategoryDescriptionData($categorys->description)['desc']; ?></p>
-						
+    <div class="uk-section uk-section-muted">
+        <div class="uk-container">
+            <div class="uk-grid-medium uk-flex-middle uk-child-width-<?php echo General::getColumnNumber(General::Options('categoryShowColumnMiddle'));?>@m uk-child-width-<?php echo General::getColumnNumber(General::Options('categoryShowColumnLarge'));?>@l uk-grid-match" data-uk-grid>
+                <?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
+                <?php while($categorys->next()): ?>
+                    <?php if (in_array($categorys->mid, $skip_mid_array)) continue; ?>
+                    <?php if ($categorys->levels === 0): ?>
+                        <div>
+                            <div class="uk-card uk-card uk-card-default uk-card-hover uk-card-body uk-inline uk-border-rounded">
+                                <a class="uk-position-cover" href="<?php $categorys->permalink(); ?>"></a>
+                                <div class="uk-grid-medium" data-uk-grid>
+                                    <!-- 左边图片部分 -->
+                                    <div class="uk-width-1-2">
+                                        <image src="/static/images/category-<?php echo $categorys->mid?>.png" class="uk-width-1-1"/>
+                                    </div>
+                                    <!-- 右边文字部分 -->
+                                    <div class="uk-width-1-2 uk-flex uk-flex-center uk-flex-middle">
+                                        <div>
+                                            <h3 class="uk-card-title uk-margin-remove uk-text-secondary uk-category-name uk-text-center"><?php $categorys->name(); ?></h3>
+                                            <p class="uk-text-muted uk-margin-remove uk-category-desc"><?php echo General::getCategoryDescriptionData($categorys->description)['desc']; ?></p>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    <?php endif; ?>
+                <?php endwhile; ?>
+            </div>
+        </div>
+    </div>
 
-						</div>
-					</div>
-				</div>
-			</div>
-			<?php endif; ?>
-			<?php endwhile; ?>
-			</div>
-	</div>
-</div>
 
 <?php if (General::Options('commonProblem_module') == true): ?>
 <div class="uk-section uk-section-muted">

+ 20 - 19
usr/themes/beardocs/oneColumnPost.php

@@ -10,6 +10,7 @@ $categorys->slug):?>
 
 <?php $this->widget('Widget_Archive@index', 'pageSize=999&type=category', 'mid='.General::getCategoryId($slug))->to($cateArticle); ?>
 
+
 <div class="uk-section uk-section-muted">
   <div class="uk-container">
     <div class="uk-background-default uk-border-rounded uk-box-shadow-small">
@@ -18,7 +19,7 @@ $categorys->slug):?>
      
         <article class="uk-article">
     <?php if(General::getCategoryNoneOtherPost(General::getCategoryId($slug),$this->cid) !== true):?>
-            <button class="uk-button uk-button-primary" uk-toggle="target: #offcanvas-docs"  data-uk-toggle><span uk-icon="icon: chevron-double-left"></span> More Documents</button>
+            <button class="uk-button uk-button-primary" uk-toggle="target: #offcanvas-docs"  data-uk-toggle><span uk-icon="icon: chevron-double-left"></span> More Faqs</button>
             <?php endif;?>
             <button class="uk-button uk-button-primary uk-margin-small-right" type="button" uk-toggle="target: #menus" id="menuBtn" style="display:none;margin-top:15px"><span uk-icon="icon: menu"></span> Catalog navigation</button>
 
@@ -91,7 +92,7 @@ $categorys->slug):?>
 <div id="offcanvas-docs" data-uk-offcanvas="overlay: true">
   <div class="uk-offcanvas-bar">
     <button class="uk-offcanvas-close" type="button" data-uk-close></button>
-    <div style="font-size:20px;display: flex;justify-content: center;align-items: center;">More Documents</div>
+    <div style="font-size:20px;display: flex;justify-content: center;align-items: center;">More Faqs</div>
                  <hr class="uk-divider-icon">
                  <ul class="uk-list" style="word-break:break-all">
         
@@ -118,22 +119,22 @@ $(function(){
     if($('.uk-article-content').has('h1,h2,h3,h4,h5,h6').length){
         $("#menuBtn").fadeIn();
     }
-    //目录树
-    const defaults = Outline.DEFAULTS
-    let outline
-    defaults.title =  '', 
-    defaults.selector = 'h1,h2,h3,h4,h5,h6',
-    defaults.position = 'sticky',
-    defaults.showCode = false,
-    defaults.parentElement = '.menusx',
-    defaults.articleElement = '.uk-article-content',
-    defaults.showNavModalFirst= false,
-    defaults.reader = {
-        title:document.getElementsByClassName("uk-article-title")[0],
-        target:'.uk-article-content',
-        allowSpeak:true
-        },
-    outline = new Outline(Outline.DEFAULTS)
+    // //目录树
+    // const defaults = Outline.DEFAULTS
+    // let outline
+    // defaults.title =  '',
+    // defaults.selector = 'h1,h2,h3,h4,h5,h6',
+    // defaults.position = 'sticky',
+    // defaults.showCode = false,
+    // defaults.parentElement = '.menusx',
+    // defaults.articleElement = '.uk-article-content',
+    // defaults.showNavModalFirst= false,
+    // defaults.reader = {
+    //     title:document.getElementsByClassName("uk-article-title")[0],
+    //     target:'.uk-article-content',
+    //     allowSpeak:true
+    //     },
+    // outline = new Outline(Outline.DEFAULTS)
 const handler = function(attrs) {
   this.attr()
   $('img.lazyload')
@@ -166,7 +167,7 @@ const handler = function(attrs) {
 
 }
 
-outline.$on("enterReading", handler)
+ // outline.$on("enterReading", handler)
 });
 </script>
 

+ 3 - 3
usr/themes/beardocs/threeColumnPost.php

@@ -19,7 +19,7 @@ $categorys->slug):?>
         <div class="uk-card uk-card-default uk-card-body">
                  <div style="font-size:20px;display: flex;
   justify-content: center;
-  align-items: center;">More Documents</div>
+  align-items: center;">More Faqs</div>
                  <hr class="uk-divider-icon">
              
                  <ul class="uk-list">
@@ -42,7 +42,7 @@ $categorys->slug):?>
       <div class="uk-container">
           <aside id="aside"></aside>
           <?php if(General::getCategoryNoneOtherPost(General::getCategoryId($slug),$this->cid) !== true):?>
-      <button class="uk-button uk-button-primary" uk-toggle="target: #offcanvas-docs" id="moreBtn" style="display:none;" data-uk-toggle><span uk-icon="icon: chevron-double-left"></span> More Documents</button>
+      <button class="uk-button uk-button-primary" uk-toggle="target: #offcanvas-docs" id="moreBtn" style="display:none;" data-uk-toggle><span uk-icon="icon: chevron-double-left"></span> More Faqs</button>
       <?php endif;?>
             <button class="uk-button uk-button-primary uk-margin-small-right" type="button" uk-toggle="target: #menus" id="menuBtn" style="display:none;" data-uk-toggle><span uk-icon="icon: menu"></span> Catalog navigation</button>
 
@@ -146,7 +146,7 @@ $categorys->slug):?>
     <button class="uk-offcanvas-close" type="button" data-uk-close></button>
     <div style="font-size:20px;display: flex;
   justify-content: center;
-  align-items: center;">More Documents</div>
+  align-items: center;">More Faqs</div>
                  <hr class="uk-divider-icon">
                  <ul class="uk-list" style="word-break:break-all">
     

Some files were not shown because too many files changed in this diff