debug
This commit is contained in:
@@ -160,20 +160,36 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
switch ($key) {
|
||||
case 'latest':
|
||||
//最新章节
|
||||
Route::get($strRoute, [Novel::class, 'getNovelLatestChapter'])
|
||||
|
||||
$strView = 'pc/getNovelCatalog.html';
|
||||
if ($platform == 'h5') {
|
||||
$strView = 'novel/getNovelCatalog.html';
|
||||
}
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
break;
|
||||
case 'chapter':
|
||||
//章节
|
||||
Route::get($strRoute, [Novel::class, 'getNovelChapter'])
|
||||
|
||||
->pattern(['n_id' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']);
|
||||
$strView = 'pc/getNovelChapter.html';
|
||||
if ($platform == 'h5') {
|
||||
$strView = 'novel/getNovelChapter.html';
|
||||
}
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']);
|
||||
break;
|
||||
|
||||
case 'kan-novel':
|
||||
//伪造小说详情
|
||||
Route::get($strRoute, [Novel::class, 'getKanNovelInfo'])
|
||||
|
||||
$strView = 'pc/getNovelInfo.html';
|
||||
if ($platform == 'h5') {
|
||||
$strView = 'novel/getNovelInfo.html';
|
||||
}
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
break;
|
||||
case 'novel':
|
||||
@@ -243,8 +259,15 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
break;
|
||||
case 'search':
|
||||
//搜素
|
||||
Route::get($strRoute, [Novel::class, 'getSearchNovel'])->ext('html');
|
||||
$strView = 'pc/getSearchNovel.html';
|
||||
if ($platform == 'h5') {
|
||||
$strView = 'novel/getSearchNovel.html';
|
||||
}
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})->ext('html');
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
//用户中心
|
||||
Route::get($strRoute, [User::class, 'Index']);
|
||||
|
||||
@@ -2,12 +2,20 @@
|
||||
{block name="title"}{site:replace code="NOVEL@GETNOVELCHAPTER@TITLE"}{/block}
|
||||
{block name="keywords"}{site:replace code="NOVEL@GETNOVELCHAPTER@KEYWORDS"}{/block}
|
||||
{block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block}
|
||||
|
||||
{block name="head"}
|
||||
|
||||
{site:grm page_code="pc_novel_chapter" diff="$Request.route.intChapterSort" num="100" 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:description" content="{$strDescription??'暂无简介'}" />
|
||||
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}' />
|
||||
<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:image" content="{$arrNovel.n_cover_path ?? ''}" />
|
||||
<meta property="og:site_name" content="{$DomainModel->d_name}" />
|
||||
@@ -15,17 +23,19 @@
|
||||
<meta property="og:novel:author" content="{$arrNovel.n_author ?? ''}">
|
||||
<meta property="og:novel:book_name" content="{$arrNovel.n_name ?? ''}">
|
||||
<meta property="og:novel:read_url"
|
||||
content='https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$$arrChapter[c_sort_num]"/}'>
|
||||
content='https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num"/}'>
|
||||
<meta property="og:novel:status" content="{$arrNovel.n_status ?? ''}">
|
||||
<meta property="og:novel:update_time" content="{$arrNovel.n_update_time ?? ''}">
|
||||
<meta property="og:novel:latest_chapter_name" content="{$arrChapter.c_name}">
|
||||
<meta property="og:novel:latest_chapter_url"
|
||||
content='https://{$DomainModel->d_domain}{site:lcpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>
|
||||
content='https://{$DomainModel->d_domain}{site:lcpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
||||
<!-- 可选:支持 Twitter Card -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" />
|
||||
<meta name="twitter:description" content="{$strDescription ?? '暂无简介'}" />
|
||||
<meta name="twitter:image" content="{$arrNovel.n_cover_path ?? ''}" />
|
||||
|
||||
|
||||
<!-- 结构化数据 -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
@@ -42,18 +52,17 @@
|
||||
"url": "https://{$DomainModel->d_domain}"
|
||||
},
|
||||
"image": "{$arrNovel.n_cover_path ?? ''}",
|
||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrChapter[c_sort_num]" c_page="0"/}',
|
||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
||||
"inLanguage": "zh-CN",
|
||||
"genre": "{$arrNovel.n_category ??''}",
|
||||
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
||||
"hasPart": {
|
||||
"@type": "CreativeWork",
|
||||
"name": "{$arrChapter.c_name ?? ''}",
|
||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrChapter[c_sort_num]" c_page="0"/}',
|
||||
"description": "{$strDescription}"
|
||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
||||
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
@@ -82,19 +91,19 @@
|
||||
</li>
|
||||
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<?php $arrNovel['n_category_pinyin'] ?? $arrNovel['n_category_pinyin'] = 'all'?>
|
||||
<a href='{site:nflurl gender="" category="$arrNovel[n_category_pinyin]" order="all" status="all" page="1"/}' itemprop="item">
|
||||
<a href='{site:nflurl gender="" category="$arrNovel.n_category_pinyin" order="all" status="all" page="1"/}' itemprop="item">
|
||||
<span itemprop="name">{$arrNovel.n_category}</span>
|
||||
</a>
|
||||
<meta itemprop="position" content="2" />
|
||||
</li>
|
||||
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a href='{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}' itemprop="item">
|
||||
<a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}' itemprop="item">
|
||||
<span itemprop="name">{$arrNovel['n_name']}</span>
|
||||
</a>
|
||||
<meta itemprop="position" content="3" />
|
||||
</li>
|
||||
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a href='{site:nclurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" order="zheng" page="1"/}' itemprop="item">
|
||||
<a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}' itemprop="item">
|
||||
<span itemprop="name">{$arrChapter.c_name ?? ''}</span>
|
||||
</a>
|
||||
<meta itemprop="position" content="3" />
|
||||
@@ -125,13 +134,13 @@
|
||||
<li><a href='javascript:'>上一页</a></li>
|
||||
{else}
|
||||
<li><a
|
||||
href='{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrPreChapter[c_sort_num]" c_page="$arrPreChapter[c_page]"/}'>上一页</a>
|
||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||
</li>
|
||||
{/if}
|
||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" order="zheng" page="1"/}'>章节目录</a></li>
|
||||
{if $arrNextChapter && $arrNextChapter.c_sort_num}
|
||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||
<li><a
|
||||
href='{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrNextChapter[c_sort_num]" c_page="$arrNextChapter[c_page]"/}'>下一页</a>
|
||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
@@ -147,13 +156,13 @@
|
||||
<li><a href='javascript:'>上一页</a></li>
|
||||
{else}
|
||||
<li><a
|
||||
href='{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrPreChapter[c_sort_num]" c_page="$arrPreChapter[c_page]"/}'>上一页</a>
|
||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||
</li>
|
||||
{/if}
|
||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" order="zheng" page="1"/}'>章节目录</a></li>
|
||||
{if $arrNextChapter && $arrNextChapter.c_sort_num}
|
||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||
<li><a
|
||||
href='{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrNextChapter[c_sort_num]" c_page="$arrNextChapter[c_page]"/}'>下一页</a>
|
||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
@@ -163,22 +172,23 @@
|
||||
<div class="wrap-box">
|
||||
<h3 class="wrap-title"><span>完结推荐</span></h3>
|
||||
<div class="rec-focus">
|
||||
{foreach $arrEndNovel as $key=>$Novel }
|
||||
{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">
|
||||
<dt class="book-img"><a
|
||||
href='{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'><img
|
||||
href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'><img
|
||||
height="100" width="80" class="lazyload-img" src="/static/img/default.jpg"
|
||||
data-src="{$Novel.n_cover_path ?? ''}"
|
||||
alt="{$Novel.n_name ?? ''} - {$Novel.n_category ?? ''}最新章节在线免费阅读"></a></dt>
|
||||
<dd class="book-info">
|
||||
<h2><a
|
||||
href='{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>{$Novel.n_name}</a>
|
||||
href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>{$Novel.n_name}</a>
|
||||
</h2>
|
||||
<p>作者:{$Novel.n_author}</p>
|
||||
<p>{$Novel.n_description}</p>
|
||||
</dd>
|
||||
</dl>
|
||||
{/foreach}
|
||||
{/novel:list}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -186,17 +196,17 @@
|
||||
<h3 class="wrap-title"><span>相邻小说</span></h3>
|
||||
<div class="description" style="font-size: 12px;padding:0px 10px 10px 10px; text-indent: 15px;">
|
||||
|
||||
{$strFocus ?? ""} 。看小说就来{$DomainModel->d_name} {$DomainModel->d_domain}...
|
||||
{$arrNovel.strFocus ?? ""} 。看小说就来{$DomainModel->d_name} {$DomainModel->d_domain}...
|
||||
</div>
|
||||
<div class="rec-focus" style="font-size:12px;">
|
||||
{volist name='arrRelateveNovel' id='Novel'}
|
||||
{volist name='arrNovel.arrRelateveNovel' id='Novel'}
|
||||
<a
|
||||
href='{site:nurl n_id="$Novel[n_id]" n_py="$Novel[n_name_pinyin]" /}'>{$Novel.n_name}</a>
|
||||
href='{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>
|
||||
{/volist}
|
||||
|
||||
{volist name='arrNovel.n_forge_novel' id='ForgeNovel'}
|
||||
{volist name="arrNovel.n_forge_novel" id="ForgeNovel" key="key"}
|
||||
<a
|
||||
href='{site:nnurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" n_fid="$ForgeNovel[n_forge_id]"/}'>{$ForgeNovel.n_forge_title}</a>
|
||||
href='{site:nnurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" n_fid="$ForgeNovel.n_forge_id"/}'>{$ForgeNovel.n_forge_title}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{block name="description"}{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}{/block}
|
||||
{block name="head"}
|
||||
{novel:info n_id="$Request.route.intNovelId" n_key="arrNovel" n_forge_id="0" /}
|
||||
{site:grm page_code="pc_novel_info" diff="$arrNovel.n_id" num="100" g_key="arrGrm" /}
|
||||
{site:grm page_code="pc_novel_catalog" diff="$arrNovel.n_id" num="100" g_key="arrGrm" /}
|
||||
<!-- 社交媒体标签 -->
|
||||
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
|
||||
<meta property="og:description" content="{$strDescription??'暂无简介'}" />
|
||||
|
||||
@@ -4,10 +4,16 @@
|
||||
{block name="description"}{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}{/block}
|
||||
|
||||
{block name="head"}
|
||||
{site:grm page_code="pc_novel_chapter" diff="$Request.route.intChapterSort" num="100" 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:description" content="{$strDescription??'暂无简介'}" />
|
||||
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}' />
|
||||
<meta property="og:url"
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}' />
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}' />
|
||||
<meta property="og:type" content="book" />
|
||||
<meta property="og:image" content="{$arrNovel.n_cover_path ?? ''}" />
|
||||
<meta property="og:site_name" content="{$DomainModel->d_name}" />
|
||||
@@ -15,18 +21,18 @@
|
||||
<meta property="og:novel:author" content="{$arrNovel.n_author ?? ''}">
|
||||
<meta property="og:novel:book_name" content="{$arrNovel.n_name ?? ''}">
|
||||
<meta property="og:novel:read_url"
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$$arrChapter[c_sort_num]"/}'>
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num"/}'>
|
||||
<meta property="og:novel:status" content="{$arrNovel.n_status ?? ''}">
|
||||
<meta property="og:novel:update_time" content="{$arrNovel.n_update_time ?? ''}">
|
||||
<meta property="og:novel:latest_chapter_name" content="{$arrChapter.c_name}">
|
||||
<meta property="og:novel:latest_chapter_url"
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:lcpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>
|
||||
content='https://{$DomainModel->d_domain}{$strPcPath}{site:lcpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
||||
<!-- 可选:支持 Twitter Card -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{$arrNovel['n_name']??'未知小说'} {$arrChapter.c_name} - {$DomainModel->d_name}" />
|
||||
<meta name="twitter:description" content="{$strDescription ?? '暂无简介'}" />
|
||||
<meta name="twitter:image" content="{$arrNovel.n_cover_path ?? ''}" />
|
||||
<!-- 结构化数据 -->
|
||||
|
||||
<!-- 结构化数据 -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
@@ -43,23 +49,24 @@
|
||||
"url": "https://{$DomainModel->d_domain}"
|
||||
},
|
||||
"image": "{$arrNovel.n_cover_path ?? ''}",
|
||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrChapter[c_sort_num]" c_page="0"/}',
|
||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
||||
"inLanguage": "zh-CN",
|
||||
"genre": "{$arrNovel.n_category ??''}",
|
||||
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
||||
"hasPart": {
|
||||
"@type": "CreativeWork",
|
||||
"name": "{$arrChapter.c_name ?? ''}",
|
||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrChapter[c_sort_num]" c_page="0"/}',
|
||||
"description": "{$strDescription}"
|
||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
||||
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="head-css"}
|
||||
<link rel="canonical"
|
||||
href='https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrChapter[c_sort_num]"/}'>
|
||||
href='https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num"/}'>
|
||||
{/block}
|
||||
|
||||
{block name="head-js"}
|
||||
@@ -76,7 +83,8 @@
|
||||
<div class="layout layout-col1">
|
||||
<h2 class="layout-tit xs-hidden">
|
||||
<a href="{$strPcPath}/">{$DomainModel->d_name}</a>><a
|
||||
href='{$strPcPath}{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>{$arrNovel.n_name}</a> >
|
||||
href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>{$arrNovel.n_name}</a>
|
||||
>
|
||||
{$arrNovel.n_name}(第{$arrChapter.c_sort_num}页)
|
||||
</h2>
|
||||
<div class="word_read">
|
||||
@@ -87,15 +95,16 @@
|
||||
{else}
|
||||
{$arrGrm[10]|raw}
|
||||
<a id="j_chapterPrev"
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrPreChapter[c_sort_num]" c_page="$arrPreChapter[c_page]"/}'>上一页</a>
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||
{/if}
|
||||
<span>|</span>
|
||||
<a href='{site:nclurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" order="zheng" page="1"/}'>章节目录</a>
|
||||
<a
|
||||
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
||||
<span>|</span>
|
||||
{if $arrNextChapter && $arrNextChapter.c_sort_num}
|
||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||
{$arrGrm[9]|raw}
|
||||
<a id="j_chapterNext"
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrNextChapter[c_sort_num]" c_page="$arrNextChapter[c_page]"/}'>下一页</a>
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -105,16 +114,14 @@
|
||||
|
||||
<p>相邻推荐:
|
||||
{volist name="arrNovel.n_forge_novel" id="ForgeNovel" key="key"}
|
||||
{if $key<19 }
|
||||
{$arrGrm[$key+9]|raw}
|
||||
{/if}
|
||||
<a
|
||||
href='{$strPcPath}{site:nnurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" n_fid="$ForgeNovel[n_forge_id]"/}'
|
||||
{if $key<19 } {$arrGrm[$key+9]|raw} {/if} <a
|
||||
href='{$strPcPath}{site:nnurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" n_fid="$ForgeNovel.n_forge_id"/}'
|
||||
class="red">{$ForgeNovel.n_forge_title}</a>
|
||||
{/volist}
|
||||
|
||||
{volist name='arrRelateveNovel' id='Novel'}
|
||||
<a href='{$strPcPath}{site:nurl n_id="$Novel[n_id]" n_py="$Novel[n_name_pinyin]" /}'>{$Novel.n_name}</a>
|
||||
{volist name='arrNovel.arrRelateveNovel' id='Novel'}
|
||||
<a
|
||||
href='{$strPcPath}{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>
|
||||
{/volist}
|
||||
|
||||
</p>
|
||||
@@ -124,15 +131,16 @@
|
||||
{else}
|
||||
{$arrGrm[10]|raw}
|
||||
<a id="j_chapterPrev"
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrPreChapter[c_sort_num]" c_page="$arrPreChapter[c_page]"/}'>上一页</a>
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||
{/if}
|
||||
<span>|</span>
|
||||
<a href='{site:nclurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" order="zheng" page="1"/}'>章节目录</a>
|
||||
<a
|
||||
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
||||
<span>|</span>
|
||||
{if $arrNextChapter && $arrNextChapter.c_sort_num}
|
||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||
{$arrGrm[9]|raw}
|
||||
<a id="j_chapterNext"
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" c_sort="$arrNextChapter[c_sort_num]" c_page="$arrNextChapter[c_page]"/}'>下一页</a>
|
||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,12 +148,13 @@
|
||||
</div>
|
||||
<div class="row row-section">
|
||||
<h2 class="layout-tit">已完结热门小说推荐</h2>
|
||||
<div class="layout layout-col3">
|
||||
<div class="layout layout-col3">read_btn
|
||||
|
||||
{foreach $arrEndNovel as $key=>$Novel }
|
||||
{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"}
|
||||
<div class="item">
|
||||
<div class="image">
|
||||
<a href='{$strPcPath}{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>
|
||||
<a href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
||||
<img style="min-height:120px;" class="lazyload-img" src="/static/img/default.jpg"
|
||||
data-src="{$Novel.n_cover_path ?? ''}"
|
||||
alt="{$Novel.n_name ?? ''} - {$Novel.n_category ?? ''}最新章节在线免费阅读">
|
||||
@@ -153,13 +162,15 @@
|
||||
</div>
|
||||
<dl>
|
||||
<dt><span>{$Novel.n_author}</span><a
|
||||
href='{$strPcPath}{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'>{$Novel.n_name}</a></dt>
|
||||
<dd style="height:90px"><a href='{$strPcPath}{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[n_name_pinyin]" /}'
|
||||
href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>{$Novel.n_name}</a></dt>
|
||||
<dd style="height:90px"><a href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'
|
||||
style="color: #555">{$Novel.n_description}</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
|
||||
{/novel:list}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,17 +12,21 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="layout layout3 layout-col3 fl">
|
||||
<h1>{$strSearchKeywords}搜索结果 - {$DomainModel->d_name} 第{$intPage}页</h1>
|
||||
<h1>{$Request.get.keyword}搜索结果 - {$DomainModel->d_name} 第{$Request.get.page}页</h1>
|
||||
<div class="result search_tip">
|
||||
搜索<span style="color:red">“{$strSearchKeywords}”</span>相关结果共有 <span
|
||||
style="color:red">{$arrPage.total}</span> 部小说
|
||||
搜索<span style="color:red">“{$Request.get.keyword}”</span>相关结果共有 <span
|
||||
style="color:red">{$total}</span> 部小说
|
||||
</div>
|
||||
{if empty($arrPage.data)}
|
||||
{if $total <1}
|
||||
<p style="text-align: center;line-height: 60px">没有相关数据</p>
|
||||
{else}
|
||||
<div class="layout layout-col3">
|
||||
|
||||
{foreach $arrPage.data as $key=>$Novel}
|
||||
{novel:pager page="$Request.get.page" limit="30"
|
||||
key="$Request.get.keyword"
|
||||
d_key="d_key"
|
||||
d_val="Novel" n_num="total"
|
||||
p_val="page_data" button_num="10" cache_life="86400" func="generateSearchPager"}
|
||||
<div class="item">
|
||||
<div class="image">
|
||||
<a href='{$strPcPath}{site:nurl n_id="$Novel[n_id]" n_py="$Novel[n_name_pinyin]" /}'>
|
||||
@@ -40,7 +44,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/novel:pager}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -51,17 +55,17 @@
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="row sort_page_num">
|
||||
{volist name="arrPaginator" id="vo" key="k"}
|
||||
{volist name="page_data" id="vo" key="k"}
|
||||
{switch $vo.label}
|
||||
{case value="上一页"}
|
||||
{if $intPage == 1}
|
||||
{if $Request.get.page == 1}
|
||||
<span>«</span>
|
||||
{else}
|
||||
<a href="{$strPcPath}{$vo.url}">«</a>
|
||||
{/if}
|
||||
{/case}
|
||||
{case value="下一页"}
|
||||
{if $intPage >= $intTotalPage}
|
||||
{if $Request.get.page >= $total}
|
||||
<span>»</span>
|
||||
{else}
|
||||
<a href="{$strPcPath}{$vo.url}">»</a>
|
||||
|
||||
@@ -244,7 +244,7 @@ class ChapterService
|
||||
|
||||
$arrChapter['pre_chapter'] = $arrPreChapter;
|
||||
$arrChapter['next_chapter'] = $arrNextChapter;
|
||||
|
||||
// var_dump($arrChapter['c_name']);exit;
|
||||
// 更新值
|
||||
ConverterMovel::setVal([
|
||||
'intPage' => 1,
|
||||
|
||||
@@ -417,7 +417,7 @@ class NovelService
|
||||
}
|
||||
|
||||
# n_category_sex_zh filter
|
||||
if (!empty($strKey)) {
|
||||
if (!empty($strNSex)) {
|
||||
|
||||
$strKey = mb_substr($strKey, 0, 30);
|
||||
$arrFilter['$and'][] = [
|
||||
@@ -454,10 +454,6 @@ class NovelService
|
||||
$strCacheKey = '';
|
||||
$intLifeTime = 0;
|
||||
|
||||
if (empty($arrFilter['$and'])) {
|
||||
$arrFilter = [];
|
||||
}
|
||||
|
||||
# cache filter
|
||||
if ($intCacheLifeTime > 0) {
|
||||
$strCacheKey = sprintf(
|
||||
|
||||
@@ -157,6 +157,7 @@ EOT;
|
||||
{$c_page}
|
||||
);
|
||||
|
||||
|
||||
\${$c_key} = \$arrChapter ?? [];
|
||||
?>
|
||||
EOT;
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
$sort_type ?? "all"; # 排序方式
|
||||
$n_status ?? "all"; # 查询状态
|
||||
$n_sex ?? "all"; # 查询性别
|
||||
$key ?? ""; # 查询 搜索
|
||||
$button_num ?? "10"; # 分页按钮数量
|
||||
$diff_key ?? ""; # 缓存键值差异
|
||||
$cache_life ?? '0'; # 缓存时间,如果需要开启缓存,这个字段必须传,而且必须大于0
|
||||
@@ -115,7 +116,7 @@
|
||||
$d_val ?? 'd_val'; # 查询出来的数据遍历的时候, 值的名称
|
||||
$p_val ?? 'p_val'; # 分页页码数据,这是一个数组。和之前控制器渲染的那个数组一致的。
|
||||
$n_num ?? 'n_num'; # 数据总量。和之前控制器渲染的那个 intTotalPage 一致的。
|
||||
$func ; # 这个参数是一个回调方法名,用来渲染分页页码数据的,该方法需要在 NovelService 类里面实现,func(array $arrParams, array $arrSort, array $arrNovel)
|
||||
$func ; # 这个参数是一个回调方法名,用来渲染分页页码数据的,该方法需要在 NovelService 类里面实现,func(array $arrParams, array $arrSort, array $arrNovel) generateCategoryPager generateSearchPager
|
||||
# 样例
|
||||
{novel:pager page="1" limit="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data" button_num="3" cache_life="1000" func="generateSearchPager"}
|
||||
<li>
|
||||
@@ -201,23 +202,15 @@
|
||||
{/chapter:list}
|
||||
|
||||
|
||||
# 10、 获取指定小说多个章节数据并且遍历
|
||||
# 10、 获取小说章节详情数据
|
||||
# 传参与默认值(传参用下面的变量名,名称不需要$符号, 值的话如果用第三方变量作为值,需要带$符号):
|
||||
$count ?? '10'; # 查询条数
|
||||
$n_id ; # 小说ID
|
||||
$sort_type ?? "all"; # 排序方式
|
||||
$diff_key ?? ""; # 缓存键值差异
|
||||
$cache_life ?? '0'; # 缓存时间,如果需要开启缓存,这个字段必须传,而且必须大于0
|
||||
$d_key ?? 'd_key'; # 查询出来的数据遍历的时候, 下标键变量的名称
|
||||
$d_val ?? 'd_val'; # 查询出来的数据遍历的时候, 值的名称
|
||||
$n_id ; # 传入的小说ID
|
||||
$c_sort_num ; # 传入的章节索引
|
||||
$c_page ; # 传入的章节页码
|
||||
$n_key ; # 查询出来的数据待使用的变量名称
|
||||
# 样例
|
||||
{chapter:list count="10" n_id="$Request.get.n_id" d_key="d_key" d_val="chapter" cache_life="1000"}
|
||||
<li>
|
||||
Index: {$d_key}
|
||||
章节名称: {$chapter.c_name}
|
||||
章节序号: {$chapter.c_sort_num}
|
||||
</li>
|
||||
{/chapter:list}
|
||||
{chapter:info n_id="1" c_sort_num="200" c_page="0" c_key="arrChapter01" /}
|
||||
{$arrChapter01.c_name}
|
||||
|
||||
|
||||
# 11、 获取指定小说分页数据并且遍历
|
||||
|
||||
Reference in New Issue
Block a user