diff --git a/code/app/home/BaseController.php b/code/app/home/BaseController.php index 7510eee..756b29d 100644 --- a/code/app/home/BaseController.php +++ b/code/app/home/BaseController.php @@ -90,12 +90,28 @@ abstract class BaseController */ public function rending($strTemplate = '') { - // pc端url目录模板 - $strPcUrlPathTemplate = $this->request->DomainModel->getFomartSubject('PC_URL_PATH','',false); - // var_dump($strPcUrlPathTemplate); + // 全局使用的URL模板 + $strPcUrlTemp = $this->request->DomainModel->getFomartSubject('PC_URL_PATH','',false); + $strNanUrlTemp = $this->request->DomainModel->getFomartSubject('NAN_SHENG_URL','',false); + $strNvUrlTemp = $this->request->DomainModel->getFomartSubject('NV_SHENG_URL','',false); + $strCategoryIndexUrlTemp = $this->request->DomainModel->getFomartSubject('CATEGORY_INDEX_URL','',false); + $strRankUrlTemp = $this->request->DomainModel->getFomartSubject('RANK_INFO_URL','',false); + $strSearchIndexUrlTemp = $this->request->DomainModel->getFomartSubject('SEARCH_INDEX_URL','',false); + $strHistoryUrlTemp = $this->request->DomainModel->getFomartSubject('HISTORY_INFO_URL','',false); + $strBookShelfUrlTemp = $this->request->DomainModel->getFomartSubject('SHUJIA_INFO_URL','',false); + $strUserUrlTemp = $this->request->DomainModel->getFomartSubject('USER_INFO_URL','',false); + View::assign("DomainModel", $this->request->DomainModel); View::assign("TemplatesModel", $this->request->TemplatesModel); - View::assign("strPcPath", $strPcUrlPathTemplate); + View::assign("strPcPath", $strPcUrlTemp); + View::assign("strNanUrlTemp", $strNanUrlTemp); + View::assign("strNvUrlTemp", $strNvUrlTemp); + View::assign("strCategoryIndexUrlTemp", $strCategoryIndexUrlTemp); + View::assign("strRankUrlTemp", $strRankUrlTemp); + View::assign("strSearchIndexUrlTemp", $strSearchIndexUrlTemp); + View::assign("strHistoryUrlTemp", $strHistoryUrlTemp); + View::assign("strBookShelfUrlTemp", $strBookShelfUrlTemp); + View::assign("strUserUrlTemp", $strUserUrlTemp); return View::fetch($strTemplate); } diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index bd0ce9e..aa6e17a 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -42,11 +42,11 @@ $arrRoutes = [ // 目录相关路径 'catalog' => [ '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/novel/:name-:intNovelId/catalog/:strOrder/[:intPage]', + '/book/:name-:intNovelId/table/:strOrder/[:intPage]', '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/novel/:name-:intNovelId/catalog/:strOrder/[:intPage]', + '/book/:name-:intNovelId/table/:strOrder/[:intPage]', ], // 伪小说详情相关路径 @@ -145,7 +145,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { break; case 'catalog': //目录 - Route::get($strRoute, [Novel::class, 'getNovelChapterAll']) + Route::get($strRoute, [Novel::class, 'getNovelCatalog']) ->append(['boolIsMobile' => $boolIsMobile]) ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); break; @@ -154,7 +154,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { Route::get($strRoute, [Novel::class, 'getLibrary']) ->append(['boolIsMobile' => $boolIsMobile]) ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', + 'strGender' => '[a-z\-]+', 'strCategory' => '[a-z\-]+', 'strStatus' => 'all|lianzai|wanjie', 'intPage' => '\d+' diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index f1f98d2..8d5627a 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -103,6 +103,7 @@ class Novel extends BaseController public function getLibrary(Request $Request, $strGender = 'all', $strCategory = 'all', $strStatus = 'all', $intPage = 1) { $boolIsMobile = $Request->param('boolIsMobile'); + $strChannel = $Request->param('strChannel') ?? 'all'; // 性别 @@ -198,6 +199,7 @@ class Novel extends BaseController 'strSearchCategory' => $strSearchCategory, 'strSearchStatus' => $strSearchStatus, 'strNovelSex' => $arrSexChinese[$strGender], + 'strChannel' => $strChannel, 'strTitle' => $strTitle, 'strKeywords' => $strKeywords, 'strDescription' => $strDescription, @@ -487,6 +489,13 @@ class Novel extends BaseController $ChapterModel = ChapterModel::getInstance(); $arrLatestChapter = $ChapterModel->getLatestChapterByNId($intNId); + // 第一章 + $arrFirstChapter = $ChapterModel->getFirstChapterByNId($intNId,false); + $intFirstChapterSort = null; + if ($arrFirstChapter) { + $intFirstChapterSort = $arrFirstChapter['c_sort_num']; + } + $strFocus = ''; // 要点 if ($arrLatestChapter) { @@ -514,7 +523,7 @@ class Novel extends BaseController $arrRelateveNovel = $NovelModel->findMany(['n_id' => [ '$in' => $arrRelateveNId, ]], 10); - + // 更新值 ConverterMovel::setVal([ 'intPage' => 1, @@ -541,6 +550,7 @@ class Novel extends BaseController 'arrLatestChapter' => $arrLatestChapter, 'arrNovelClicks' => $arrNovelClicks, 'strFocus' => $strFocus, + 'intFirstChapterSort' => $intFirstChapterSort, 'strPageCode' => 'boy', 'strTitle' => $strTitle, 'strKeywords' => $strKeywords, @@ -724,7 +734,7 @@ class Novel extends BaseController * @param string $strOrder 正序倒叙:zheng/dao * @return void */ - public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strOrder = 'zheng') + public function getNovelCatalog(Request $Request, $intNovelId = null, $intPage = 1, $strOrder = 'zheng') { $boolIsMobile = $Request->param('boolIsMobile'); @@ -795,7 +805,7 @@ class Novel extends BaseController $strView = ''; $this->generateGrm(1, $intNId . '-' . $strOrder . '-' . $intPage, 110); } else { - $strView = 'pc/getNovelChapterAll'; + $strView = 'pc/getNovelCatalog'; $this->generateGrm(2, $intNId . '-' . $strOrder . '-' . $intPage, 110); } @@ -837,9 +847,11 @@ class Novel extends BaseController $intButtomNum = 10; - $strBaseUrl = sprintf('/search.html?keyword=%s&page={page}', $strSearchKeywords); + // $strSearchInfoUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false); + // $strBaseUrl = sprintf('/search.html?keyword=%s&page={page}', $strSearchKeywords); + $strBaseUrl = NovelModel::getNovelSearchUrl($strSearchKeywords,'{page}'); $arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum); - + // 更新值 ConverterMovel::setVal([ 'intPage' => $intPage, diff --git a/code/app/home/view/kuangyu/Index/index.html b/code/app/home/view/kuangyu/Index/index.html index 88960bd..37b1109 100644 --- a/code/app/home/view/kuangyu/Index/index.html +++ b/code/app/home/view/kuangyu/Index/index.html @@ -20,7 +20,7 @@ "url": "https://{$DomainModel->d_domain}", "potentialAction": { "@type": "SearchAction", - "target": "https://https://{$DomainModel->d_domain}/search.html?keyword={search_term_string}", + "target": 'https://https://{$DomainModel->d_domain}{site:souurl key="search_term_string" p="1"/}', "query-input": "required name=search_term_string" } } @@ -44,21 +44,13 @@

{$DomainModel->d_index_description}

- - -
{volist name="arrNovel.n_forge_novel" id="ForgeNovel" key="key"} - {if $key<20 } - {$arrGRM[$key+20]|raw} - {/if} - - {$ForgeNovel.n_forge_title} - {/volist} + {/volist}
@@ -218,7 +221,7 @@ {volist name="arrRelateveNovel" id="Novel" key="key"}
  • - {$arrGRM[$key+10]|raw} + {$arrGRM[$key+10]|raw} {$Novel['og_novel_book_name'] ?? ''} @@ -240,7 +243,6 @@

  • {/volist} - @@ -248,17 +250,17 @@ {/block} diff --git a/code/app/home/view/kuangyu/Pc/getNovelRank.html b/code/app/home/view/kuangyu/Pc/getNovelRank.html index 64eb1f5..863f4d3 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelRank.html +++ b/code/app/home/view/kuangyu/Pc/getNovelRank.html @@ -6,12 +6,12 @@ - + {/block} {block name="head-css"} - + {/block} {block name="head-js"}{/block} {block name='body-class'}body-rank-class{/block} @@ -43,7 +43,7 @@ diff --git a/code/app/home/view/kuangyu/Pc/getSearchNovel.html b/code/app/home/view/kuangyu/Pc/getSearchNovel.html index 46e019f..17db4c5 100644 --- a/code/app/home/view/kuangyu/Pc/getSearchNovel.html +++ b/code/app/home/view/kuangyu/Pc/getSearchNovel.html @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@ { "@context": "https://schema.org", "@type": "SearchResultsPage", - "url": "https://{$DomainModel->d_name}/search.html?keyword={$strSearchKeywords}", + "url": "https://{$DomainModel->d_name}{site:souurl key='$strSearchKeywords' p='1'/}", "name": "{$DomainModel->d_name} - {$DomainModel->d_name}搜索 第{$intPage}页", "description": "搜索‘{$strSearchKeywords}’结果第{$intPage}页,提供{$strSearchKeywords}创作的小说免费阅读。", "datePublished": "{$arrNovel['og_novel_update_time'] ?? time()}", @@ -33,6 +33,7 @@ } } +{/block} {block name="head-js"}{/block} {block name="logo-html"} @@ -75,14 +76,14 @@ {if $intPage == 1}
  • «
  • {else} -
  • «
  • +
  • «
  • {/if} {/case} {case value="下一页"} {if $intPage >= $intTotalPage}
  • »
  • {else} -
  • »
  • +
  • »
  • {/if} {/case} {case value="..."} diff --git a/code/app/home/view/kuangyu/Public/chapterTable.html b/code/app/home/view/kuangyu/Public/chapterTable.html deleted file mode 100644 index 7a426c6..0000000 --- a/code/app/home/view/kuangyu/Public/chapterTable.html +++ /dev/null @@ -1,4 +0,0 @@ -
  • - {$arrGRM[$key+[start]]|raw} - 01 天龙问世 -
  • \ No newline at end of file diff --git a/code/app/home/view/kuangyu/Public/chapterTableAll.html b/code/app/home/view/kuangyu/Public/chapterTableAll.html deleted file mode 100644 index 00f3252..0000000 --- a/code/app/home/view/kuangyu/Public/chapterTableAll.html +++ /dev/null @@ -1,7 +0,0 @@ -
  • - {$arrGRM[$key+[start]]|raw} - - 01 天龙问世 - -
  • diff --git a/code/app/home/view/kuangyu/Public/footer.html b/code/app/home/view/kuangyu/Public/footer.html index 227fb0f..f36986f 100644 --- a/code/app/home/view/kuangyu/Public/footer.html +++ b/code/app/home/view/kuangyu/Public/footer.html @@ -1,16 +1,15 @@