debug
This commit is contained in:
@@ -218,7 +218,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
|
||||
break;
|
||||
|
||||
case 'chapter':
|
||||
@@ -242,7 +242,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
->pattern(['intNovelId' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
break;
|
||||
|
||||
case 'novel':
|
||||
@@ -254,7 +254,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
|
||||
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
|
||||
|
||||
break;
|
||||
case 'catalog':
|
||||
@@ -266,7 +266,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
Route::get($strRoute, function () use ($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;
|
||||
case 'library':
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
{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="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
|
||||
{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="h5_novel_catalog " diff="$Request.url" num="120" g_key="arrGrm" /}
|
||||
|
||||
<!-- 社交媒体标签 -->
|
||||
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
|
||||
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' />
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
{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="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="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}" />
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
$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}
|
||||
{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" 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: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"
|
||||
content='https://{$DomainModel->d_domain}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}' />
|
||||
<meta property="og:type" content="book" />
|
||||
@@ -35,7 +37,8 @@ $Novel.n_id{extend name="baseH5" /}
|
||||
<!-- 可选:支持 Twitter Card -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<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 ?? ''}" />
|
||||
<!-- 结构化数据 -->
|
||||
<script type="application/ld+json">
|
||||
@@ -90,6 +93,8 @@ $Novel.n_id{extend name="baseH5" /}
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
{block name="head-js"}
|
||||
{/block}
|
||||
|
||||
@@ -112,7 +117,8 @@ $Novel.n_id{extend name="baseH5" /}
|
||||
</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 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>
|
||||
</a>
|
||||
<meta itemprop="position" content="2" />
|
||||
@@ -184,7 +190,8 @@ $Novel.n_id{extend name="baseH5" /}
|
||||
<h3 class="wrap-title">章节列表</h3>
|
||||
<div class="block-box">
|
||||
<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>
|
||||
{$arrGrm[$d_key+10]|raw}
|
||||
<a
|
||||
@@ -199,14 +206,16 @@ $Novel.n_id{extend name="baseH5" /}
|
||||
<div class="wrap-box">
|
||||
<h3 class="wrap-title"><span>完结推荐</span></h3>
|
||||
<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">
|
||||
<dt class="book-img">
|
||||
{$arrGrm[$d_key+110]|raw}
|
||||
<a 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"
|
||||
<a 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>
|
||||
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>
|
||||
</h2>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{extend name="basePc" /}
|
||||
|
||||
{block name="title"}{site:replace code="NOVEL@GETLIBRARY@TITLE"}{/block}
|
||||
{block name="keywords"}{site:replace code="NOVEL@GETLIBRARY@KEYWORDS"}{/block}
|
||||
{block name="description"}{site:replace code="NOVEL@GETLIBRARY@DESCRIPTION"}{/block}
|
||||
|
||||
{block name="head"}
|
||||
<!-- 社交媒体标签 -->
|
||||
<meta property="og:title" content='{site:replace code="NOVEL@GETLIBRARY@TITLE"}' />
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
{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="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
|
||||
{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_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
|
||||
|
||||
<!-- 社交媒体标签 -->
|
||||
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
|
||||
<meta property="og:description" content='{site:replace code="NOVEL@GETNOVELCATALOG@DESCRIPTION"}' />
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{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="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.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}" />
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
{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="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block}
|
||||
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block}
|
||||
|
||||
{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:description" content='{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}' />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="robots" content="index, follow" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html data-dpr="1" style="font-size: 39px;">
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
{block name="get-data"}{/block}
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
{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="keywords"}{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS"}{/block}
|
||||
{block name="description"}{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION"}{/block}
|
||||
|
||||
{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" /}
|
||||
|
||||
|
||||
|
||||
<!-- 社交媒体标签 -->
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{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="keywords"}{site:replace code="NOVEL@GETNOVELCATALOG@KEYWORDS"}{/block}
|
||||
{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_catalog" diff="$Request.url" num="120" g_key="arrGrm" /}
|
||||
|
||||
<!-- 社交媒体标签 -->
|
||||
<meta property="og:title" content="{$arrNovel['n_name']??'未知小说'}" />
|
||||
|
||||
@@ -158,12 +158,13 @@ class NovelService
|
||||
{
|
||||
$strKey = 'CATEGORY_INFO_URL';
|
||||
$strUrl = $this->getPageUrl($strKey, [
|
||||
'strGender' => $strGender ?? 'all',
|
||||
'strCategory' => $strCategory ?? 'all',
|
||||
'strStatus' => $strStatus ?? 'all',
|
||||
'strOrder' => $strOrder ?? 'all',
|
||||
'strGender' => !empty($strGender) ? $strGender : '',
|
||||
'strCategory' => !empty($strCategory) ? $strCategory : 'all',
|
||||
'strStatus' => !empty($strStatus) ? $strStatus : 'all',
|
||||
'strOrder' => !empty($strOrder) ? $strOrder : 'all',
|
||||
'intPage' => $intPage ?? 1,
|
||||
]);
|
||||
|
||||
$strUrl = preg_replace('#/{2,}#', '/', $strUrl);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
@@ -637,6 +638,7 @@ class NovelService
|
||||
$intTotal = $arrNovel['total'] ?? 0;
|
||||
$intButtomNum = $arrParams['button_num'];
|
||||
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}');
|
||||
|
||||
$arrPaginator = CusteomPage02::generate($intPage, $intTotal, $intLimit, $strBaseUrl, $intButtomNum);
|
||||
|
||||
return $arrPaginator;
|
||||
|
||||
@@ -155,15 +155,17 @@ class SiteContext
|
||||
* 变量转换
|
||||
*
|
||||
* @param string $strCode
|
||||
* @param string $strDiff
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取干扰码
|
||||
*
|
||||
|
||||
@@ -7,7 +7,7 @@ use think\template\TagLib;
|
||||
class Novel extends TagLib
|
||||
{
|
||||
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],
|
||||
'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],
|
||||
@@ -15,8 +15,6 @@ class Novel extends TagLib
|
||||
'status' => ['attr' => 'd_key,d_val'],
|
||||
'sex' => ['attr' => 'd_key,d_val'],
|
||||
'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)
|
||||
@@ -29,67 +27,8 @@ class Novel extends TagLib
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* tagRankList
|
||||
*
|
||||
* @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
|
||||
* novel 自定义标签
|
||||
*/
|
||||
public function tagPagerExp($tag, $content)
|
||||
{
|
||||
@@ -97,11 +36,7 @@ EOT;
|
||||
}
|
||||
|
||||
/**
|
||||
* tagPager
|
||||
*
|
||||
* @param array $tag
|
||||
* @param string $content
|
||||
* @return void
|
||||
* novel 自定义标签
|
||||
*/
|
||||
public function tagPager($tag, $content)
|
||||
{
|
||||
@@ -180,11 +115,7 @@ EOT;
|
||||
}
|
||||
|
||||
/**
|
||||
* tagList
|
||||
*
|
||||
* @param array $tag
|
||||
* @param string $content
|
||||
* @return void
|
||||
* novel 自定义标签
|
||||
*/
|
||||
public function tagList($tag, $content)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class Site extends TagLib
|
||||
'nclurl' => ['attr' => 'n_id,n_py,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],
|
||||
'replace' => ['attr' => 'code', 'close' => 0],
|
||||
'replace' => ['attr' => 'code,diff', 'close' => 0],
|
||||
|
||||
'forgelist' => ['attr' => 'count,diff_key,cache_life,d_key,d_val', 'close' => 1],
|
||||
];
|
||||
@@ -253,10 +253,10 @@ EOD;
|
||||
*/
|
||||
public function tagNFLUrl($tag)
|
||||
{
|
||||
$strGender = isset($tag['gender']) ? $tag['gender'] : 'all';
|
||||
$strGender = isset($tag['gender']) ? $tag['gender'] : '';
|
||||
$strCategory = isset($tag['category']) ? $tag['category'] : '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;
|
||||
|
||||
$strGender = $this->customBuildVar($strGender);
|
||||
@@ -311,10 +311,13 @@ EOD;
|
||||
public function tagReplace($tag)
|
||||
{
|
||||
$strCode = isset($tag['code']) ? $tag['code'] : '';
|
||||
$strDiff = isset($tag['diff']) ? $tag['diff'] : '0';
|
||||
|
||||
// $strCode = $this->customBuildVar($strCode);
|
||||
$strDiff = $this->customBuildVar($strDiff);
|
||||
$strParse = <<<EOD
|
||||
<?php
|
||||
\$strUrl = app(\\app\\services\\SiteContext::class)->converterTemplate("{$strCode}");
|
||||
\$strUrl = app(\\app\\services\\SiteContext::class)->converterTemplate("{$strCode}",{$strDiff});
|
||||
echo \$strUrl;
|
||||
?>
|
||||
EOD;
|
||||
@@ -322,7 +325,6 @@ EOD;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* get grm
|
||||
*
|
||||
@@ -341,10 +343,7 @@ EOD;
|
||||
$page_code = $this->customBuildVar($page_code);
|
||||
$diff = $this->customBuildVar($diff);
|
||||
$num = $this->customBuildVar($num);
|
||||
// var_dump($page_code);
|
||||
// var_dump($diff);
|
||||
// var_dump($num);
|
||||
// exit;
|
||||
|
||||
$arrDataName = randomString(5);
|
||||
|
||||
$strParse = <<<EOT
|
||||
|
||||
Reference in New Issue
Block a user