Bladeren bron

📦 按要求修改

快乐的梦鱼 3 weken geleden
bovenliggende
commit
7f36765a61
12 gewijzigde bestanden met toevoegingen van 106 en 90 verwijderingen
  1. 1 1
      Db.class.php
  2. 6 0
      css/style.css
  3. 6 0
      css/style.scss
  4. 2 2
      danWeiGaiKuang.php
  5. 3 3
      dangnJianGongZuo.php
  6. 64 64
      gongZuoDongTai.php
  7. 15 11
      index.php
  8. 1 1
      luDaoWenMai.php
  9. 1 1
      search.php
  10. 3 3
      wenBaoJiaYuan.php
  11. 3 3
      xinWenXiangQing.php
  12. 1 1
      zhengCeFaGui.php

+ 1 - 1
Db.class.php

@@ -6,7 +6,7 @@ class Db
     protected static $cfg = [
         'dsn'      => 'mysql:host=127.0.0.1;dbname=protection_center;charset=utf8mb4',
         'user'     => 'root',
-        'pass'     => '7ced1f1f69289c72',
+        'pass'     => 'root',
         'options'  => [
             PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
             PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,

+ 6 - 0
css/style.css

@@ -658,6 +658,11 @@ footer {
   margin: 30px 0;
 }
 
+.swiper-slide img {
+  object-fit: cover;
+  object-position: center;
+}
+
 @media (max-width: 992px) {
   .featured-image {
     width: 100%;
@@ -724,6 +729,7 @@ footer {
   }
 }
 @media (max-width: 576px) {
+  
   .featured-grid {
     grid-template-columns: 1fr;
   }

+ 6 - 0
css/style.scss

@@ -725,6 +725,12 @@ footer {
   }
 }
 
+.swiper-slide {
+  img {
+    object-fit: cover;
+  }
+}
+
 @media (max-width: 768px) { 
   header { 
     .inner {

+ 2 - 2
danWeiGaiKuang.php

@@ -86,7 +86,7 @@ $carouselItems = [
     <div class="container">
       <div class="row">
         <!-- 左侧导航 -->
-        <div class="col col-sm-12 col-md-3 col-lg-3">
+        <div class="col-12 col-sm-12 col-md-4 col-lg-3">
           <div class="sidebar">
             <div class="title">
               <h2><?php echo $channelName; ?></h2>
@@ -113,7 +113,7 @@ $carouselItems = [
         </div>
         
         <!-- 右侧内容 -->
-        <div class="col col-sm-12 col-md-9 col-lg-9">
+        <div class="col-12 col-sm-12 col-md-8 col-lg-9">
           <div class="content">
             <div class="section-title">
               <h2 class="icon"><?php echo $currentArticle['title']; ?></h2>

+ 3 - 3
dangnJianGongZuo.php

@@ -72,7 +72,7 @@ $carouselItems = [
     <div class="container">
       <div class="row">
         <!-- 左侧导航 -->
-        <div class="col col-sm-12 col-md-3 col-lg-3">
+        <div class="col-12 col-sm-12 col-md-4 col-lg-3">
           <div class="sidebar">
             <div class="title">
               <h2><?php echo $channel; ?></h2>
@@ -85,7 +85,7 @@ $carouselItems = [
         </div>
         
         <!-- 右侧内容 -->
-        <div class="col col-sm-12 col-md-9 col-lg-9">
+        <div class="col-12 col-sm-12 col-md-8 col-lg-9">
           <div class="content">
             <div class="section-title">
               <h2 class="icon"><?php echo $channel; ?></h2>
@@ -104,7 +104,7 @@ $carouselItems = [
                 <?php foreach ($partyBuilding as $item): ?>
                   <div class="news-item">
                     <!-- 使用id作为文章详情页的参数,标题和日期字段可能需要根据实际数据库结构调整 -->
-                    <a href="/xinWenXiangQing.php?id=<?php echo isset($item['id']) ? $item['id'] : $item['title']; ?>" class="title">
+                    <a href="/xinWenXiangQing/?id=<?php echo isset($item['id']) ? $item['id'] : $item['title']; ?>" class="title">
                       <?php echo isset($item['title']) ? $item['title'] : (isset($item['subject']) ? $item['subject'] : ''); ?>
                     </a>
                     <span class="date">

+ 64 - 64
gongZuoDongTai.php

@@ -82,77 +82,77 @@ $carouselItems = [
   <!-- 主要内容 -->
   <div class="main-content">
     <div class="container">
-        <div class="row">
-          <!-- 左侧导航 -->
-          <div class="col col-sm-12 col-md-3 col-lg-3">
-            <div class="sidebar">
-      <div class="title">
-        <h2><?php echo $mainChannelName; ?></h2>
-      </div>
-      <ul class="sidebar-menu">
-        <?php if (!empty($sideMenu)): ?>
-          <?php foreach ($sideMenu as $item): ?>
-            <li><a href="gongZuoDongTai.php?channel=<?php echo urlencode($item['name']); ?>&page=1" class="<?php echo $selectedChannel == $item['name'] ? 'active' : ''; ?>"><?php echo $item['name']; ?><i class="fa fa-arrow-right"></i></a></li>
-          <?php endforeach; ?>
-        <?php else: ?>
-          <li class="no-content">暂无相关子分类</li>
-        <?php endif; ?>
-      </ul>
-    </div>
+      <div class="row">
+        <!-- 左侧导航 -->
+        <div class="col-12 col-sm-12 col-md-4 col-lg-3">
+          <div class="sidebar">
+            <div class="title">
+                <h2><?php echo $mainChannelName; ?></h2>
+              </div>
+              <ul class="sidebar-menu">
+                <?php if (!empty($sideMenu)): ?>
+                  <?php foreach ($sideMenu as $item): ?>
+                    <li><a href="gongZuoDongTai.php?channel=<?php echo urlencode($item['name']); ?>&page=1" class="<?php echo $selectedChannel == $item['name'] ? 'active' : ''; ?>"><?php echo $item['name']; ?><i class="fa fa-arrow-right"></i></a></li>
+                  <?php endforeach; ?>
+                <?php else: ?>
+                  <li class="no-content">暂无相关子分类</li>
+                <?php endif; ?>
+              </ul>
+            </div>
           </div>
-          
-          <!-- 右侧内容 -->
-          <div class="col col-sm-12 col-md-9 col-lg-9">
-            <div class="content">
-      <div class="section-title">
-        <h2 class="icon"><?php echo $queryChannel; ?></h2>
         
-        <nav aria-label="breadcrumb">
-          <ol class="breadcrumb">
-            <li class="breadcrumb-item"><a href="/">首页</a></li>
-            <li class="breadcrumb-item"><a href="gongZuoDongTai.php">工作动态</a></li>
-            <?php if ($selectedChannel): ?>
-              <li class="breadcrumb-item active" aria-current="page"><?php echo $selectedChannel; ?></li>
-            <?php else: ?>
-              <li class="breadcrumb-item active" aria-current="page">工作动态</li>
-            <?php endif; ?>
-          </ol>
-        </nav>
-      </div>
+        <!-- 右侧内容 -->
+        <div class="col-12 col-sm-12 col-md-8 col-lg-9">
+          <div class="content">
+            <div class="section-title">
+              <h2 class="icon"><?php echo $queryChannel; ?></h2>
               
-      <!-- 文章列表 -->
-      <div class="news-list">
-        <?php if (!empty($workUpdates)): ?>
-          <?php foreach ($workUpdates as $item): ?>
-            <?php
-            // 确保所有必要字段存在
-            $title = isset($item['title']) ? $item['title'] : '暂无标题';
-            $articleId = isset($item['id']) ? $item['id'] : '';
-            $date = isset($item['createtime']) ? date('Y-m-d', strtotime($item['createtime'])) : '未知日期';
-            ?>
-            <div class="news-item">
-              <a href="/xinWenXiangQing.php?id=<?php echo $articleId; ?>&channel=<?php echo urlencode($queryChannel); ?>" class="title"><?php echo $title; ?></a>
-              <span class="date"><?php echo $date; ?></span>
+              <nav aria-label="breadcrumb">
+                <ol class="breadcrumb">
+                  <li class="breadcrumb-item"><a href="/">首页</a></li>
+                  <li class="breadcrumb-item"><a href="gongZuoDongTai.php">工作动态</a></li>
+                  <?php if ($selectedChannel): ?>
+                    <li class="breadcrumb-item active" aria-current="page"><?php echo $selectedChannel; ?></li>
+                  <?php else: ?>
+                    <li class="breadcrumb-item active" aria-current="page">工作动态</li>
+                  <?php endif; ?>
+                </ol>
+              </nav>
             </div>
-          <?php endforeach; ?>
-        <?php else: ?>
-          <div class="no-news">暂无相关文章</div>
-        <?php endif; ?>
-      </div>
-              
-              <!-- 分页 -->
-      <nav aria-label="List Page navigation">
-        <ul class="pagination mt-4">
-          <li class="prev"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $currentPage > 1 ? $currentPage - 1 : 1; ?>">&lt;</a></li>
-          <?php for ($i = 1; $i <= $totalPages; $i++): ?>
-            <li class="<?php echo $i == $currentPage ? 'active' : ''; ?>"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
-          <?php endfor; ?>
-          <li class="next"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $currentPage < $totalPages ? $currentPage + 1 : $totalPages; ?>">&gt;</a></li>
-        </ul>
-      </nav>
+            
+            <!-- 文章列表 -->
+            <div class="news-list">
+              <?php if (!empty($workUpdates)): ?>
+                <?php foreach ($workUpdates as $item): ?>
+                  <?php
+                  // 确保所有必要字段存在
+                  $title = isset($item['title']) ? $item['title'] : '暂无标题';
+                  $articleId = isset($item['id']) ? $item['id'] : '';
+                  $date = isset($item['createtime']) ? date('Y-m-d', strtotime($item['createtime'])) : '未知日期';
+                  ?>
+                  <div class="news-item">
+                    <a href="/xinWenXiangQing/?id=<?php echo $articleId; ?>&channel=<?php echo urlencode($queryChannel); ?>" class="title"><?php echo $title; ?></a>
+                    <span class="date"><?php echo $date; ?></span>
+                  </div>
+                <?php endforeach; ?>
+              <?php else: ?>
+                <div class="no-news">暂无相关文章</div>
+              <?php endif; ?>
             </div>
+                    
+                    <!-- 分页 -->
+            <nav aria-label="List Page navigation">
+              <ul class="pagination mt-4">
+                <li class="prev"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $currentPage > 1 ? $currentPage - 1 : 1; ?>">&lt;</a></li>
+                <?php for ($i = 1; $i <= $totalPages; $i++): ?>
+                  <li class="<?php echo $i == $currentPage ? 'active' : ''; ?>"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
+                <?php endfor; ?>
+                <li class="next"><a href="gongZuoDongTai.php?channel=<?php echo urlencode($selectedChannel); ?>&page=<?php echo $currentPage < $totalPages ? $currentPage + 1 : $totalPages; ?>">&gt;</a></li>
+              </ul>
+            </nav>
           </div>
         </div>
+      </div>
     </div>
   </div>
 

+ 15 - 11
index.php

@@ -75,7 +75,7 @@ $featured = loadListByChannelName(6, "热门新闻");
               <?php foreach ($notices as $notice): ?>
                 <div class="notice-item">
                   <div>
-                    <a href="#" class="notice-title"><?php echo $notice['title']; ?></a>
+                    <a href="/xinWenXiangQing/?id=<?php echo $notice['id']; ?>" class="notice-title"><?php echo $notice['title']; ?></a>
                     <p><?php echo $notice['description']; ?></p>
                   </div>
                   <span class="notice-createtime"><?php echo $notice['createtime']; ?></span>
@@ -89,7 +89,7 @@ $featured = loadListByChannelName(6, "热门新闻");
             <?php if (!empty($hot)): ?>
               <?php foreach ($hot as $item): ?>
                 <div class="news-item">
-                  <a href="#" class="title"><?php echo $item['title']; ?></a>
+                  <a href="/xinWenXiangQing/?id=<?php echo $item['id']; ?>" class="title"><?php echo $item['title']; ?></a>
                   <span class="createtime"><?php echo $item['createtime']; ?></span>
                 </div>
               <?php endforeach; ?>
@@ -106,11 +106,13 @@ $featured = loadListByChannelName(6, "热门新闻");
               <?php if (!empty($carouselItems2)): ?>
                 <?php foreach ($carouselItems2 as $item): ?>
                   <div class="swiper-slide featured-image">
-                    <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['desc']; ?>" style="width: 100%; height: 100%; object-fit: cover;">
-                    <div class="caption">
-                      <h3><?php echo $item['title']; ?></h3>
-                      <p><?php echo $item['desc']; ?></p>
-                    </div>
+                    <a href="/xinWenXiangQing/?id=<?php echo $item['id']; ?>">
+                      <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['desc']; ?>" style="width: 100%; height: 100%; object-fit: cover;">
+                      <div class="caption">
+                        <h3><?php echo $item['title']; ?></h3>
+                        <p><?php echo $item['desc']; ?></p>
+                      </div>
+                    </a>
                   </div>
                 <?php endforeach; ?>
               <?php else: ?>
@@ -136,7 +138,7 @@ $featured = loadListByChannelName(6, "热门新闻");
               <?php if (!empty($workUpcreatetimes)): ?>
                 <?php foreach ($workUpcreatetimes as $upcreatetime): ?>
                   <div class="news-item">
-                    <a href="#" class="title"><?php echo $upcreatetime['title']; ?></a>
+                    <a href="/xinWenXiangQing/?id=<?php echo $upcreatetime['id']; ?>" class="title"><?php echo $upcreatetime['title']; ?></a>
                     <span class="createtime"><?php echo $upcreatetime['createtime']; ?></span>
                   </div>
                 <?php endforeach; ?>
@@ -157,7 +159,7 @@ $featured = loadListByChannelName(6, "热门新闻");
               <?php if (!empty($partyBuilding)): ?>
                 <?php foreach ($partyBuilding as $item): ?>
                   <div class="news-item">
-                    <a href="#" class="title"><?php echo $item['title']; ?></a>
+                    <a href="/xinWenXiangQing/?id=<?php echo $item['id']; ?>" class="title"><?php echo $item['title']; ?></a>
                     <span class="createtime"><?php echo $item['createtime']; ?></span>
                   </div>
                 <?php endforeach; ?>
@@ -181,8 +183,10 @@ $featured = loadListByChannelName(6, "热门新闻");
           <?php if (!empty($featured)): ?>
             <?php foreach ($featured as $item): ?>
               <div class="featured-card">
-                <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['alt']; ?>">
-                <p><?php echo $item['title']; ?></p>
+                <a href="/xinWenXiangQing/?id=<?php echo $item['id']; ?>">
+                  <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['alt']; ?>">
+                  <p><?php echo $item['title']; ?></p>
+                </a>
               </div>
             <?php endforeach; ?>
           <?php else: ?>

+ 1 - 1
luDaoWenMai.php

@@ -76,7 +76,7 @@ $totalPages = $articleResult['totalPages'];
                           alt="<?php echo isset($item['title']) ? $item['title'] : '鹭岛文脉'; ?>"
                         >
                         <p>
-                          <a href="/xinWenXiangQing.php?id=<?php echo isset($item['id']) ? $item['id'] : ''; ?>">
+                          <a href="/xinWenXiangQing/?id=<?php echo isset($item['id']) ? $item['id'] : ''; ?>">
                             <?php echo isset($item['title']) ? $item['title'] : ''; ?>
                           </a>
                         </p>

+ 1 - 1
search.php

@@ -99,7 +99,7 @@ $carouselItems = [
             $date = isset($item['createtime']) ? date('Y-m-d', strtotime($item['createtime'])) : '未知日期';
             ?>
             <div class="news-item">
-              <a href="/xinWenXiangQing.php?id=<?php echo $articleId; ?>&keyword=<?php echo urlencode($searchKeyword); ?>" class="title"><?php echo $title; ?></a>
+              <a href="/xinWenXiangQing/?id=<?php echo $articleId; ?>&keyword=<?php echo urlencode($searchKeyword); ?>" class="title"><?php echo $title; ?></a>
               <span class="date"><?php echo $date; ?></span>
             </div>
           <?php endforeach; ?>

+ 3 - 3
wenBaoJiaYuan.php

@@ -83,7 +83,7 @@ if (empty($sideMenu) || empty($workUpdates)) {
     <div class="container">
       <div class="row">
         <!-- 左侧导航 -->
-        <div class="col col-sm-12 col-md-3 col-lg-3">
+        <div class="col-12 col-sm-12 col-md-4 col-lg-3">
           <div class="sidebar">
             <div class="title">
                 <h2><?php echo $mainChannelName; ?></h2>
@@ -111,7 +111,7 @@ if (empty($sideMenu) || empty($workUpdates)) {
         </div>
         
         <!-- 右侧内容 -->
-        <div class="col col-sm-12 col-md-9 col-lg-9">
+        <div class="col-12 col-sm-12 col-md-8 col-lg-9">
           <div class="content">
             <div class="section-title">
                 <h2 class="icon"><?php echo $channelToQuery; ?></h2>
@@ -134,7 +134,7 @@ if (empty($sideMenu) || empty($workUpdates)) {
                 <?php if (!empty($workUpdates)): ?>
                   <?php foreach ($workUpdates as $item): ?>
                     <div class="news-item">
-                      <a href="/xinWenXiangQing.php?id=<?php echo isset($item['id']) ? $item['id'] : (isset($item['title']) ? urlencode($item['title']) : ''); ?>" class="title">
+                      <a href="/xinWenXiangQing/?id=<?php echo isset($item['id']) ? $item['id'] : (isset($item['title']) ? urlencode($item['title']) : ''); ?>" class="title">
                         <?php echo isset($item['title']) ? $item['title'] : ''; ?>
                       </a>
                       <span class="date">

+ 3 - 3
xinWenXiangQing.php

@@ -91,7 +91,7 @@ $carouselItems = [
     <div class="container">
       <div class="row">
         <!-- 左侧导航 -->
-        <div class="col col-sm-12 col-md-3 col-lg-3">
+        <div class="col-12 col-sm-12 col-md-4 col-lg-3">
           <div class="sidebar">
             <div class="title">
               <h2><?php echo $currentChannel; ?></h2>
@@ -103,7 +103,7 @@ $carouselItems = [
         </div>
         
         <!-- 右侧内容 -->
-        <div class="col col-sm-12 col-md-9 col-lg-9">
+        <div class="col-12 col-sm-12 col-md-8 col-lg-9">
           <div class="content">
             <div class="section-title">
               <h2 class="icon"><?php echo $currentChannel; ?></h2>
@@ -145,7 +145,7 @@ $carouselItems = [
                     if ($relatedArticles) {
                       foreach ($relatedArticles as $article) {
                         $articleDate = isset($article['createtime']) ? date('Y-m-d', strtotime($article['createtime'])) : '';
-                        echo "<li><a href='/xinWenXiangQing.php?id={$article['id']}'>{$article['title']}</a><span>{$articleDate}</span></li>";
+                        echo "<li><a href='/xinWenXiangQing/?id={$article['id']}'>{$article['title']}</a><span>{$articleDate}</span></li>";
                       }
                     } else {
                       echo "<li>暂无相关文章</li>";

+ 1 - 1
zhengCeFaGui.php

@@ -103,7 +103,7 @@ $totalPages = $articleResult['totalPages'];
                 <?php foreach ($policyItems as $item): ?>
                   <div class="news-item dark">
                     <a 
-                      href="/xinWenXiangQing.php?id=<?php echo isset($item['id']) ? $item['id'] : ''; ?>"
+                      href="/xinWenXiangQing/?id=<?php echo isset($item['id']) ? $item['id'] : ''; ?>"
                       class="title"
                     >
                       <?php echo isset($item['title']) ? $item['title'] : ''; ?>