From 2e9e914f775c5f0b313fa7edcc3c36fb96b1c21f Mon Sep 17 00:00:00 2001 From: make Date: Thu, 10 Apr 2025 11:54:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20grok=20=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E4=BC=98=E5=8C=96h5=20=E7=9A=84=20html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/app/home/controller/Novel.php | 9 +++ .../view/kuangyu/Novel/getNovelChapter.html | 67 +++++++++---------- .../kuangyu/Novel/getNovelChapterAll.html | 36 +++++----- .../home/view/kuangyu/Novel/getNovelInfo.html | 24 ++++--- .../view/kuangyu/推广SEO过程设计记录/index.md | 2 +- code/app/model/ConverterMovel.php | 3 + code/database/seeders/TemplateSeeder.php | 15 +++-- .../kuangyu/home/new_wap/css/style.css | 8 ++- .../template/kuangyu/reader/wap/css/style.css | 3 + 9 files changed, 94 insertions(+), 73 deletions(-) diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index f1c49ee..35f5090 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -665,6 +665,7 @@ class Novel extends BaseController $arrFilter = ['n_id' => $intNId, 'c_sort_num' => $intChapterSort, 'c_page' => $intChapterPage]; $arrChapter = $ChapterModel->findOne($arrFilter); + $strChapterDescription = ''; // 上一章节和下一章节 $arrPreChapter = $arrNextChapter = []; @@ -672,10 +673,17 @@ class Novel extends BaseController if ($arrChapter) { $arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); $arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); + + // 要点-先从章节随机截取,后面如果用上ai,看看使用ai 提炼 精简内容 + $strChapterDescription = strip_tags($arrChapter['content']); + $intCount = mb_strlen($strChapterDescription); + $strChapterDescription = ($intCount > 50) ? mb_substr($strChapterDescription, 0, 50) : $strChapterDescription; } $arrCategoryAll = CategoryModel::$arrCategoryAll; + + // 更新值 ConverterMovel::setVal([ 'intPage' => 1, @@ -684,6 +692,7 @@ class Novel extends BaseController 'strNovelCategoryName' => $arrNovel['og_novel_category'], 'strNovelStatus' => $arrNovel['og_novel_status'], 'strNovelDescription' => $arrNovel['og_description'], + 'strChapterDescription' => $strChapterDescription, 'strNovelChapterName' => $arrChapter['name'], 'strNovelChapterSort' => $arrChapter['c_sort_num'], ]); diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapter.html b/code/app/home/view/kuangyu/Novel/getNovelChapter.html index 80071e8..3ac8b41 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapter.html @@ -19,7 +19,7 @@ - + @@ -38,42 +38,38 @@ content="https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrChapter.n_id}/zhang-{$arrChapter.c_sort_num}"> - + - - - - @@ -116,7 +112,6 @@
- {$arrChapter.content|raw}
@@ -142,12 +137,14 @@ 你刚刚阅读到这里

1/1

diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html index 9c4f413..ca25862 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html @@ -4,18 +4,18 @@ {block name="description"}{$strDescription??''}{/block} {block name="head"} - + - + content='https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrLatestChapter.c_sort_num ?? 1}' /> + + content="https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$intPage}"> @@ -26,13 +26,14 @@ + {block name="head-js"}{/block} @@ -74,7 +72,7 @@
  • {$arrGRM[$key]|raw} {$Chapter.name} + title="{$arrNovel['og_novel_book_name']} {$Chapter.name}">{$Chapter.name}
  • {/volist} diff --git a/code/app/home/view/kuangyu/Novel/getNovelInfo.html b/code/app/home/view/kuangyu/Novel/getNovelInfo.html index 77016e4..da01bb9 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Novel/getNovelInfo.html @@ -29,8 +29,8 @@ {/block} @@ -60,12 +61,14 @@ {block name="logo-html"} {/block} {block name="main"}
    + + @@ -95,13 +99,13 @@
    - {$Novel->og_novel_book_name ?? ''}封面 + {$arrNovel['og_novel_book_name'] ?? ''}小说封面 - {$arrNovel.og_novel_author}最新章节 已完结
    -

    {$arrNovel['og_novel_book_name']}

    +

    {$arrNovel['og_novel_book_name']}

    分类:{$arrNovel.og_novel_category} 作者:{$arrNovel.og_novel_author} @@ -163,7 +167,7 @@

    -

    目录

    +

    {$arrNovel.og_novel_book_name}最新章节

      @@ -178,7 +182,7 @@
    更多章节 + class="reading btn-bookshelf">{$arrNovel.og_novel_book_name}更多章节
    diff --git a/code/app/home/view/kuangyu/推广SEO过程设计记录/index.md b/code/app/home/view/kuangyu/推广SEO过程设计记录/index.md index 7101441..72b4089 100644 --- a/code/app/home/view/kuangyu/推广SEO过程设计记录/index.md +++ b/code/app/home/view/kuangyu/推广SEO过程设计记录/index.md @@ -50,7 +50,7 @@ pc-首页 3.地图生成 4.收录推送 5.友情链接 - 6.热搜词 收索下面展示,全站通用,每个站点随机展示10条 + 6.热搜词 顶部收索框下面展示,全站通用,每个站点随机展示10条 diff --git a/code/app/model/ConverterMovel.php b/code/app/model/ConverterMovel.php index 82d9193..c478b9a 100644 --- a/code/app/model/ConverterMovel.php +++ b/code/app/model/ConverterMovel.php @@ -24,6 +24,7 @@ class ConverterMovel '{strNovelName}' => '', '{strNovelChapterName}' => '', '{strNovelChapterSort}' => '', + '{strChapterDescription}' => '', '{strNovelCategoryName}' => '', '{strNovelSex}' => '', '{strNovelStatus}' => '', @@ -31,6 +32,7 @@ class ConverterMovel '{strNovelAuthor}' => '', '{strNovelDescription}' => '', '{strSearchKeywords}' => '', + ]; static public $arrDescription = [ @@ -44,6 +46,7 @@ class ConverterMovel '{strNovelName}' => '这个是当前页面小说描述', '{strNovelChapterName}' => '当前页面小说章节名字', '{strNovelChapterSort}' => '当前页面小说章节排序号', + '{strChapterDescription}' => '当前页面小说章节描述', '{strNovelCategoryName}' => '当前页面小说分类名字', '{strNovelSex}' => '当前页面小说是男生还是女生 小说', '{strNovelStatus}' => '当前页面小说状态 是连载还是完结', diff --git a/code/database/seeders/TemplateSeeder.php b/code/database/seeders/TemplateSeeder.php index cf5e0f2..ae1abdc 100644 --- a/code/database/seeders/TemplateSeeder.php +++ b/code/database/seeders/TemplateSeeder.php @@ -87,6 +87,7 @@ class TemplateSeeder 'description' => '详情Title 替换模板分组ID', 'sfg_id' => 10, 'arrSubjectFomart' => [ + '{strNovelName} - {strNovelAuthor} - 免费在线阅读 - {strSiteName}', '{strNovelName} - {strNovelAuthor} - {strSiteName} - 免费阅读', ] ], @@ -94,7 +95,7 @@ class TemplateSeeder 'description' => '详情Keywords 替换模板分组ID', 'sfg_id' => 11, 'arrSubjectFomart' => [ - '{strNovelName}, {strNovelAuthor}, {strNovelCategoryName}小说, {strNovelSex}小说, {strNovelStatus}小说, {strSiteName}, 免费阅读', + '{strNovelName}, {strNovelAuthor}, {strNovelCategoryName}, {strNovelSex}小说, {strNovelStatus}小说, {strSiteName}, 免费阅读', ] ], 'NOVEL@GETNOVELINFO@DESCRIPTION' => [ @@ -109,20 +110,21 @@ class TemplateSeeder 'description' => '目录Title 替换模板分组ID', 'sfg_id' => 13, 'arrSubjectFomart' => [ - '{strNovelName}章节目录 - {strSiteName} - 第{intPage}页', + '{strNovelName}章节目录 - {strNovelAuthor} - 免费查看 - {strSiteName} 第{intPage}页', ] ], 'NOVEL@GETNOVELCHAPTERALL@KEYWORDS' => [ 'description' => '目录Keywords 替换模板分组ID', 'sfg_id' => 14, 'arrSubjectFomart' => [ - '{strNovelName}, {strNovelName}章节目录, {strNovelAuthor}, {strNovelCategoryName}小说, {strNovelSex}小说, {strSiteKeywords}, {strSiteName}', + '{strNovelName}, 章节目录, {strNovelAuthor}, {strNovelCategoryName}, 免费阅读,{strNovelSex}小说, {strSiteKeywords}, {strSiteName}', ] ], 'NOVEL@GETNOVELCHAPTERALL@DESCRIPTION' => [ 'description' => '目录Description 替换模板分组ID', 'sfg_id' => 15, 'arrSubjectFomart' => [ + '{strSiteName}提供{strNovelName}章节目录免费查看,第{intPage}页包含最新{strNovelStatus}章节,{strNovelAuthor}创作,畅享{strSiteDomain}!', ] ], @@ -131,21 +133,22 @@ class TemplateSeeder 'description' => '内容Title 替换模板分组ID', 'sfg_id' => 16, 'arrSubjectFomart' => [ - '{strNovelName} 第{strNovelChapterSort}章 {strNovelChapterName} - {strSiteName}', + '{strNovelName} {strNovelChapterName} - {strNovelAuthor} - 免费阅读 - {strSiteName}', + '{strNovelName} {strNovelChapterName} - {strSiteName}', ] ], 'NOVEL@GETNOVELCHAPTER@KEYWORDS' => [ 'description' => '内容Keywords 替换模板分组ID', 'sfg_id' => 17, 'arrSubjectFomart' => [ - '{strNovelName}, 第{strNovelChapterSort}章, {strNovelChapterName}, {strNovelAuthor}, {strSiteKeywords}, {strSiteName}, 免费阅读', + '{strNovelName}, {strNovelChapterName}, {strNovelAuthor}, {strSiteKeywords}, 免费阅读, {strSiteName}', ] ], 'NOVEL@GETNOVELCHAPTER@DESCRIPTION' => [ 'description' => '内容Description 替换模板分组ID', 'sfg_id' => 18, 'arrSubjectFomart' => [ - '{strSiteName}提供{strNovelName}第{strNovelChapterSort}章{strNovelChapterName}免费阅读,{strNovelAuthor}创作,畅享{strSiteDomain}!', + '{strNovelName}{strNovelChapterName}免费在线阅读,{strNovelAuthor}著。{strChapterDescription},快来{strSiteName}畅读精彩章节!', ] ], diff --git a/code/public/template/kuangyu/home/new_wap/css/style.css b/code/public/template/kuangyu/home/new_wap/css/style.css index 6690b93..10f7bdf 100644 --- a/code/public/template/kuangyu/home/new_wap/css/style.css +++ b/code/public/template/kuangyu/home/new_wap/css/style.css @@ -257,9 +257,13 @@ aria { } .site-description{ font-size: 0.7rem; - padding: 0.5rem 1rem; + padding: 0.5rem 0.5rem; line-height: 1rem; } +.breadcrumb .site-description{ + padding: 0.5rem 0rem 0rem; +} + /*尾部*/ .footer{ margin-top: 0.75rem; @@ -502,7 +506,7 @@ aria { border-radius: 0.1875rem; } .mod-head h1{ - font-size: 1.125rem; + font-size: 0.7rem; text-align: center; line-height: 40px; width: 100%; diff --git a/code/public/template/kuangyu/reader/wap/css/style.css b/code/public/template/kuangyu/reader/wap/css/style.css index 01ff38e..93ee12b 100644 --- a/code/public/template/kuangyu/reader/wap/css/style.css +++ b/code/public/template/kuangyu/reader/wap/css/style.css @@ -375,6 +375,9 @@ a.read-load-icon[class] { left: 1rem; color: rgba(0,0,0,.7); */ } +.read-book-name a{ + display: block; +} .read-page-mark { font-size: 0; position: absolute; From 8f39bb20bb424de1972de23373db02eb269ad725 Mon Sep 17 00:00:00 2001 From: make Date: Thu, 10 Apr 2025 15:21:05 +0800 Subject: [PATCH 2/3] debug --- code/app/home/controller/Novel.php | 28 +++----- .../home/view/kuangyu/Novel/getNovelInfo.html | 2 +- .../view/kuangyu/Novel/getSearchNovel.html | 36 +++++++--- .../home/view/kuangyu/Pc/getArticleInfo.html | 8 ++- .../home/view/kuangyu/Pc/getArticleList.html | 8 ++- .../home/view/kuangyu/Pc/getKanNovelInfo.html | 8 ++- code/app/home/view/kuangyu/Pc/getLibrary.html | 8 ++- .../home/view/kuangyu/Pc/getNovelChannel.html | 8 ++- .../home/view/kuangyu/Pc/getNovelChapter.html | 58 ++++++++------- .../view/kuangyu/Pc/getNovelChapterAll.html | 63 ++++++++-------- .../home/view/kuangyu/Pc/getNovelInfo.html | 71 +++++++++++-------- .../home/view/kuangyu/Pc/getNovelRank.html | 8 ++- .../home/view/kuangyu/Pc/getSearchNovel.html | 42 ++++++++--- code/app/home/view/kuangyu/Pc/index.html | 10 ++- code/app/home/view/kuangyu/basePc.html | 7 +- code/database/seeders/TemplateSeeder.php | 2 +- .../kuangyu/home/bai_web/css/style.css | 17 +++-- .../kuangyu/home/new_wap/css/style.css | 3 + .../template/kuangyu/reader/web/css/style.css | 4 ++ 19 files changed, 246 insertions(+), 145 deletions(-) diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index 35f5090..8df95ea 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -494,7 +494,7 @@ class Novel extends BaseController $intCount = mb_strlen($strFocus); if ($intCount > 300) { $intPos = mt_rand(0, $intCount - 300); - $strFocus = mb_substr($strFocus, $intPos, 300); + $strFocus = mb_substr($strFocus, 0, 300); } } @@ -573,29 +573,22 @@ class Novel extends BaseController $ChapterModel = ChapterModel::getInstance(); $arrChapter = $ChapterModel->getLatestChapterByNId($intNId); + $strChapterDescription = ''; // 上一章节和下一章节 $arrPreChapter = $arrNextChapter = []; if ($arrChapter) { $arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); $arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); + + // 要点-先从章节随机截取,后面如果用上ai,看看使用ai 提炼 精简内容 + $strChapterDescription = strip_tags($arrChapter['content']); + $intCount = mb_strlen($strChapterDescription); + $strChapterDescription = ($intCount > 50) ? mb_substr($strChapterDescription, 0, 50) : $strChapterDescription; } - $arrCategoryAll = CategoryModel::$arrCategoryAll; - // 模拟数据-随机推荐数据10条 - $arrNewsNovel = [ - ['id' => 1, 'name' => '小说1', 'author' => '作者1'], - ['id' => 2, 'name' => '小说2', 'author' => '作者2'], - ['id' => 3, 'name' => '小说3', 'author' => '作者3'], - ['id' => 4, 'name' => '小说3', 'author' => '作者3'], - ['id' => 5, 'name' => '小说3', 'author' => '作者3'], - ['id' => 6, 'name' => '小说3', 'author' => '作者3'], - ['id' => 7, 'name' => '小说3', 'author' => '作者3'], - ['id' => 8, 'name' => '小说3', 'author' => '作者3'], - ]; - // 更新值 ConverterMovel::setVal([ 'intPage' => 1, @@ -604,6 +597,7 @@ class Novel extends BaseController 'strNovelCategoryName' => $arrNovel['og_novel_category'], 'strNovelStatus' => $arrNovel['og_novel_status'], 'strNovelDescription' => $arrNovel['og_description'], + 'strChapterDescription' => $strChapterDescription, 'strNovelChapterName' => $arrChapter['name'] ?? '', 'strNovelChapterSort' => $arrChapter['c_sort_num'] ?? '', ]); @@ -617,10 +611,6 @@ class Novel extends BaseController $strKeywords = ConverterMovel::convert($strKeywordsTemplate); $strDescription = ConverterMovel::convert($strDescriptionTemplate); - View::assign([ - 'arrNewsNovel' => $arrNewsNovel, - 'strPageCode' => 'boy' - ]); View::assign([ 'arrNovel' => $arrNovel, 'arrCategoryAll' => $arrCategoryAll, @@ -682,8 +672,6 @@ class Novel extends BaseController $arrCategoryAll = CategoryModel::$arrCategoryAll; - - // 更新值 ConverterMovel::setVal([ 'intPage' => 1, diff --git a/code/app/home/view/kuangyu/Novel/getNovelInfo.html b/code/app/home/view/kuangyu/Novel/getNovelInfo.html index da01bb9..33a5491 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Novel/getNovelInfo.html @@ -175,7 +175,7 @@
  • {$arrGRM[$key]|raw} {$Chapter.name} + title="{$arrNovel.og_novel_book_name}-{$Chapter.name}">{$Chapter.name}
  • {/volist} diff --git a/code/app/home/view/kuangyu/Novel/getSearchNovel.html b/code/app/home/view/kuangyu/Novel/getSearchNovel.html index 0296029..ecec6af 100644 --- a/code/app/home/view/kuangyu/Novel/getSearchNovel.html +++ b/code/app/home/view/kuangyu/Novel/getSearchNovel.html @@ -8,15 +8,31 @@ + + + + + + {/block} {block name="head-js"}{/block} @@ -33,7 +49,11 @@