This commit is contained in:
make
2025-04-12 22:45:39 +08:00
parent 23b082e3c1
commit f740eed79f
14 changed files with 310 additions and 835 deletions

View File

@@ -105,17 +105,21 @@ class Novel extends BaseController
$boolIsMobile = $Request->param('boolIsMobile');
$strChannel = $Request->param('strChannel') ?? 'all';
$strNanUrlTemp = $this->request->DomainModel->getFomartSubject('NAN_SHENG_URL','',false);
$strNvUrlTemp = $this->request->DomainModel->getFomartSubject('NV_SHENG_URL','',false);
$strNanUrl = str_replace("/", "", $strNanUrlTemp);
$strNvUrl = str_replace("/", "", $strNvUrlTemp);
// 性别
$arrSex = [
'all' => 0,
'nansheng-xiaoshuo' => 1,
'nvsheng-xiaoshuo' => 1,
$strNanUrl => 1,
$strNvUrl => 1,
];
$arrSexChinese = [
'all' => '',
'nansheng-xiaoshuo' => '男生',
'nvsheng-xiaoshuo' => '女生',
$strNanUrl => '男生',
$strNvUrl => '女生',
];
if (!key_exists($strGender, $arrSex)) {
@@ -199,6 +203,8 @@ class Novel extends BaseController
'strSearchCategory' => $strSearchCategory,
'strSearchStatus' => $strSearchStatus,
'strNovelSex' => $arrSexChinese[$strGender],
'strNanUrl' => $strNanUrl,
'strNvUrl' => $strNvUrl,
'strChannel' => $strChannel,
'strTitle' => $strTitle,
'strKeywords' => $strKeywords,
@@ -394,6 +400,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) {
@@ -433,9 +446,9 @@ class Novel extends BaseController
'strNovelDescription' => $arrNovel['og_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@DESCRIPTION');
$strTitleTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@TITLE',$intForgeId);
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@KEYWORDS',$intForgeId);
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@DESCRIPTION',$intForgeId);
$strTitle = ConverterMovel::convert($strTitleTemplate);
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
@@ -453,6 +466,7 @@ class Novel extends BaseController
'arrLatestChapter' => $arrLatestChapter,
'arrNovelClicks' => $arrNovelClicks,
'strFocus' => $strFocus,
'intFirstChapterSort' => $intFirstChapterSort,
'strPageCode' => 'boy',
'strTitle' => $strTitle,
'strKeywords' => $strKeywords,
@@ -535,9 +549,9 @@ class Novel extends BaseController
'strNovelDescription' => $arrNovel['og_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE',$intNId);
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS',$intNId);
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION',$intNId);
$strTitle = ConverterMovel::convert($strTitleTemplate);
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
@@ -613,9 +627,9 @@ class Novel extends BaseController
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@DESCRIPTION');
$strTitleTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@TITLE',$intNId);
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@KEYWORDS',$intNId);
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELCHAPTER@DESCRIPTION',$intNId);
$strTitle = ConverterMovel::convert($strTitleTemplate);
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
@@ -697,9 +711,9 @@ class Novel extends BaseController
'strNovelChapterSort' => $arrChapter['c_sort_num'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE',$intNId);
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS',$intNId);
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION',$intNId);
$strTitle = ConverterMovel::convert($strTitleTemplate);
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
@@ -778,9 +792,9 @@ class Novel extends BaseController
'strNovelDescription' => $arrNovel['og_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE',$intNId);
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS',$intNId);
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION',$intNId);
$strTitle = ConverterMovel::convert($strTitleTemplate);
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);

View File

@@ -15,6 +15,10 @@ class User extends BaseController
{
$boolIsMobile = $Request->param('boolIsMobile');
$strNovelUrlTemp = $Request->DomainModel->getFomartSubject('NOVEL_INFO_URL','',false);
$strNovelChapterUrlTemp = $Request->DomainModel->getFomartSubject('CONTENT_INFO_URL','',false);
$strSearchUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false);
$NovelModel = NovelModel::getInstance();
// 推荐等级为9的完结 随机15个小说
@@ -29,6 +33,9 @@ class User extends BaseController
View::assign([
'arrRecommendEndNovel' => $arrRecommendEndNovel,
'arrMoonRankNovel' => $arrMoonRankNovel,
'strNovelUrlTemp' => $strNovelUrlTemp,
'strNovelChapterUrlTemp' => $strNovelChapterUrlTemp,
'strSearchUrlTemp' => $strSearchUrlTemp,
]);
if ($boolIsMobile) {
@@ -46,8 +53,15 @@ class User extends BaseController
$boolIsMobile = $Request->param('boolIsMobile');
$strNovelUrlTemp = $Request->DomainModel->getFomartSubject('NOVEL_INFO_URL','',false);
$strNovelChapterUrlTemp = $Request->DomainModel->getFomartSubject('CONTENT_INFO_URL','',false);
$strSearchUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false);
View::assign([
'strPageCode' => 'BookShelf'
'strPageCode' => 'BookShelf',
'strNovelUrlTemp' => $strNovelUrlTemp,
'strNovelChapterUrlTemp' => $strNovelChapterUrlTemp,
'strSearchUrlTemp' => $strSearchUrlTemp,
]);
if ($boolIsMobile) {
@@ -65,8 +79,15 @@ class User extends BaseController
$boolIsMobile = $Request->param('boolIsMobile');
$strNovelUrlTemp = $Request->DomainModel->getFomartSubject('NOVEL_INFO_URL','',false);
$strNovelChapterUrlTemp = $Request->DomainModel->getFomartSubject('CONTENT_INFO_URL','',false);
$strSearchUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false);
View::assign([
'strPageCode' => 'history'
'strPageCode' => 'history',
'strNovelUrlTemp' => $strNovelUrlTemp,
'strNovelChapterUrlTemp' => $strNovelChapterUrlTemp,
'strSearchUrlTemp' => $strSearchUrlTemp,
]);
if ($boolIsMobile) {

View File

@@ -7,9 +7,10 @@
<meta property="og:title" content="{$strTitle??''}" />
<meta property="og:description" content="{$strDescription??''}" />
{if $strGender == 'all' && $strCategory == 'all' && $strStatus == 'all'}
<meta property="og:url" content="https://{$DomainModel->d_domain}/shuku/all" />
<meta property="og:url" content="https://{$DomainModel->d_domain}{$strCategoryIndexUrlTemp}" />
{else}
<meta property="og:url" content="https://{$DomainModel->d_domain}/shuku/{$strGender}/{$strCategory}/{$strStatus}/page{$intPage}" />
<meta property="og:url"
content='https://{$DomainModel->d_domain}{site:nflurl gender="$strGender" category="$strCategory" status="$strStatus" page="$intPage"/}' />
{/if}
<meta property="og:type" content="book" />
@@ -17,7 +18,7 @@
{if $strGender == 'all' && $strCategory == 'all' && $strStatus == 'all'}
<script type="application/ld+json">
{
"@context": "https://{$DomainModel->d_domain}/shuku/all",
"@context": "https://{$DomainModel->d_domain}{$strCategoryIndexUrlTemp}",
"@type": "book",
"headline": "{$strTitle??''}",
"description": "{$strDescription??''}",
@@ -27,7 +28,7 @@
{else}
<script type="application/ld+json">
{
"@context": "https://{$DomainModel->d_domain}/shuku/{$strGender}/{$strCategory}/{$strStatus}/page{$intPage}",
"@context": "https://{$DomainModel->d_domain}{site:nflurl gender="$strGender" category="$strCategory" status="$strStatus" page="$intPage"/}",
"@type": "book",
"headline": "{$strTitle??''}",
"description": "{$strDescription??''}",
@@ -69,40 +70,74 @@
<div class="mod mod-nav">
<div id="book-nav" class="book-nav">
<ul class="clearfix">
<li class='{eq name="strGender" value="all"}on {/eq}'><a href='/shuku/all/{$strCategory}/{$strStatus}/page{$intPage}' title="全部">全部</a></li>
<li class='{eq name="strGender" value="nansheng-xiaoshuo"}on {/eq}'><a href='/shuku/nansheng-xiaoshuo/{$strCategory}/{$strStatus}/page{$intPage}' title="男生">男生</a></li>
<li class='{eq name="strGender" value="nvsheng-xiaoshuo"}on {/eq}'><a href='/shuku/nvsheng-xiaoshuo/{$strCategory}/{$strStatus}/page{$intPage}' title="女生">女生</a></li>
<li class='{eq name="strGender" value="all"}on {/eq}'>
<a href='{site:nflurl gender="all" category="$strCategory" status="$strStatus" page="$intPage"/}'
title="全部">全部</a>
</li>
<li class='{eq name="strGender" value="nansheng-xiaoshuo"}on {/eq}'>
<a href='{site:nflurl gender="$strNanUrlTemp" category="$strCategory" status="$strStatus" page="$intPage"/}'
title="男生">男生</a>
</li>
<li class='{eq name="strGender" value="nvsheng-xiaoshuo"}on {/eq}'>
<a href='{site:nflurl gender="$strNvUrlTemp" category="$strCategory" status="$strStatus" page="$intPage"/}'
title="女生">女生</a>
</li>
</ul>
</div>
<div id="book-nav" class="book-nav">
<ul class="clearfix">
<li class='{eq name="strCategory" value="all"}on {/eq}'>
<a href="/shuku/{$strGender}/all/{$strStatus}/page{$intPage}" btn="search_category">全部</a>
<a href='{site:nflurl gender="$strGender" category="all" status="$strStatus" page="$intPage"/}'
btn="search_category">全部</a>
</li>
{eq name="strGender" value="nansheng-xiaoshuo"}
{foreach $arrCategoryAll.man as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}'><a href="/shuku/{$strGender}/{$key}/{$strStatus}/page{$intPage}" btn="search_category">{$vo}</a></li>
{/foreach}
{else}
{foreach $arrCategoryAll.women as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}' ><a href="/shuku/{$strGender}/{$key}/{$strStatus}/page{$intPage}" btn="search_category">{$vo}</a></li>
{/foreach}
{/eq}
{eq name="strGender" value="all"}
{foreach $arrCategoryAll.man as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a>
</li>
{/foreach}
{foreach $arrCategoryAll.women as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a>
</li>
{/foreach}
{/eq}
{eq name="strGender" value="$strNanUrl"}
{foreach $arrCategoryAll.women as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a>
</li>
{/foreach}
{/eq}
{eq name="strGender" value="$strNvUrl"}
{foreach $arrCategoryAll.women as $key=>$vo }
<li class='{eq name="key" value="$strCategory"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a>
</li>
{/foreach}
{/eq}
</ul>
</div>
<div id="book-nav" class="book-nav">
<ul class="clearfix">
<li class='{eq name="strStatus" value="all"}on {/eq}'>
<a href="/shuku/{$strGender}/{$strCategory}/all/page{$intPage}" btn="search_category">全部</a>
<li class='{eq name="strStatus" value="all"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$strCategory" status="all" page="$intPage"/}'
btn="search_category">全部</a>
</li>
<li class='{eq name="strStatus" value="lianzai"}on {/eq}'>
<a href="/shuku/{$strGender}/{$strCategory}/lianzai/page{$intPage}" btn="search_category">连载</a>
<li class='{eq name="strStatus" value="lianzai"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$strCategory" status="lianzai" page="$intPage"/}'
btn="search_category">连载</a>
</li>
<li class='{eq name="strStatus" value="wanjie"}on {/eq}'>
<a href="/shuku/{$strGender}/{$strCategory}/wanjie/page{$intPage}" btn="search_category">完本</a>
<li class='{eq name="strStatus" value="wanjie"}on {/eq}'>
<a href='{site:nflurl gender="$strGender" category="$strCategory" status="wanjie" page="$intPage"/}'
btn="search_category">完本</a>
</li>
</ul>
</div>
@@ -111,7 +146,7 @@
<div class="book-list">
<ul class="clearfix">
{volist name="arrNovel" id="Novel" key="key"}
{include file="Public/novelListH" start="0"/}
{include file="Public/novelListH" start="0"/}
{/volist}
</ul>
</div>
@@ -119,22 +154,22 @@
<div class="pages">
<ul class="pager">
{volist name="arrPaginator" id="vo" key="k"}
{switch $vo.label}
{case value="上一页"}
{if $intPage == 1}
<li class="disabled"><span>«</span></li>
{else}
<li><a href="{$vo.url}">«</a></li>
{/if}
{/case}
{case value="下一页"}
{if $intPage >= $intTotalPage}
<li class="disabled"><span>»</span></li>
{else}
<li><a href="{$vo.url}">»</a></li>
{/if}
{/case}
{/switch}
{switch $vo.label}
{case value="上一页"}
{if $intPage == 1}
<li class="disabled"><span>«</span></li>
{else}
<li><a href="{$vo.url}">«</a></li>
{/if}
{/case}
{case value="下一页"}
{if $intPage >= $intTotalPage}
<li class="disabled"><span>»</span></li>
{else}
<li><a href="{$vo.url}">»</a></li>
{/if}
{/case}
{/switch}
{/volist}
</ul>
</div>

View File

@@ -10,10 +10,10 @@
</h3>
</li>
<li class="gx">
<a href='{$strPcPath}/books/{$Novel->og_novel_pin_yin}-{$Novel->n_id}/chapter/latest.html'
<a href='{$strPcPath}{site:lcpurl n_id="$Novel[n_id]" n_py="$Novel[og_novel_pin_yin]" /}'
title="{$Novel->og_novel_latest_chapter_name ?? 'null'}"
>{$Novel->og_novel_latest_chapter_name ?? 'null'}</a></li>
<li class="zz">{$Novel->og_novel_author ?? 'null'}</li>
<li class="zz"><a href="{$strPcPath}{site:souurl key='$Novel[og_novel_author]' p='1'/}">{$Novel->og_novel_author ?? 'null'}</a></li>
<li class="sj">{$Novel->og_novel_update_time ?? 'null'}</li>
</ul>
</li>

View File

@@ -56,6 +56,9 @@
</div>
{$arrGRM[2]|raw}
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
document.addEventListener("DOMContentLoaded", function () {
displayBookshelf()

View File

@@ -54,6 +54,9 @@
</div>
{$arrGRM[3]|raw}
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
document.addEventListener("DOMContentLoaded", function () {
displayHistory()

View File

@@ -56,13 +56,13 @@
</div>
<div class="tabBd">
<ul class="hotBookBd " >
<ul class="hotBookBd ">
{volist name="arrMoonRankNovel" id="Novel" key="key"}
{include file="Pc/Public/endNovelList" start="0"/}
{/volist}
</ul>
</div>
</div>
@@ -76,19 +76,19 @@
{volist name="arrRecommendEndNovel" id="Novel" key="key"}
{$arrGRM[$key]|raw}
<li>
<a href='{$strPcPath}{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}'
alt="{$Novel.og_novel_book_name ?? ''}" title="{$Novel.og_novel_book_name ?? ''}">
<img src="{$Novel.n_cover_path ?? ''}">
<a href='{$strPcPath}{site:nurl n_id="$Novel[n_id]" n_py="$Novel[og_novel_pin_yin]"/}'
title="{$Novel.og_novel_book_name ?? ''}">
<img src="{$Novel.n_cover_path ?? ''}" alt="{$Novel.og_novel_book_name ?? ''}">
</a>
<p>
<a href="/novel/332.html">
<a href='{$strPcPath}{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}'>
<span class="bookName other">{$Novel.og_novel_book_name ?? ''}</span>
</a>
<a href='{site:souurl key="$arrNovel.og_novel_author" p="1"/}'>
<a href='{$strPcPath}{site:souurl key="$Novel[og_novel_author]" p="1"/}'>
<span class="bookStatus other">{$Novel->og_novel_author ?? ''}</span>
</a>
<span class="bookBrief">
{$Novel.og_description ?? ''}</span>
{$Novel.og_description ?? ''}</span>
</p>
</li>
{/volist}
@@ -100,9 +100,12 @@
</div>
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
document.addEventListener("DOMContentLoaded", function () {
displayBookshelfInUser()
displayHistoryInUser()
})
@@ -122,55 +125,59 @@
const DomBookshelfContainer = document.getElementById('bookshelf-ul');
DomBookshelfContainer.innerHTML = ''
arrBookshelf.forEach(book => {
let strNovelUrl = formatNovelUrl(book.og_novel_pin_yin, book.n_id)
let strNovelChapterUrl = formatNovelChapterUrl(book.og_novel_pin_yin, book.n_id, book.c_sort_num)
let strSearchUrl = formatSearchUrl(book.og_novel_author, 1)
const bookElement = document.createElement('li');
if (isMobile()) {
bookElement.innerHTML = `
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<a href="${strNovelUrl}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<img src="${book.n_cover_path}">
</a>
<p>
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strNovelUrl}" >
<span class="bookName">${book.og_novel_book_name}</span>
</a>
<span class="bookStatus">
<b class="authorSt"><em>${book.og_novel_status}</em>
<a href='{site:souurl key="$arrNovel.og_novel_author" p="1"/}'>
<a href='${strSearchUrl}'>
<em class="none">${book.og_novel_author}</em>
</a>
</b>
<b class="authorSt chapterSt">
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strNovelChapterUrl}" >
<em class="ct">${book.c_name}</em>
</a>
<em class="time">${book.og_novel_update_time}</em></b>
</span>
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strNovelChapterUrl}" >
<i class="goon">阅读</i>
</a>
</p>
`;
} else {
bookElement.innerHTML = `
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<a href="${strPcPath}${strNovelUrl}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<img src="${book.n_cover_path}">
</a>
<p>
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strPcPath}${strNovelUrl}" >
<span class="bookName">${book.og_novel_book_name}</span>
</a>
<span class="bookStatus">
<b class="authorSt"><em>${book.og_novel_status}</em>
<a href='{site:souurl key="$arrNovel.og_novel_author" p="1"/}'>
<a href='${strPcPath}${strSearchUrl}'>
<em class="none">${book.og_novel_author}</em>
</a>
</b>
<b class="authorSt chapterSt">
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strPcPath}${strNovelChapterUrl}" >
<em class="ct">${book.c_name}</em>
</a>
<em class="time">${book.og_novel_update_time}</em></b>
</span>
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strPcPath}${strNovelChapterUrl}" >
<i class="goon">阅读</i>
</a>
</p>
@@ -196,55 +203,58 @@
const DomBookshelfContainer = document.getElementById('history-ul');
DomBookshelfContainer.innerHTML = ''
arrBookshelf.forEach(book => {
let strNovelUrl = formatNovelUrl(book.og_novel_pin_yin, book.n_id)
let strNovelChapterUrl = formatNovelChapterUrl(book.og_novel_pin_yin, book.n_id, book.c_sort_num)
let strSearchUrl = formatSearchUrl(book.og_novel_author, 1)
const bookElement = document.createElement('li');
if (isMobile()) {
bookElement.innerHTML = `
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<a href="${strNovelUrl}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<img src="${book.n_cover_path}">
</a>
<p>
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strNovelUrl}" >
<span class="bookName">${book.og_novel_book_name}</span>
</a>
<span class="bookStatus">
<b class="authorSt"><em>${book.og_novel_status}</em>
<a href='{site:souurl key="$arrNovel.og_novel_author" p="1"/}'>
<a href='${strSearchUrl}'>
<em class="none">${book.og_novel_author}</em>
</a>
</b>
<b class="authorSt chapterSt">
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strNovelChapterUrl}" >
<em class="ct">${book.c_name}</em>
</a>
<em class="time">${book.og_novel_update_time}</em></b>
</span>
<a href="/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strNovelChapterUrl}" >
<i class="goon">阅读</i>
</a>
</p>
`;
} else {
bookElement.innerHTML = `
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<a href="${strPcPath}${strNovelUrl}" alt="${book.og_novel_book_name}" title="${book.og_novel_book_name}">
<img src="${book.n_cover_path}">
</a>
<p>
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strPcPath}${strNovelUrl}" >
<span class="bookName">${book.og_novel_book_name}</span>
</a>
<span class="bookStatus">
<b class="authorSt"><em>${book.og_novel_status}</em>
<a href='{site:souurl key="$arrNovel.og_novel_author" p="1"/}'>
<a href='${strSearchUrl}'>
<em class="none">${book.og_novel_author}</em>
</a>
</b>
<b class="authorSt chapterSt">
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strPcPath}${strNovelChapterUrl}" >
<em class="ct">${book.c_name}</em>
</a>
<em class="time">${book.og_novel_update_time}</em></b>
</span>
<a href="{$strPcPath}/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >
<a href="${strPcPath}${strNovelChapterUrl}" >
<i class="goon">阅读</i>
</a>
</p>

View File

@@ -85,10 +85,10 @@
<li><a class='{eq name="strGender" value="all"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="all" category="$strCategory" status="$strStatus" page="$intPage"/}'
btn="search_category">全部</a></li>
<li><a class='{eq name="strGender" value="$strNanUrlTemp"}on {/eq}'
<li><a class='{eq name="strGender" value="$strNanUrl"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strNanUrlTemp" category="$strCategory" status="$strStatus" page="$intPage"/}'
btn="search_category">男生</a></li>
<li><a class='{eq name="strGender" value="$strNvUrlTemp"}on {/eq}'
<li><a class='{eq name="strGender" value="$strNvUrl"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strNvUrlTemp" category="$strCategory" status="$strStatus" page="$intPage"/}'
btn="search_category">女生</a></li>
@@ -98,24 +98,34 @@
<span class="optTit">所属分类</span>
<ul>
<li><a class='{eq name="strCategory" value="all"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="all" status="$strStatus" page="$intPage"/}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="all" status="$strStatus" page="$intPage"/}'
btn="search_category">全部</a></li>
{eq name="strGender" value="$strNanUrlTemp"}
{eq name="strGender" value="all"}
{foreach $arrCategoryAll.man as $key=>$vo }
<li><a class='{eq name="key" value="$strCategory"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a></li>
{/foreach}
{else}
{foreach $arrCategoryAll.women as $key=>$vo }
<li><a class='{eq name="key" value="$strCategory"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a></li>
{/foreach}
{/eq}
{eq name="strGender" value="$strNanUrl"}
{foreach $arrCategoryAll.man as $key=>$vo }
<li><a class='{eq name="key" value="$strCategory"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a></li>
{/foreach}
{/eq}
{eq name="strGender" value="$strNvUrl"}
{foreach $arrCategoryAll.women as $key=>$vo }
<li><a class='{eq name="key" value="$strCategory"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$key" status="$strStatus" page="$intPage"/}'
btn="search_category">{$vo}</a></li>
{/foreach}
{/eq}
</ul>
</div>
<div class="optCl">
@@ -125,11 +135,9 @@
href='{$strPcPath}{site:nflurl gender="$strGender" category="$strCategory" status="all" page="$intPage"/}'
btn="search_category">全部</a></li>
<li><a class='{eq name="strStatus" value="lianzai"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$strCategory" status="lianzai" page="$intPage"/}'
btn="search_category">连载</a></li>
<li><a class='{eq name="strStatus" value="wanjie"}on {/eq}'
href='{$strPcPath}{site:nflurl gender="$strGender" category="$strCategory" status="wanjie" page="$intPage"/}'
btn="search_category">完本</a></li>
</ul>
@@ -154,14 +162,14 @@
{if $intPage == 1}
<li class="disabled"><span>«</span></li>
{else}
<li><a href="{$strPcPath}/shuku/{$strGender}/{$strCategory}/{$strStatus}/page{$intPage-1}">«</a></li>
<li><a href="{$strPcPath}{$vo.url}">«</a></li>
{/if}
{/case}
{case value="下一页"}
{if $intPage >= $intTotalPage}
<li class="disabled"><span>»</span></li>
{else}
<li><a href="{$strPcPath}/shuku/{$strGender}/{$strCategory}/{$strStatus}/page{$intPage+1}">»</a></li>
<li><a href="{$strPcPath}{$vo.url}">»</a></li>
{/if}
{/case}
{case value="..."}

View File

@@ -42,6 +42,9 @@
</div>
</div>
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
document.addEventListener("DOMContentLoaded", function () {
displayBookshelf()

View File

@@ -44,6 +44,9 @@
</div>
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
document.addEventListener("DOMContentLoaded", function () {
displayHistory()

View File

@@ -40,7 +40,7 @@
</li>
</ul>
<div class="searchbox">
<form action="/search" method="get">
<form action="{$strSearchIndexUrlTemp}" method="get">
<div class="searchbox-inner">
<input type="text" name="keyword" placeholder="找书" class="searchinput" value="">
<i class="search-icon"></i>

View File

@@ -89,7 +89,7 @@ class TemplateSeeder
'arrSubjectFomart' => [
'{strNovelName} - {strNovelAuthor}- {strNovelCategoryName} - 免费在线阅读 - {strSiteName}',
'{strNovelName} - {strNovelAuthor} - {strSiteName} - 免费阅读',
'《strNovelName}》strNovelName}全文阅读 - {strNovelCategoryName} - {strSiteName}',
'《{strNovelName}》{strNovelName}全文阅读 - {strNovelCategoryName} - {strSiteName}',
'{strNovelName}{strNovelCategoryName} - {strNovelName}阅读 - {strSiteName}',
'{strNovelName}完整版免费阅读 |{strNovelName}最新章节免费阅读 - {strSiteName}',
'{strNovelName}全文免费阅读 | {strNovelName}最新章节更新 - {strSiteName}',
@@ -117,7 +117,6 @@ class TemplateSeeder
'{strNovelName} - {strNovelAuthor}全集 - {strSiteName}免费小说',
'{strNovelName}在线阅读全本 - {strNovelCategoryName} - {strSiteName}',
'{strNovelName}免费小说章节 - {strNovelAuthor}更新 - {strSiteName}',
]
],
'NOVEL@GETNOVELINFO@KEYWORDS' => [
@@ -184,6 +183,29 @@ class TemplateSeeder
'arrSubjectFomart' => [
'{strNovelName} {strNovelChapterName} - {strNovelAuthor} - 免费阅读 - {strSiteName}',
'{strNovelName} {strNovelChapterName} - {strSiteName}',
'「{strNovelName}」第{strNovelChapterSort}章 {strNovelChapterName}最新章节 _ {strNovelChapterName}最新章节列表 - {strSiteName}',
'{strNovelName}_ 第{strNovelChapterSort}章{strNovelChapterName} _ {strNovelName}免费阅读更新 - {strSiteName}',
'{strNovelName}第{strNovelChapterSort}章{strNovelChapterName}{strNovelName}小说免费阅读 - {strSiteName}',
'{strNovelName}免费阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}全集-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}全文阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}无弹窗-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}在线阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}全文免费阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}全集阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}免费阅读全文-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}无弹窗阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'{strNovelName}免费在线阅读-第{strNovelChapterSort}章 {strNovelChapterName}最新章节 - {strSiteName}',
'「{strNovelName}」免费阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」全集_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」全文阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」无弹窗_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」在线阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」全文免费阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」全集阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」免费阅读全文_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」无弹窗阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
'「{strNovelName}」免费在线阅读_第{strNovelChapterSort}章 {strNovelChapterName}最新章节更新 - {strSiteName}',
]
],
'NOVEL@GETNOVELCHAPTER@KEYWORDS' => [
@@ -191,6 +213,15 @@ class TemplateSeeder
'sfg_id' => 17,
'arrSubjectFomart' => [
'{strNovelName}, {strNovelChapterName}, {strNovelAuthor}, {strSiteKeywords}, 免费阅读, {strSiteName}',
'{strNovelName}, {strNovelAuthor}, {strNovelCategoryName}, {strNovelSex}小说, {strNovelStatus}小说, {strSiteName}, 免费阅读',
'{strNovelName},{strNovelName}免费全文阅读,{strNovelName}免费阅读无弹窗,{strNovelName}下载TXT',
'{strNovelName},{strNovelName}全文阅读,{strNovelName}免费无弹窗,{strNovelName}最新章节目录',
'{strNovelName},{strNovelName}完整版免费阅读,{strNovelName}小说最新章节免费阅读,{strNovelName}免费阅读全文',
'{strNovelName},{strNovelName}全文免费阅读,{strNovelName}最新章节更新,{strNovelName}全文免费',
'{strNovelName},{strNovelName}全文免费,{strNovelName}免费阅读更新,{strNovelName}最新章节',
'{strNovelName},{strNovelName}小说最新章节免费阅读,{strNovelName}免费阅读全文,{strNovelName}全文阅读',
'{strNovelName},{strNovelName}最新章节,{strNovelName}最新章节列表,{strNovelName}最新更新免费阅读',
'{strNovelName},{strNovelName}免费无弹窗,{strNovelName}最新章节目录,{strNovelName}无弹窗',
]
],
'NOVEL@GETNOVELCHAPTER@DESCRIPTION' => [
@@ -198,6 +229,19 @@ class TemplateSeeder
'sfg_id' => 18,
'arrSubjectFomart' => [
'{strNovelName}{strNovelChapterName}免费在线阅读,{strNovelAuthor}著。{strChapterDescription},快来{strSiteName}畅读精彩章节!',
'{strSiteName}提供{strNovelName}免费在线阅读,{strNovelAuthor}创作的{strNovelCategoryName}{strNovelStatus}小说,{strNovelDescription},欢迎体验{strSiteDomain}',
'{strSiteName}提供{strNovelName}免费全文阅读,本站支持手机和电脑在线阅读{strNovelName}免费阅读无弹窗,{strNovelName}简介:{strNovelDescription}',
'{strNovelName}资源由{strSiteName}为广大网友收集而来,还免费提供{strNovelName}免费在线阅读,同时还提供{strNovelName}免费全文阅读介绍简介等小说信息。',
'本书又名《{strNovelName}》{strNovelDescription}',
'{strSiteName}提供{strNovelAuthor}最新章节更新,本站支持手机和电脑在线阅读{strNovelName}全文免费,{strNovelName}简介:{strNovelDescription},。',
'{strNovelName}{strNovelAuthor}由{strSiteName}为您提供,包括{strSiteName}下载TXT,{strSiteName}下载,{strNovelDescription}',
'{strSiteName}为广大网友收集《{strNovelName}》全文阅读,{strNovelDescription}',
'【{strSiteName}】为您提供《{strNovelName}》完整版免费阅读【免费无弹窗阅读资源】。该小说由{strNovelAuthor}创作:{strNovelDescription}',
'《{strNovelName}》{strNovelCategoryName}由{strNovelAuthor}创作,讲述了{strNovelDescription}',
'{strSiteName}提供{strNovelName}小说最新章节免费阅读,本站支持手机和电脑在线阅读{strNovelName}免费阅读全文,{strNovelName}简介:{strNovelDescription}',
'{strNovelName}资源由{strSiteName}为广大网友收集而来,还免费提供{strNovelName}最新章节,同时还提供{strNovelName}最新章节列表介绍简介等小说信息。',
'【{strSiteName}】为您提供《{strNovelName}》免费无弹窗【免费无弹窗阅读资源】。该小说由{strNovelAuthor}创作:{strNovelDescription}',
'{strNovelName}全文阅读:{strNovelDescription}',
]
],
@@ -306,7 +350,7 @@ class TemplateSeeder
'description' => '最新章节特殊页URL 模板1',
'sfg_id' => 33,
'arrSubjectFomart' => [
'/books/{strPinYin}-{intNId}/chapter/latest',
'/xiaoshuo/{strPinYin}-{intNId}/chapter/latest',
]
],
'SEARCH_INFO_URL' => [
@@ -644,35 +688,35 @@ class TemplateSeeder
],
// 小说章节 url
'CONTENT_INFO_T2' => [
'CONTENT_INFO_URL_T2' => [
'description' => '内容章节URL 模板2',
'sfg_id' => 74,
'arrSubjectFomart' => [
'/novel/{strPinYin}-{intNId}/zhang-{intChapterSort}/{intChapterPage}',
]
],
'CONTENT_INFO_T3' => [
'CONTENT_INFO_URL_T3' => [
'description' => '内容章节URL 模板3',
'sfg_id' => 75,
'arrSubjectFomart' => [
'/book/{strPinYin}-{intNId}/zhang-{intChapterSort}/{intChapterPage}',
]
],
'CONTENT_INFO_T4' => [
'CONTENT_INFO_URL_T4' => [
'description' => '内容章节URL 模板4',
'sfg_id' => 76,
'arrSubjectFomart' => [
'/xiaoshuo-{strPinYin}-{intNId}/zhang-{intChapterSort}/{intChapterPage}',
]
],
'CONTENT_INFO_T5' => [
'CONTENT_INFO_URL_T5' => [
'description' => '内容章节URL 模板5',
'sfg_id' => 77,
'arrSubjectFomart' => [
'/novel-{strPinYin}-{intNId}/zhang-{intChapterSort}/{intChapterPage}',
]
],
'CONTENT_INFO_T6' => [
'CONTENT_INFO_URL_T6' => [
'description' => '内容章节URL 模板6',
'sfg_id' => 78,
'arrSubjectFomart' => [
@@ -689,35 +733,35 @@ class TemplateSeeder
* '/novel-{strPinYin}-{intNId}/chapter/latest',
* '/book-{strPinYin}-{intNId}/chapter/latest',
*/
'NEWS_CONTENT_INFO_T2' => [
'NEWS_CONTENT_INFO_URL_T2' => [
'description' => '最新内容章节URL 模板2',
'sfg_id' => 79,
'arrSubjectFomart' => [
'/novel/{strPinYin}-{intNId}/chapter/latest',
]
],
'NEWS_CONTENT_INFO_T3' => [
'NEWS_CONTENT_INFO_URL_T3' => [
'description' => '最新内容章节URL 模板3',
'sfg_id' => 80,
'arrSubjectFomart' => [
'/book/{strPinYin}-{intNId}/chapter/latest',
]
],
'NEWS_CONTENT_INFO_T4' => [
'NEWS_CONTENT_INFO_URL_T4' => [
'description' => '最新内容章节URL 模板4',
'sfg_id' => 81,
'arrSubjectFomart' => [
'/xiaoshuo-{strPinYin}-{intNId}/chapter/latest',
]
],
'NEWS_CONTENT_INFO_T5' => [
'NEWS_CONTENT_INFO_URL_T5' => [
'description' => '最新内容章节URL 模板5',
'sfg_id' => 82,
'arrSubjectFomart' => [
'/novel-{strPinYin}-{intNId}/chapter/latest',
]
],
'NEWS_CONTENT_INFO_T6' => [
'NEWS_CONTENT_INFO_URL_T6' => [
'description' => '最新内容章节URL 模板6',
'sfg_id' => 83,
'arrSubjectFomart' => [

View File

@@ -30,6 +30,25 @@
// );
// } catch (err) { }
// })();
function formatNovelUrl(strPinYin, intNId) {
return strNovelUrlTemp
.replace('{strPinYin}', encodeURIComponent(strPinYin))
.replace('{intNId}', intNId);
}
function formatNovelChapterUrl(strPinYin, intNId, intSort,intPage=0) {
return strNovelChapterUrlTemp
.replace('{strPinYin}', encodeURIComponent(strPinYin))
.replace('{intNId}', intNId)
.replace('{intChapterPage}', intPage)
.replace('{intChapterSort}', intSort);
}
function formatSearchUrl(strKey,intPage=1) {
return strSearchUrlTemp
.replace('{strSearchKeywords}', strKey)
.replace('{intPage}', intPage);
}
function isMobile() {
@@ -73,31 +92,31 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
});
function handleRedirect() {
const { pathname, origin, search } = window.location;
// Normalize pathname by replacing multiple slashes with a single slash
// 规范化路径名,将多个斜杠替换为单个斜杠
const normalizedPath = pathname.replace(/\/+/g, '/');
const strCurrentPath = normalizedPath || '/index.html';
// Build URL with proper slash handling
// 构建URL确保斜杠正确
const buildUrl = (path) => {
// Ensure path starts with a single slash and remove duplicate slashes
// 确保路径以单个斜杠开头,并移除多余斜杠
const cleanPath = `/${path.replace(/\/+/g, '/')}`.replace(/^\/+/, '/');
return `${origin}${cleanPath}${search}`;
};
if (isMobile()) {
// Mobile logic: Redirect PC paths to mobile paths
// 移动端逻辑将PC路径重定向到移动端路径
if (strCurrentPath.startsWith(strPcPath)) {
const newPath = strCurrentPath.replace(strPcPath, '') || '/';
window.location.href = buildUrl(newPath);
}
} else {
// PC logic: Redirect non-PC paths to PC paths
// PC端逻辑将非PC路径重定向到PC路径
if (!strCurrentPath.startsWith(strPcPath)) {
const newPath = `${strPcPath}${strCurrentPath === '/' ? '' : strCurrentPath}`;
// 确保 PC 首页以斜杠结尾
const newPath = strCurrentPath === '/' ? `${strPcPath}/` : `${strPcPath}${strCurrentPath}`;
window.location.href = buildUrl(newPath);
}
}
@@ -200,13 +219,15 @@ function displayBookshelf() {
const DomBookshelfContainer = document.getElementById('bookshelfMod-head');
const DomBookshelfContainerH5 = document.getElementById('list');
arrBookshelf.forEach(book => {
console.log(isMobile())
let strNovelUrl = formatNovelUrl(book.og_novel_pin_yin, book.n_id)
let strNovelChapterUrl = formatNovelChapterUrl(book.og_novel_pin_yin, book.n_id, book.c_sort_num)
let strSearchUrl = formatSearchUrl(book.og_novel_author, 1)
if (isMobile()) {
const bookElement = document.createElement('li');
bookElement.classList.add('book-shelf'); // 添加类名
bookElement.classList.add('li2'); // 添加类名
bookElement.innerHTML = `
<a href='/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}'>
<a href='${strNovelUrl}'>
<div class="leftImage2 ">
<img class="lazyload-img" src="${book.n_cover_path}" >
</div>
@@ -218,8 +239,7 @@ function displayBookshelf() {
<span class="spanLi">${book.c_name}</span>
</span>
<span class="spanLi Time">${book.og_novel_update_time ?? ''}</span>
<span class="rightJustTime"
onclick="javascript:window.location.href='/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}';return false;">
<span class="rightJustTime" onclick="javascript:window.location.href='${strNovelChapterUrl}';return false;">
继续阅读
</span>
</span>
@@ -234,24 +254,24 @@ function displayBookshelf() {
bookElement.classList.add('book-shelf'); // 添加类名
bookElement.innerHTML = `
<td>
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strPcPath}${strNovelUrl}" >
<img src="${book.n_cover_path}" >
</a>
</td>
<td class="t2">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >${book.og_novel_book_name}</a>
<a href="${strPcPath}${strNovelUrl}" >${book.og_novel_book_name}</a>
</td>
<td class="t3">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >${book.c_name}</a>
<a href="${strPcPath}${strNovelChapterUrl}" >${book.c_name}</a>
</td>
<td class="t4">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >${book.og_novel_author}</a>
<a href="${strPcPath}${strSearchUrl}" >${book.og_novel_author}</a>
</td>
<td class="t5">${book.og_novel_update_time}</td>
<td class="t6">${book.og_novel_status}</td>
<td class="t7">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" class="goon" >阅读</a>
<a href="${strPcPath}${strNovelChapterUrl}" class="goon" >阅读</a>
<i><span class="Collection" ajax-get="" onclick="delBookshelfFun(${book.n_id})">删除</span></i>
</td>
@@ -328,12 +348,15 @@ function displayHistory() {
const DomHistoryContainer = document.getElementById('bookshelfMod-head');
const DomBookshelfContainerH5 = document.getElementById('list');
arrHistory.forEach(book => {
let strNovelUrl = formatNovelUrl(book.og_novel_pin_yin, book.n_id)
let strNovelChapterUrl = formatNovelChapterUrl(book.og_novel_pin_yin, book.n_id, book.c_sort_num)
let strSearchUrl = formatSearchUrl(book.og_novel_author, 1)
if (isMobile()) {
const bookElement = document.createElement('li');
bookElement.classList.add('book-history'); // 添加类名
bookElement.classList.add('li2'); // 添加类名
bookElement.innerHTML = `
<a href='/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}'>
<a href='${strNovelUrl}'>
<div class="leftImage2 ">
<img class="lazyload-img" src="${book.n_cover_path}" >
</div>
@@ -345,8 +368,8 @@ function displayHistory() {
<span class="spanLi">${book.c_name}</span>
</span>
<span class="spanLi Time">${book.og_novel_update_time ?? ''}</span>
<span class="rightJustTime"
onclick="javascript:window.location.href='/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}';return false;">继续阅读</span>
<span class="rightJustTime" onclick="javascript:window.location.href='${strNovelChapterUrl}';return false;"
>继续阅读</span>
</span>
</div>
</a>
@@ -358,24 +381,24 @@ function displayHistory() {
bookElement.classList.add('book-history'); // 添加类名
bookElement.innerHTML = `
<td>
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >
<a href="${strPcPath}${strNovelUrl}" >
<img src="${book.n_cover_path}" >
</a>
</td>
<td class="t2">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >${book.og_novel_book_name}</a>
<a href="${strPcPath}${strNovelUrl}" >${book.og_novel_book_name}</a>
</td>
<td class="t3">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" >${book.c_name}</a>
<a href="${strPcPath}${strNovelChapterUrl}" >${book.c_name}</a>
</td>
<td class="t4">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}" >${book.og_novel_author}</a>
<a href="${strPcPath}${strSearchUrl}" >${book.og_novel_author}</a>
</td>
<td class="t5">${book.og_novel_update_time ?? ''}</td>
<td class="t6">${book.og_novel_status}</td>
<td class="t7">
<a href="/pc/xiaoshuo/${book.og_novel_pin_yin}-${book.n_id}/zhang-${book.c_sort_num}" class="goon" >阅读</a>
<a href="${strNovelChapterUrl}" class="goon" >阅读</a>
<i><span class="Collection" ajax-get="" onclick="delHistoryFun(${book.n_id})">删除</span></i>
</td>