This commit is contained in:
make
2025-04-21 21:03:24 +08:00
parent 2337ab4f7d
commit 43761001fa
20 changed files with 106 additions and 136 deletions

View File

@@ -218,7 +218,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
Route::get($strRoute, function () use ($strView) { Route::get($strRoute, function () use ($strView) {
return view($strView); return view($strView);
}) })
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
break; break;
case 'chapter': case 'chapter':
@@ -242,7 +242,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
Route::get($strRoute, function () use ($strView) { Route::get($strRoute, function () use ($strView) {
return view($strView); return view($strView);
}) })
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); ->pattern(['intNovelId' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
break; break;
case 'novel': case 'novel':
@@ -254,7 +254,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
Route::get($strRoute, function () use ($strView) { Route::get($strRoute, function () use ($strView) {
return view($strView); return view($strView);
}) })
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
break; break;
case 'catalog': case 'catalog':
@@ -266,7 +266,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
Route::get($strRoute, function () use ($strView) { Route::get($strRoute, function () use ($strView) {
return view($strView); return view($strView);
}) })
->pattern(['n_id' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']);
break; break;
case 'library': case 'library':

View File

@@ -1,6 +1,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
{block name="get-data"}{/block}
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate"> <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">

View File

@@ -1,6 +1,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
{block name="get-data"}{/block}
<meta http-equiv="content-type" content="text/html;charset=utf-8"> <meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

View File

@@ -1,14 +1,16 @@
{extend name="baseH5" /} {extend name="baseH5" /}
{block name="get-data"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="h5_novel_catalog " diff="$Request.url" num="120" g_key="arrGrm" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="h5_novel_catalog " diff="$Request.url" num="120" g_key="arrGrm" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' /> <meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' />

View File

@@ -1,17 +1,18 @@
{extend name="baseH5" /} {extend name="baseH5" /}
{block name="get-data"}
{site:grm page_code="h5_novel_chapter" diff="$Request.url" num="20" g_key="arrGrm" /}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{chapter:info n_id="$Request.route.intNovelId" c_sort_num="$Request.route.intChapterSort"
c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELCHAPTER@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELCHAPTER@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCHAPTER@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELCHAPTER@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{site:grm page_code="h5_novel_chapter" diff="$Request.url" num="20" g_key="arrGrm" /}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{chapter:info n_id="$Request.route.intNovelId" c_sort_num="$Request.route.intChapterSort"
c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" />

View File

@@ -1,22 +1,24 @@
$Novel.n_id{extend name="baseH5" /} $Novel.n_id{extend name="baseH5" /}
{block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block}
{block name="head"}
{block name="get-data"}
{if $Request.route.intNovelId} {if $Request.route.intNovelId}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /} {novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{else} {else}
{novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /} {novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /}
{/if} {/if}
{site:grm page_code="h5_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /}
{/block}
{site:grm page_code="h5_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /} {block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE" diff="$Request.route.intNovelId" /}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS" diff="$Request.route.intNovelId"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION" diff="$Request.route.intNovelId"}{/block}
{block name="head"}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' /> <meta property="og:description"
content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION" diff="$Request.route.intNovelId"}' />
<meta property="og:url" <meta property="og:url"
content='https://{$DomainModel->d_domain}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}' /> content='https://{$DomainModel->d_domain}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}' />
<meta property="og:type" content="book" /> <meta property="og:type" content="book" />
@@ -35,7 +37,8 @@ $Novel.n_id{extend name="baseH5" /}
<!-- 可选:支持 Twitter Card --> <!-- 可选:支持 Twitter Card -->
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{$arrNovel['n_name'] ?? '未知小说'}" /> <meta name="twitter:title" content="{$arrNovel['n_name'] ?? '未知小说'}" />
<meta name="twitter:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' /> <meta name="twitter:description"
content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION" diff="$Request.route.intNovelId"}' />
<meta name="twitter:image" content="{$arrNovel.n_cover_path ?? ''}" /> <meta name="twitter:image" content="{$arrNovel.n_cover_path ?? ''}" />
<!-- 结构化数据 --> <!-- 结构化数据 -->
<script type="application/ld+json"> <script type="application/ld+json">
@@ -90,6 +93,8 @@ $Novel.n_id{extend name="baseH5" /}
</script> </script>
{/block} {/block}
{block name="head-js"} {block name="head-js"}
{/block} {/block}
@@ -112,7 +117,8 @@ $Novel.n_id{extend name="baseH5" /}
</li> </li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> <li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<?php $arrNovel['n_category_pinyin'] ?? $arrNovel['n_category_pinyin'] = 'all'?> <?php $arrNovel['n_category_pinyin'] ?? $arrNovel['n_category_pinyin'] = 'all'?>
<a href='{site:nflurl category="$arrNovel.n_category_pinyin" order="all" status="all" page="1"/}' itemprop="item"> <a href='{site:nflurl category="$arrNovel.n_category_pinyin" order="all" status="all" page="1"/}'
itemprop="item">
<span itemprop="name">{$arrNovel.n_category}</span> <span itemprop="name">{$arrNovel.n_category}</span>
</a> </a>
<meta itemprop="position" content="2" /> <meta itemprop="position" content="2" />
@@ -184,7 +190,8 @@ $Novel.n_id{extend name="baseH5" /}
<h3 class="wrap-title">章节列表</h3> <h3 class="wrap-title">章节列表</h3>
<div class="block-box"> <div class="block-box">
<ul class="chapter-list"> <ul class="chapter-list">
{chapter:list count="100" sort_type="zheng" n_id="$arrNovel.n_id" d_key="d_key" d_val="Chapter" cache_life="86400"} {chapter:list count="100" sort_type="zheng" n_id="$arrNovel.n_id" d_key="d_key" d_val="Chapter"
cache_life="86400"}
<li> <li>
{$arrGrm[$d_key+10]|raw} {$arrGrm[$d_key+10]|raw}
<a <a
@@ -199,14 +206,16 @@ $Novel.n_id{extend name="baseH5" /}
<div class="wrap-box"> <div class="wrap-box">
<h3 class="wrap-title"><span>完结推荐</span></h3> <h3 class="wrap-title"><span>完结推荐</span></h3>
<div class="rec-focus"> <div class="rec-focus">
{novel:list count="6" n_category="$arrNovel.n_category_pinyin" n_status="wanjie" d_key="d_key" d_val="Novel" p_val="page_data" cache_life="86400"} {novel:list count="6" n_category="$arrNovel.n_category_pinyin" n_status="wanjie" d_key="d_key" d_val="Novel"
p_val="page_data" cache_life="86400"}
<dl class="rec-focus-book"> <dl class="rec-focus-book">
<dt class="book-img"> <dt class="book-img">
{$arrGrm[$d_key+110]|raw} {$arrGrm[$d_key+110]|raw}
<a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'><img <a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'><img height="100"
height="100" width="80" class="lazyload-img" src="/static/img/default.jpg" width="80" class="lazyload-img" src="/static/img/default.jpg"
data-src="{$Novel.n_cover_path ?? ''}" data-src="{$Novel.n_cover_path ?? ''}"
alt="{$Novel.n_name ?? ''} - {$Novel.n_category ?? ''}最新章节在线免费阅读"></a></dt> alt="{$Novel.n_name ?? ''} - {$Novel.n_category ?? ''}最新章节在线免费阅读"></a>
</dt>
<dd class="book-info"> <dd class="book-info">
<h2><a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>{$Novel.n_name}</a> <h2><a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>{$Novel.n_name}</a>
</h2> </h2>

View File

@@ -1,7 +1,9 @@
{extend name="basePc" /} {extend name="basePc" /}
{block name="title"}{site:replace code="NOVEL@GETLIBRARY@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETLIBRARY@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETLIBRARY@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETLIBRARY@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETLIBRARY@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETLIBRARY@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content='{site:replace code="NOVEL@GETLIBRARY@TITLE"}' /> <meta property="og:title" content='{site:replace code="NOVEL@GETLIBRARY@TITLE"}' />

View File

@@ -1,14 +1,16 @@
{extend name="basePc" /} {extend name="basePc" /}
{block name="get-data"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="pc_novel_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="pc_novel_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}' /> <meta property="og:description" content='{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}' />

View File

@@ -1,15 +1,19 @@
{extend name="basePc" /} {extend name="basePc" /}
{block name="get-data"}
{site:grm page_code="pc_novel_chapter" diff="$Request.url" num="20" g_key="arrGrm" /}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{chapter:info n_id="$Request.route.intNovelId" c_sort_num="$Request.route.intChapterSort"
c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELCHAPTER@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELCHAPTER@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCHAPTER@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELCHAPTER@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{site:grm page_code="pc_novel_chapter" diff="$Request.url" num="20" g_key="arrGrm" /}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{chapter:info n_id="$Request.route.intNovelId" c_sort_num="$Request.route.intChapterSort"
c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" />

View File

@@ -1,18 +1,21 @@
{extend name="basePc" /} {extend name="basePc" /}
{block name="get-data"}
{if $Request.route.intNovelId}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{else}
{novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /}
{/if}
{site:grm page_code="pc_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{if $Request.route.intNovelId}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{else}
{novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /}
{/if}
{site:grm page_code="pc_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' /> <meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' />

View File

@@ -2,6 +2,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
{block name="get-data"}{/block}
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />

View File

@@ -1,6 +1,7 @@
<html data-dpr="1" style="font-size: 39px;"> <html data-dpr="1" style="font-size: 39px;">
<head> <head>
{block name="get-data"}{/block}
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">

View File

@@ -2,6 +2,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
{block name="get-data"}{/block}
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />

View File

@@ -1,6 +1,7 @@
<html> <html>
<head> <head>
{block name="get-data"}{/block}
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />

View File

@@ -1,17 +1,21 @@
{extend name="baseH5" /} {extend name="baseH5" /}
{block name="get-data"}
{if $Request.route.intNovelId}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{else}
{novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /}
{/if}
{site:grm page_code="h5_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELINFO@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{if $Request.route.intNovelId}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{else}
{novel:info n_id="$DomainModel->info_id" n_key="arrNovel" n_forge_id="0" /}
{/if}
{site:grm page_code="h5_novel_info" diff="$arrNovel.n_id" num="120" g_key="arrGrm" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->

View File

@@ -1,13 +1,16 @@
{extend name="basePc" /} {extend name="basePc" /}
{block name="get-data"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="pc_novel_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
{/block}
{block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block} {block name="title"}{site:replace code="NOVEL@GETNOVELCATALOG@TITLE"}{/block}
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block} {block name="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
{block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block} {block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block}
{block name="head"} {block name="head"}
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
{site:grm page_code="pc_novel_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
<!-- 社交媒体标签 --> <!-- 社交媒体标签 -->
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" /> <meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />

View File

@@ -158,12 +158,13 @@ class NovelService
{ {
$strKey = 'CATEGORY_INFO_URL'; $strKey = 'CATEGORY_INFO_URL';
$strUrl = $this->getPageUrl($strKey, [ $strUrl = $this->getPageUrl($strKey, [
'strGender' => $strGender ?? 'all', 'strGender' => !empty($strGender) ? $strGender : '',
'strCategory' => $strCategory ?? 'all', 'strCategory' => !empty($strCategory) ? $strCategory : 'all',
'strStatus' => $strStatus ?? 'all', 'strStatus' => !empty($strStatus) ? $strStatus : 'all',
'strOrder' => $strOrder ?? 'all', 'strOrder' => !empty($strOrder) ? $strOrder : 'all',
'intPage' => $intPage ?? 1, 'intPage' => $intPage ?? 1,
]); ]);
$strUrl = preg_replace('#/{2,}#', '/', $strUrl); $strUrl = preg_replace('#/{2,}#', '/', $strUrl);
return (string)$strUrl; return (string)$strUrl;
} }
@@ -637,6 +638,7 @@ class NovelService
$intTotal = $arrNovel['total'] ?? 0; $intTotal = $arrNovel['total'] ?? 0;
$intButtomNum = $arrParams['button_num']; $intButtomNum = $arrParams['button_num'];
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}'); $strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $intTotal, $intLimit, $strBaseUrl, $intButtomNum); $arrPaginator = CusteomPage02::generate($intPage, $intTotal, $intLimit, $strBaseUrl, $intButtomNum);
return $arrPaginator; return $arrPaginator;

View File

@@ -155,15 +155,17 @@ class SiteContext
* 变量转换 * 变量转换
* *
* @param string $strCode * @param string $strCode
* @param string $strDiff
* @return string * @return string
*/ */
public function converterTemplate(string $strCode): string public function converterTemplate(string $strCode,string $strDiff="0"): string
{ {
$strTitleTemplate = $this->DomainModel->getFomartSubject($strCode); $strTitleTemplate = $this->DomainModel->getFomartSubject($strCode,$strDiff);
return ConverterMovel::convert($strTitleTemplate); return ConverterMovel::convert($strTitleTemplate);
} }
/** /**
* 获取干扰码 * 获取干扰码
* *

View File

@@ -7,7 +7,7 @@ use think\template\TagLib;
class Novel extends TagLib class Novel extends TagLib
{ {
protected $tags = [ protected $tags = [
'list' => ['attr' => 'count,n_category,sort_type,n_status,n_sex,diff_key,cache_life,d_key,d_val', 'close' => 1], 'list' => ['attr' => 'limit,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val', 'close' => 1],
'pager' => ['attr' => 'page,limit,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 1], 'pager' => ['attr' => 'page,limit,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 1],
'pagerexp' => ['attr' => 'page,limit,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 0], 'pagerexp' => ['attr' => 'page,limit,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 0],
'info' => ['attr' => 'n_id,n_key', 'close' => 0], 'info' => ['attr' => 'n_id,n_key', 'close' => 0],
@@ -15,8 +15,6 @@ class Novel extends TagLib
'status' => ['attr' => 'd_key,d_val'], 'status' => ['attr' => 'd_key,d_val'],
'sex' => ['attr' => 'd_key,d_val'], 'sex' => ['attr' => 'd_key,d_val'],
'category' => ['attr' => 'd_key,d_val,n_sex'], 'category' => ['attr' => 'd_key,d_val,n_sex'],
'ranklist' => ['attr' => 'count,sort_type,n_status,n_sex,diff_key,cache_life,d_key,d_val', 'close' => 1],
]; ];
private function customBuildVar($mixedArgs) private function customBuildVar($mixedArgs)
@@ -29,67 +27,8 @@ class Novel extends TagLib
} }
/** /**
* tagRankList * novel 自定义标签
*
* @param array $tag
* @param string $content
* @return void
*/
public function tagRankList($tag, $content)
{
$count = $tag['count'] ?? '10';
$sort_type = $tag['sort_type'] ?? "";
$n_status = $tag['n_status'] ?? "all";
$n_sex = $tag['n_sex'] ?? "all";
$diff_key = $tag['diff_key'] ?? "";
$cache_life = $tag['cache_life'] ?? '0';
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$sort_type = $this->customBuildVar($sort_type);
$n_status = $this->customBuildVar($n_status);
$n_sex = $this->customBuildVar($n_sex);
$diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life);
$arrDataName = randomString(5);
$strParse = <<<EOT
<?php
\${$arrDataName} = app(\\app\\services\\NovelService::class)->getRankList([
'count' => {$count},
'sort_type' => {$sort_type},
'n_status' => {$n_status},
'n_sex' => {$n_sex},
'diff_key' => {$diff_key},
'cache_life' => {$cache_life}
]);
if (!empty(\${$arrDataName}) && is_array(\${$arrDataName})):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\${$arrDataName} as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
/**
* tagPagerExp
*
* @param array $tag
* @param string $content
* @return void
*/ */
public function tagPagerExp($tag, $content) public function tagPagerExp($tag, $content)
{ {
@@ -97,11 +36,7 @@ EOT;
} }
/** /**
* tagPager * novel 自定义标签
*
* @param array $tag
* @param string $content
* @return void
*/ */
public function tagPager($tag, $content) public function tagPager($tag, $content)
{ {
@@ -180,11 +115,7 @@ EOT;
} }
/** /**
* tagList * novel 自定义标签
*
* @param array $tag
* @param string $content
* @return void
*/ */
public function tagList($tag, $content) public function tagList($tag, $content)
{ {

View File

@@ -17,7 +17,7 @@ class Site extends TagLib
'nclurl' => ['attr' => 'n_id,n_py,order,page', 'close' => 0], 'nclurl' => ['attr' => 'n_id,n_py,order,page', 'close' => 0],
'nflurl' => ['attr' => 'gender,category,status,order,page', 'close' => 0], 'nflurl' => ['attr' => 'gender,category,status,order,page', 'close' => 0],
'grm' => ['attr' => 'domain,code,line,diff,start,end,index,type', 'close' => 0], 'grm' => ['attr' => 'domain,code,line,diff,start,end,index,type', 'close' => 0],
'replace' => ['attr' => 'code', 'close' => 0], 'replace' => ['attr' => 'code,diff', 'close' => 0],
'forgelist' => ['attr' => 'count,diff_key,cache_life,d_key,d_val', 'close' => 1], 'forgelist' => ['attr' => 'count,diff_key,cache_life,d_key,d_val', 'close' => 1],
]; ];
@@ -253,10 +253,10 @@ EOD;
*/ */
public function tagNFLUrl($tag) public function tagNFLUrl($tag)
{ {
$strGender = isset($tag['gender']) ? $tag['gender'] : 'all'; $strGender = isset($tag['gender']) ? $tag['gender'] : '';
$strCategory = isset($tag['category']) ? $tag['category'] : 'all'; $strCategory = isset($tag['category']) ? $tag['category'] : 'all';
$strStatus = isset($tag['status']) ? $tag['status'] : 'all'; $strStatus = isset($tag['status']) ? $tag['status'] : 'all';
$strOrder = isset($tag['order']) ? $tag['order'] : 'all'; $strOrder = isset($tag['order']) ? $tag['order'] : '';
$intPage = isset($tag['page']) ? $tag['page'] : 1; $intPage = isset($tag['page']) ? $tag['page'] : 1;
$strGender = $this->customBuildVar($strGender); $strGender = $this->customBuildVar($strGender);
@@ -311,10 +311,13 @@ EOD;
public function tagReplace($tag) public function tagReplace($tag)
{ {
$strCode = isset($tag['code']) ? $tag['code'] : ''; $strCode = isset($tag['code']) ? $tag['code'] : '';
$strDiff = isset($tag['diff']) ? $tag['diff'] : '0';
// $strCode = $this->customBuildVar($strCode);
$strDiff = $this->customBuildVar($strDiff);
$strParse = <<<EOD $strParse = <<<EOD
<?php <?php
\$strUrl = app(\\app\\services\\SiteContext::class)->converterTemplate("{$strCode}"); \$strUrl = app(\\app\\services\\SiteContext::class)->converterTemplate("{$strCode}",{$strDiff});
echo \$strUrl; echo \$strUrl;
?> ?>
EOD; EOD;
@@ -322,7 +325,6 @@ EOD;
} }
/** /**
* get grm * get grm
* *
@@ -341,10 +343,7 @@ EOD;
$page_code = $this->customBuildVar($page_code); $page_code = $this->customBuildVar($page_code);
$diff = $this->customBuildVar($diff); $diff = $this->customBuildVar($diff);
$num = $this->customBuildVar($num); $num = $this->customBuildVar($num);
// var_dump($page_code);
// var_dump($diff);
// var_dump($num);
// exit;
$arrDataName = randomString(5); $arrDataName = randomString(5);
$strParse = <<<EOT $strParse = <<<EOT